Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-15530

scons -c deletes directories named "core"

    XMLWordPrintable

Details

    • Architecture

    Description

      If you run "scons -c" in a directory tree with a directory named "core", it will delete that directory.  Found that out when inside "daf_butler", which has directory named python/lsst/daf/butler/core, and it deleted the directory and the code below it.

      Attachments

        Activity

          It looks to me like the cleanExt option in sconsUtils is only ever None (I don't see it overridden anywhere), which means we only get the default file list in scripts.py:114. Given this, we could probably put a little logic about "core" in builders.CleanTree() (which is the only thing that takes cleanExt) to make the recurse option a bit smarter.

          I may have been the cause of this with DM-14124. Which suggests a possibly simple solution: two separate runs of CleanTree(), the first with the "standard" list of things to remove and without -prune, the second with any known directories (e.g. .cache) and with -prune.

          Parejkoj John Parejko added a comment - It looks to me like the cleanExt option in sconsUtils is only ever None (I don't see it overridden anywhere), which means we only get the default file list in scripts.py:114 . Given this, we could probably put a little logic about "core" in builders.CleanTree() (which is the only thing that takes cleanExt ) to make the recurse option a bit smarter. I may have been the cause of this with DM-14124 . Which suggests a possibly simple solution: two separate runs of CleanTree() , the first with the "standard" list of things to remove and without - prune , the second with any known directories (e.g. .cache) and with -prune .
          tjenness Tim Jenness added a comment -

          On Slack the feeling was that at the very least cleaning of files should not be using rm -rf and that -type f and -type d should be used to make clear that directory and file confusion could never happen.

          tjenness Tim Jenness added a comment - On Slack the feeling was that at the very least cleaning of files should not be using rm -rf and that -type f and -type d should be used to make clear that directory and file confusion could never happen.
          ktl Kian-Tat Lim added a comment -

          It's not elegant, but I think it gets the job done. Tested against a C++ package (geom) and the original problem package (daf_butler).

          ktl Kian-Tat Lim added a comment - It's not elegant, but I think it gets the job done. Tested against a C++ package (geom) and the original problem package (daf_butler).
          tjenness Tim Jenness added a comment -

          Thanks. Looks good.

          tjenness Tim Jenness added a comment - Thanks. Looks good.
          ktl Kian-Tat Lim added a comment -

          Merged in 914fe58. I don't think Jenkins ever uses scons -c, so I took a chance and didn't run it.

          ktl Kian-Tat Lim added a comment - Merged in 914fe58. I don't think Jenkins ever uses scons -c , so I took a chance and didn't run it.

          People

            ktl Kian-Tat Lim
            spietrowicz Steve Pietrowicz
            Tim Jenness
            Jim Bosch, John Parejko, Kian-Tat Lim, Steve Pietrowicz, Tim Jenness
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Jenkins

                No builds found.