Glob "source" argument appears to be ignored
Glob is documented as taking an argument source:
The
sourceargument may be set toTrue(or any equivalent value) to specify that, when the local directory is aVariantDir, the returned Nodes should be from the corresponding source directory, not the local directory.
While this argument is certainly accepted, and passed around within the various routines that constitute the implementation of Glob, it appears nothing is ever done with it. The ultimate routine which produces the matches is _glob1 in SCons.Node.FS.Dir, and it never makes any reference to this argument.
There is one test which purports to check this behavior - test/Glob/source.py. However, the test method is to write a file to the source directory, try to glob for it in the variant directory, and make sure you get the right contents. The contents will match whether you picked up the file from the source directory or the variant directory, so this part of the test doesn't seem to actually do anything useful.
Also - it seems to me I've read, though I can't find the reference now, that the flag should only be meaningful if duplicate=0 for the variant dir. Don't know how much this matters, but we might want to clarify.
Also - it seems to me I've read, though I can't find the reference now, that the flag should only be meaningful if
duplicate=0for the variant dir. Don't know how much this matters, but we might want to clarify.
There's still reasons you'd want the source location even if you had duplicate=1/True. (Convoluted, complicated ones, but I'm sure someone depends on them in some build.. ;)