Repository navigation
Unknown variables from Variables file are now reported - #4653
Merged
Merged
Conversation
Previously Update added everything from the file(s) to the local values dict by doing "exec", and then unknown ones ended up silently dropped since they weren't declared as options. Now the result of the exec call is reprocessed so unknowns can be collected. Fixes SCons#4645 Signed-off-by: Mats Wichmann <[email protected]>
Contributor
|
This changes the previous behavior. Fairly certain I've seen such depended on in the wild. |
Collaborator
Author
|
They shouldn't - existing bit of Update: # put the variables in the environment:
# (don't copy over variables that are not declared as options)
for option in self.options:
try:
env[option.key] = values[option.key]
except KeyError:
pass |
Collaborator
Author
|
1523e6f372 src/engine/SCons/Options.py (Steven Knight 2002-09-26 00:54:35 +0000 276) # put the variables in the environment:
13985d5667 src/engine/SCons/Options/__init__.py (Steven Knight 2007-07-15 13:42:20 +0000 277) # (don't copy over variables that are not declared as options)
82bf497dd0 src/engine/SCons/Options.py (Steven Knight 2002-10-13 12:52:05 +0000 278) for option in self.options:
82bf497dd0 src/engine/SCons/Options.py (Steven Knight 2002-10-13 12:52:05 +0000 279) try:
82bf497dd0 src/engine/SCons/Options.py (Steven Knight 2002-10-13 12:52:05 +0000 280) env[option.key] = values[option.key]
82bf497dd0 src/engine/SCons/Options.py (Steven Knight 2002-10-13 12:52:05 +0000 281) except KeyError:
82bf497dd0 src/engine/SCons/Options.py (Steven Knight 2002-10-13 12:52:05 +0000 282) pass
1523e6f372 src/engine/SCons/Options.py (Steven Knight 2002-09-26 00:54:35 +0000 283) So I think we can say that unknown options have never been copied to the environment. However, the added check reading from the files doesn't have to exclude unknowns (since they'll be skipped by the mentioned chunk anyway) and just add to the |
Contributor
|
You are correct. I was mistaken.. sorry bout that.. |
Signed-off-by: Mats Wichmann <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously
Updateadded everything from the file(s) to the local values dict by doingexec, and then unknown ones ended up silently dropped since they weren't declared as options. Now the result of the exec call is reprocessed, so unknowns can be collected.No doc impacts - just making it work as documented (see linked issue).
Fixes #4645
Contributor Checklist:
CHANGES.txtandRELEASE.txt(and read theREADME.rst).