Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glob "source" argument appears to be ignored #4233

Open
mwichmann opened this issue Sep 14, 2022 · 2 comments
Open

Glob "source" argument appears to be ignored #4233

mwichmann opened this issue Sep 14, 2022 · 2 comments
Assignees
Labels
Glob Issues with Glob()

Comments

@mwichmann
Copy link
Collaborator

mwichmann commented Sep 14, 2022

Glob is documented as taking an argument source:

The source argument may be set to True (or any equivalent value) to specify that, when the local directory is a VariantDir, 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.

@mwichmann mwichmann added the Glob Issues with Glob() label Sep 14, 2022
@mwichmann
Copy link
Collaborator Author

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.

@bdbaddog
Copy link
Contributor

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.

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.. ;)

@mwichmann mwichmann self-assigned this Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Glob Issues with Glob()
Projects
None yet
Development

No branches or pull requests

2 participants