diff options
author | Scott Murray <scott.murray@konsulko.com> | 2022-02-13 15:37:07 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-02-21 23:36:47 +0000 |
commit | 87104b6a167188921da157c7dba45938849fb22a (patch) | |
tree | 6db463cfa614f3ff8cb02f02600fc00727cf1276 | |
parent | efaafc9ec2e8c0475e3fb27e877a1c0a5532a0e5 (diff) | |
download | bitbake-87104b6a167188921da157c7dba45938849fb22a.tar.gz |
bitbake: Rename environment filtering variables
In line with the inclusive language migration defined at:
https://wiki.yoctoproject.org/wiki/Inclusive_language
rename:
BB_ENV_WHITELIST -> BB_ENV_PASSTHROUGH
BB_ENV_EXTRAWHITE -> BB_ENV_PASSTHROUGH_ADDITIONS
(Bitbake rev: fe60627839d4280cf0117ed1afbfccdff1181b6a)
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | bin/toaster | 2 | ||||
-rw-r--r-- | doc/bitbake-user-manual/bitbake-user-manual-execution.rst | 4 | ||||
-rw-r--r-- | doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 18 | ||||
-rw-r--r-- | doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst | 25 | ||||
-rw-r--r-- | lib/bb/data_smart.py | 2 | ||||
-rw-r--r-- | lib/bb/tests/runqueue.py | 4 | ||||
-rw-r--r-- | lib/bb/utils.py | 20 |
7 files changed, 39 insertions, 36 deletions
diff --git a/bin/toaster b/bin/toaster index 6b90ee18..8711014c 100755 --- a/bin/toaster +++ b/bin/toaster @@ -248,7 +248,7 @@ fi # 3) the sqlite db if that is being used. # 4) pid's we need to clean up on exit/shutdown export TOASTER_DIR=$TOASTERDIR -export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE TOASTER_DIR" +export BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS TOASTER_DIR" # Determine the action. If specified by arguments, fine, if not, toggle it if [ "$CMD" = "start" ] ; then diff --git a/doc/bitbake-user-manual/bitbake-user-manual-execution.rst b/doc/bitbake-user-manual/bitbake-user-manual-execution.rst index f99001bc..31ee4e34 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-execution.rst +++ b/doc/bitbake-user-manual/bitbake-user-manual-execution.rst @@ -79,8 +79,8 @@ directives. Prior to parsing configuration files, BitBake looks at certain variables, including: -- :term:`BB_ENV_WHITELIST` -- :term:`BB_ENV_EXTRAWHITE` +- :term:`BB_ENV_PASSTHROUGH` +- :term:`BB_ENV_PASSTHROUGH_ADDITIONS` - :term:`BB_PRESERVE_ENV` - :term:`BB_ORIGENV` - :term:`BITBAKE_UI` diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst index 8496e1da..174cac78 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst @@ -1343,8 +1343,8 @@ the build machine cannot influence the build. .. note:: By default, BitBake cleans the environment to include only those - things exported or listed in its whitelist to ensure that the build - environment is reproducible and consistent. You can prevent this + things exported or listed in its passthrough list to ensure that the + build environment is reproducible and consistent. You can prevent this "cleaning" by setting the :term:`BB_PRESERVE_ENV` variable. Consequently, if you do want something to get passed into the build task @@ -1352,14 +1352,14 @@ environment, you must take these two steps: #. Tell BitBake to load what you want from the environment into the datastore. You can do so through the - :term:`BB_ENV_WHITELIST` and - :term:`BB_ENV_EXTRAWHITE` variables. For + :term:`BB_ENV_PASSTHROUGH` and + :term:`BB_ENV_PASSTHROUGH_ADDITIONS` variables. For example, assume you want to prevent the build system from accessing - your ``$HOME/.ccache`` directory. The following command "whitelists" - the environment variable ``CCACHE_DIR`` causing BitBake to allow that - variable into the datastore:: + your ``$HOME/.ccache`` directory. The following command adds the + the environment variable ``CCACHE_DIR`` to BitBake's passthrough + list to allow that variable into the datastore:: - export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE CCACHE_DIR" + export BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS CCACHE_DIR" #. Tell BitBake to export what you have loaded into the datastore to the task environment of every running task. Loading something from the @@ -1376,7 +1376,7 @@ environment, you must take these two steps: A side effect of the previous steps is that BitBake records the variable as a dependency of the build process in things like the setscene checksums. If doing so results in unnecessary rebuilds of - tasks, you can whitelist the variable so that the setscene code + tasks, you can also flag the variable so that the setscene code ignores the dependency when it creates checksums. Sometimes, it is useful to be able to obtain information from the diff --git a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst index bdd4127a..b2379e62 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst +++ b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst @@ -236,23 +236,23 @@ overview of their function and contents. based on the interval occur each time a respective interval is reached beyond the initial warning (i.e. 1 Gbytes and 100 Kbytes). - :term:`BB_ENV_EXTRAWHITE` - Specifies an additional set of variables to allow through (whitelist) - from the external environment into BitBake's datastore. This list of - variables are on top of the internal list set in - :term:`BB_ENV_WHITELIST`. + :term:`BB_ENV_PASSTHROUGH_ADDITIONS` + Specifies an additional set of variables to allow through from the + external environment into BitBake's datastore. This list of variables + are on top of the internal list set in + :term:`BB_ENV_PASSTHROUGH`. .. note:: You must set this variable in the external environment in order for it to work. - :term:`BB_ENV_WHITELIST` - Specifies the internal whitelist of variables to allow through from + :term:`BB_ENV_PASSTHROUGH` + Specifies the internal list of variables to allow through from the external environment into BitBake's datastore. If the value of this variable is not specified (which is the default), the following list is used: :term:`BBPATH`, :term:`BB_PRESERVE_ENV`, - :term:`BB_ENV_WHITELIST`, and :term:`BB_ENV_EXTRAWHITE`. + :term:`BB_ENV_PASSTHROUGH`, and :term:`BB_ENV_PASSTHROUGH_ADDITIONS`. .. note:: @@ -452,8 +452,9 @@ overview of their function and contents. :term:`BB_ORIGENV` Contains a copy of the original external environment in which BitBake - was run. The copy is taken before any whitelisted variable values are - filtered into BitBake's datastore. + was run. The copy is taken before any variable values configured to + pass through from the external environment are filtered into BitBake's + datastore. .. note:: @@ -461,8 +462,8 @@ overview of their function and contents. queried using the normal datastore operations. :term:`BB_PRESERVE_ENV` - Disables whitelisting and instead allows all variables through from - the external environment into BitBake's datastore. + Disables environment filtering and instead allows all variables through + from the external environment into BitBake's datastore. .. note:: diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py index 7cf17b00..97da43ff 100644 --- a/lib/bb/data_smart.py +++ b/lib/bb/data_smart.py @@ -34,6 +34,8 @@ __whitespace_split__ = re.compile(r'(\s)') __override_regexp__ = re.compile(r'[a-z0-9]+') bitbake_renamed_vars = { + "BB_ENV_WHITELIST": "BB_ENV_PASSTHROUGH", + "BB_ENV_EXTRAWHITE": "BB_ENV_PASSTHROUGH_ADDITIONS", "BB_HASHBASE_WHITELIST": "BB_BASEHASH_IGNORE_VARS", "BB_HASHTASK_WHITELIST": "BB_TASKHASH_IGNORE_TASKS", } diff --git a/lib/bb/tests/runqueue.py b/lib/bb/tests/runqueue.py index 35d5a843..79b79b5a 100644 --- a/lib/bb/tests/runqueue.py +++ b/lib/bb/tests/runqueue.py @@ -29,14 +29,14 @@ class RunQueueTests(unittest.TestCase): def run_bitbakecmd(self, cmd, builddir, sstatevalid="", slowtasks="", extraenv=None, cleanup=False): env = os.environ.copy() env["BBPATH"] = os.path.realpath(os.path.join(os.path.dirname(__file__), "runqueue-tests")) - env["BB_ENV_EXTRAWHITE"] = "SSTATEVALID SLOWTASKS TOPDIR" + env["BB_ENV_PASSTHROUGH_ADDITIONS"] = "SSTATEVALID SLOWTASKS TOPDIR" env["SSTATEVALID"] = sstatevalid env["SLOWTASKS"] = slowtasks env["TOPDIR"] = builddir if extraenv: for k in extraenv: env[k] = extraenv[k] - env["BB_ENV_EXTRAWHITE"] = env["BB_ENV_EXTRAWHITE"] + " " + k + env["BB_ENV_PASSTHROUGH_ADDITIONS"] = env["BB_ENV_PASSTHROUGH_ADDITIONS"] + " " + k try: output = subprocess.check_output(cmd, env=env, stderr=subprocess.STDOUT,universal_newlines=True, cwd=builddir) print(output) diff --git a/lib/bb/utils.py b/lib/bb/utils.py index c07d19cf..2e825610 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -589,8 +589,8 @@ def preserved_envvars(): v = [ 'BBPATH', 'BB_PRESERVE_ENV', - 'BB_ENV_WHITELIST', - 'BB_ENV_EXTRAWHITE', + 'BB_ENV_PASSTHROUGH', + 'BB_ENV_PASSTHROUGH_ADDITIONS', ] return v + preserved_envvars_exported() @@ -621,21 +621,21 @@ def filter_environment(good_vars): def approved_variables(): """ - Determine and return the list of whitelisted variables which are approved + Determine and return the list of variables which are approved to remain in the environment. """ if 'BB_PRESERVE_ENV' in os.environ: return os.environ.keys() approved = [] - if 'BB_ENV_WHITELIST' in os.environ: - approved = os.environ['BB_ENV_WHITELIST'].split() - approved.extend(['BB_ENV_WHITELIST']) + if 'BB_ENV_PASSTHROUGH' in os.environ: + approved = os.environ['BB_ENV_PASSTHROUGH'].split() + approved.extend(['BB_ENV_PASSTHROUGH']) else: approved = preserved_envvars() - if 'BB_ENV_EXTRAWHITE' in os.environ: - approved.extend(os.environ['BB_ENV_EXTRAWHITE'].split()) - if 'BB_ENV_EXTRAWHITE' not in approved: - approved.extend(['BB_ENV_EXTRAWHITE']) + if 'BB_ENV_PASSTHROUGH_ADDITIONS' in os.environ: + approved.extend(os.environ['BB_ENV_PASSTHROUGH_ADDITIONS'].split()) + if 'BB_ENV_PASSTHROUGH_ADDITIONS' not in approved: + approved.extend(['BB_ENV_PASSTHROUGH_ADDITIONS']) return approved def clean_environment(): |