3 mxml.h, 2 mxml.cxx

Issue #355 new
dd1 created an issue

I note that midas git now has not one but 3 copies of mxml.h and 2 copies of mxml.cxx, all slightly different. one mxml.h comes from mxml submodule of midas, one mxml.h comes from mxml submodule of mscb submodule, 3rd one is probably bogus. which of these multiple files are used to build which executables is a mystery.

bash-3.2$ git describe
midas-2019-05-cxx-2134-g941a6423
bash-3.2$ ls -l `find . -name mxml.h`
-rw-r--r--  1 olchansk  staff  5479 Jul 27  2013 ./mexwrapper/mxml.h
-rw-r--r--  1 olchansk  staff  5956 Aug  4 06:40 ./mscb/mxml/mxml.h
-rw-r--r--  1 olchansk  staff  5965 Aug  4 06:38 ./mxml/mxml.h
bash-3.2$ ls -l `find . -name mxml.cxx`
-rw-r--r--  1 olchansk  staff  68751 Aug  4 06:40 ./mscb/mxml/mxml.cxx
-rw-r--r--  1 olchansk  staff  69644 Aug  4 06:38 ./mxml/mxml.cxx
bash-3.2$ 

Comments (17)

  1. Stefan Ritt

    Before, mxml.h was in the mxml module, in midas itself (include/mxml.h) and in mexwrapper. I removed it now from include/mxml.h. Unfortunately, the mxml package is used both by mscb (as a standalone project) and midas itself. So I see currently no other option than including the submodule twice, once under midas and once under mscb. Of course they should always be the same version. I will fix this mismatch.

  2. dd1 reporter

    this is a design flaw with cmake subprojects. if midas/aaa wants mscb and midas/bbb wants mscb, cmake has no way to specify that both should use the same common mscb. in fact I think they make it a feature that the two mscbs can be different. (of course git is git and allows you to do anything you want). cmake die, die, die. K.O.

  3. dd1 reporter

    difficulties:

    • “git pull” did not automatically update both mxmls
    • “git submodule update” did not not update mscb/mxml
    • I had to do “cd mscb; git submodule update”

    now both mxmls are the same. but I am sure I will forget to update mscb/mxml the next time. I do not think it updates automatically.

    K.O.

  4. dd1 reporter

    I forgot to mention, that this was all started by a build failure after a “git pull”. cmake complained “cannot find mxml/mxml.cxx”. After a bit of head scratching I had to “cd mscb; git submodule init; git submodule update, etc”. I think everybody who builds midas will stumble over this. We should better post a notice to the midas forum. K.O.

  5. Stefan Ritt

    Using submodules can be a bit of a pain. Try

    git submodule update --recursive
    

    When you check out a fresh repository, you need a

    git clone ... --recursive
    

    as well.

    But the mxml repository will very seldom change, it’s just now this time when I actually wanted to fix the problem with having the same file in midas/include and in the midas/mxml/ submodule.

  6. Stefan Ritt

    I believe (but am not 100% sure) that a

    git pull --recurse-submodules
    

    instead of a “git pull” would have solved that. Can you check that? If it works, we can post it on the forum.

  7. dd1 reporter

    I think Ubuntu 20 or 22 “git pull” automatically does all that --recurse business. MacOS “git” does not. My brain cannot remember all that stuff anyway, perhaps I should add a “make pull” rule in the Makefile. K.O.

  8. dd1 reporter

    just tested on ubuntu 22:

    • git pull --recurse-submodules
    • git submodule update --recursive

    both leave mscb/mxml empty (build bombs)

    • git submodule update --init --recursive

    this one creates and pulls it correctly.

    to see the whole mess:

    daqubuntu:midas$ git submodule status --recursive
     11b76d185f1a13675310f81df6846b8c9e98212a manalyzer (remotes/origin/SaferMultithreading-9-g11b76d1)
     9f883154e33945b13fda7334386d8d1666f47d3c midasio (remotes/origin/HEAD)
     048b16407adaa39ef15c1fff07d0f17b37ac8371 mjson (remotes/origin/HEAD)
     83f265873ae0bcc0ff984ef30bbf99961d0c9a64 mscb (remotes/origin/HEAD)
     d29b1093edfeb84585591231896f993333b3a651 mscb/mxml (mxml-2019-03-a-23-gd29b109)
     de6360fbcc3c0720fe4ab93a2ccd63ecec0caee4 mvodb (heads/master)
     d29b1093edfeb84585591231896f993333b3a651 mxml (mxml-2019-03-a-23-gd29b109)
    daqubuntu:midas$ 
    

  9. Log in to comment