Forum | Documentation | Website | Blog

Skip to content
  • Ulf Magnusson's avatar
    kconfig: Get rid of 'option env' bounce symbols · 4dc9e5b2
    Ulf Magnusson authored
    
    
    This commit gets rid of the 'option env="ENV_VAR"' bounce symbols.
    "$FOO" now expands directly to the value of the environment variable
    FOO, instead of to the value of the Kconfig symbol FOO.
    
    This change is likely to soon appear in the C tools as well. Those
    'option env' symbols always seemed kinda pointless, and have broken
    dependency handling due to forcing symbol evaluation during parsing,
    before all the symbols have even been seen.
    
    Compatibility with the C tools could be retained by naming all
    'option env' symbols the same as the environment variable they
    reference.
    
    This commit also updated the Zephyr documentation to explain the new
    behavior. It's relevant for $ZEPHYR_BASE and out-of-tree Kconfig
    extensions.
    
    Commit message from Kconfiglib (cbf32e29a130d)
    ==============================================
    
    Make "$FOO" directly reference the environment variable $FOO in e.g.
    'source' statements, instead of the symbol FOO. Use os.path.expandvars()
    to expand strings (which preserves "$FOO" as-is if no environment
    variable FOO exists).
    
    This gets rid of the 'option env' "bounce" symbols, which are mostly
    just spam and are buggy in the C tools (dependencies aren't always
    respected, due to parsing and evaluation getting mixed up). The same
    change will probably appear soon in the C tools as well.
    
    Keep accepting 'option env' to preserve some backwards compatibility,
    but ignore it when expanding strings. For compatibility with the C
    tools, bounce symbols will need to be named the same as the environment
    variables they reference (which is the case for the Linux kernel).
    
    This is a compatibility break, so the major version will be bumped to 6
    at the next release.
    
    The main motivation for adding this now is to allow recording properties
    on each MenuNode in a clean way. 'option env' symbols interact badly
    with delayed dependency propagation.
    
    Side note: I have a feeling that recording environment variable values
    might be redundant to trigger rebuilds if sync_deps() is run at each
    compile. It should detect all changes to symbol values due to
    environment variables changing value.
    
    Signed-off-by: default avatarUlf Magnusson <[email protected]>
    4dc9e5b2