-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Prevent a crash when using --repo_env=VAR without a value #12886
Closed
EdSchouten
wants to merge
1
commit into
bazelbuild:master
from
EdSchouten:eschouten/20210122-repo-env
Closed
Prevent a crash when using --repo_env=VAR without a value #12886
EdSchouten
wants to merge
1
commit into
bazelbuild:master
from
EdSchouten:eschouten/20210122-repo-env
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The --repo_env option is documented in the same way as --action_env. In addition to allowing you to set explicit values, you can also use it to explicitly pick values from the environment in which Bazel was invoked. Unfortunately, this causes a null pointer exception in Starlark due to a null string stored as a map value. This change extends the logic of converting --repo_env to a map to take null values into account. When null, the value is loaded from the current environment. This behaviour is useful in case you want to do something like this: --incompatible_strict_action_env --action_env=PATH=... --repo_env=PATH This allows you to run build actions with a strict value for $PATH (e.g., to get a decent action cache hit rate in case of remote execution), while still allowing repository_ctx.which() to find tools on the host system using $PATH.
Friendly ping! |
jin
added
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
team-OSS
Issues for the Bazel OSS team: installation, release processBazel packaging, website
labels
Mar 1, 2021
philwo
approved these changes
Mar 12, 2021
philwo
pushed a commit
that referenced
this pull request
Mar 15, 2021
The --repo_env option is documented in the same way as --action_env. In addition to allowing you to set explicit values, you can also use it to explicitly pick values from the environment in which Bazel was invoked. Unfortunately, this causes a null pointer exception in Starlark due to a null string stored as a map value. This change extends the logic of converting --repo_env to a map to take null values into account. When null, the value is loaded from the current environment. This behaviour is useful in case you want to do something like this: --incompatible_strict_action_env --action_env=PATH=... --repo_env=PATH This allows you to run build actions with a strict value for $PATH (e.g., to get a decent action cache hit rate in case of remote execution), while still allowing repository_ctx.which() to find tools on the host system using $PATH. Closes #12886. PiperOrigin-RevId: 362506900
philwo
pushed a commit
that referenced
this pull request
Mar 15, 2021
The --repo_env option is documented in the same way as --action_env. In addition to allowing you to set explicit values, you can also use it to explicitly pick values from the environment in which Bazel was invoked. Unfortunately, this causes a null pointer exception in Starlark due to a null string stored as a map value. This change extends the logic of converting --repo_env to a map to take null values into account. When null, the value is loaded from the current environment. This behaviour is useful in case you want to do something like this: --incompatible_strict_action_env --action_env=PATH=... --repo_env=PATH This allows you to run build actions with a strict value for $PATH (e.g., to get a decent action cache hit rate in case of remote execution), while still allowing repository_ctx.which() to find tools on the host system using $PATH. Closes #12886. PiperOrigin-RevId: 362506900
philwo
removed
the
team-OSS
Issues for the Bazel OSS team: installation, release processBazel packaging, website
label
Nov 29, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The --repo_env option is documented in the same way as --action_env. In
addition to allowing you to set explicit values, you can also use it to
explicitly pick values from the environment in which Bazel was invoked.
Unfortunately, this causes a null pointer exception in Starlark due to a
null string stored as a map value.
This change extends the logic of converting --repo_env to a map to take
null values into account. When null, the value is loaded from the
current environment. This behaviour is useful in case you want to do
something like this:
--incompatible_strict_action_env --action_env=PATH=... --repo_env=PATH
This allows you to run build actions with a strict value for $PATH (e.g.,
to get a decent action cache hit rate in case of remote execution),
while still allowing repository_ctx.which() to find tools on the host
system using $PATH.