Skip to content

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

Closed

Description

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())

Activity

  1. added
    Variables
    on Nov 18, 2024
  2. mwichmann commented on Nov 18, 2024

    @mwichmann
    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.

  3. mwichmann commented on Nov 18, 2024

    @mwichmann
    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.

  4. added a commit that references this issue on Nov 18, 2024
    a8ef7dd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Variablesbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions