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

UnknownVariables doesn't return unknown variables defined in files #4645

Closed
dustdfg opened this issue Nov 14, 2024 Discussed in #4644 · 2 comments · Fixed by #4653
Closed

UnknownVariables doesn't return unknown variables defined in files #4645

dustdfg opened this issue Nov 14, 2024 Discussed in #4644 · 2 comments · Fixed by #4653
Labels
bug Variables Variables() subsystem

Comments

@dustdfg
Copy link
Contributor

dustdfg commented Nov 14, 2024

Running scons will print {}, while running scons my_var="cli_value" will print {'my_var': 'cli_value'}

#custom.py
my_var="value"
import SCons
from SCons.Variables import *

env = Environment()

options = Variables(["custom.py"], ARGUMENTS)
options.Add("my_option", "", "")

options.Update(env)

print(options.UnknownVariables())
@mwichmann mwichmann added the Variables Variables() subsystem label Nov 18, 2024
@mwichmann
Copy link
Collaborator

The current manpage wording suggests "unknown" variables from files should indeed be flagged:

Returns a dictionary containing any variables that were specified in the files and/or args parameters when Variables was called, but the object was not actually configured for.

@mwichmann mwichmann added the bug label Nov 18, 2024
@mwichmann
Copy link
Collaborator

I can confirm there's no processing of unknowns in the variables-file reading section. It just does an exec to add the assignments to the dict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Variables Variables() subsystem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants