summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2022-06-01 21:28:03 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2022-06-01 21:28:03 (GMT)
commitc9c678683a3944b0500a8ce68c80d7c5d48c9230 (patch)
tree36559ee115cc499770e413eb2ac89ae7c82f0034
parentf262fbd6bacf1c0d7f26d747d853b9ce909f4442 (diff)
downloadSCons-c9c678683a3944b0500a8ce68c80d7c5d48c9230.zip
SCons-c9c678683a3944b0500a8ce68c80d7c5d48c9230.tar.gz
SCons-c9c678683a3944b0500a8ce68c80d7c5d48c9230.tar.bz2
Updated CHANGES/RELEASE to be a bit simpler. Fixed typo in docs for SHELL_ENV_GENERATORS.
-rwxr-xr-xCHANGES.txt9
-rwxr-xr-xRELEASE.txt9
-rw-r--r--SCons/Action.py10
-rw-r--r--SCons/Action.xml8
-rw-r--r--test/Actions/subst_shell_env.py2
5 files changed, 25 insertions, 13 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index d5aba9f..84ec06b 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -99,9 +99,12 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
- Added user configurable setting of ninja depfile format via NINJA_DEPFILE_PARSE_FORMAT.
Now setting NINJA_DEPFILE_PARSE_FORMAT to [msvc,gcc,clang] can force the ninja expected
format. Compiler tools will also configure the variable automatically.
- - Added SHELL_ENV_GENERATORS construction variable. This variable
- is an iterable which will contain functions in which each are called and each can allow
- the user a method to customize the execution environment.
+ - Added SHELL_ENV_GENERATORS construction variable. This variable should be set to a list
+ (or an iterable) which contains functions to be called in order
+ when constructing the execution environment (Generally this is the shell environment
+ variables). This allows the user to customize how (for example) PATH is constructed.
+ Note that these are called for every build command run by SCons. It could have considerable
+ performance impact if not used carefully.
- Updated ninja scons daemon scripts to output errors to stderr as well as the daemon log.
- Fix typo in ninja scons daemon startup which causes ConnectionRefusedError to not retry
to connect to the server during start up.
diff --git a/RELEASE.txt b/RELEASE.txt
index 195e325..e7fa31c 100755
--- a/RELEASE.txt
+++ b/RELEASE.txt
@@ -16,9 +16,12 @@ NEW FUNCTIONALITY
- Added MSVC_USE_SCRIPT_ARGS variable to pass arguments to MSVC_USE_SCRIPT.
- Added Configure.CheckMember() checker to check if struct/class has the specified member.
-- Added SHELL_ENV_GENERATORS construction variable. This variable
- is an iterable which will contain functions in which each are called and each can allow
- the user a method to customize the execution environment.
+- Added SHELL_ENV_GENERATORS construction variable. This variable should be set to a list
+ (or an iterable) which contains functions to be called in order
+ when constructing the execution environment (Generally this is the shell environment
+ variables). This allows the user to customize how (for example) PATH is constructed.
+ Note that these are called for every build command run by SCons. It could have considerable
+ performance impact if not used carefully.
- Added MSVC_USE_SETTINGS variable to pass a dictionary to configure the msvc compiler
system environment as an alternative to bypassing Visual Studio autodetection entirely.
diff --git a/SCons/Action.py b/SCons/Action.py
index e29c4e9..6e67c7f 100644
--- a/SCons/Action.py
+++ b/SCons/Action.py
@@ -756,9 +756,15 @@ def get_default_ENV(env):
def _resolve_shell_env(env, target, source):
+ """
+ First get default environment.
+ Then if SHELL_ENV_GENERATORS is set and is iterable,
+ call each callable in that list to allow it to alter
+ the created execution environment.
+ """
ENV = get_default_ENV(env)
- shell_gen = env.get('SHELL_ENV_GENERATORS')
- if shell_gen is not None:
+ shell_gen = env.get('SHELL_ENV_GENERATORS')
+ if shell_gen:
try:
shell_gens = iter(shell_gen)
except TypeError:
diff --git a/SCons/Action.xml b/SCons/Action.xml
index 8994adb..1346db2 100644
--- a/SCons/Action.xml
+++ b/SCons/Action.xml
@@ -203,7 +203,7 @@ in which the command should be executed.
<cvar name="SHELL_ENV_GENERATORS">
<summary>
<para>
-Must be an iterable containing functions where each function generates or
+Must be a list (or an iterable) containing functions where each function generates or
alters the environment dictionary which will be used
when executing the &cv-link-SPAWN; function. The functions will initially
be passed a reference of the current execution environment (e.g. env['ENV']),
@@ -214,14 +214,14 @@ values.
This primary purpose of this construction variable is to give the user the ability
to substitute execution environment variables based on env, targets, and sources.
-If desired, the user can completly customize the execution environment for particular
+If desired, the user can completely customize the execution environment for particular
targets.
</para>
<example_commands>
def custom_shell_env(env, target, source, shell_env):
- # customize shell_env if desired
- if str(target[0]) == 'special_target'is:
+ """customize shell_env if desired"""
+ if str(target[0]) == 'special_target':
shell_env['SPECIAL_VAR'] = env.subst('SOME_VAR', target=target, source=source)
return shell_env
diff --git a/test/Actions/subst_shell_env.py b/test/Actions/subst_shell_env.py
index d26f0ae..02ba640 100644
--- a/test/Actions/subst_shell_env.py
+++ b/test/Actions/subst_shell_env.py
@@ -25,7 +25,7 @@
"""
Verify that shell environment variables can be expanded per target/source
-when exectuting actions on the command line.
+when executing actions on the command line.
"""
import os