-
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
Do not validate input-only settings in transitions #14972
Closed
Closed
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
fmeum
commented
Mar 6, 2022
src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkTransition.java
Show resolved
Hide resolved
gregestren
added
the
team-Configurability
platforms, toolchains, cquery, select(), config transitions
label
Mar 7, 2022
gregestren
reviewed
Mar 7, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of nitpicky and sanity checking comments on my side, but overall I love the direction of this!
src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkTransition.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkTransition.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkTransition.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkTransition.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkTransition.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkTransition.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkTransition.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkTransition.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkTransition.java
Show resolved
Hide resolved
Starlark transition logic temporarily explicitly sets all input build settings of a transition to their defaults. Since bazelbuild#13971, these values are cleared after the transition. However, since then they have also been subject to type validation, which is not only unnecessary, but also breaks in the special case of a string build setting with allow_multiple. With this commit, input-only build settings at their literal default values are removed from the post-transition BuildOptions without going through validation. This is made possible by a refactoring of `StarlarkTransition#validate` that extracts the validation logic into a separate function and also improves some variable names.
fmeum
force-pushed
the
14894-refactor-validate
branch
from
March 8, 2022 19:23
3ebca6e
to
37d39a2
Compare
gregestren
approved these changes
Mar 9, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid!
src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkTransition.java
Show resolved
Hide resolved
fmeum
added a commit
to fmeum/bazel
that referenced
this pull request
Mar 15, 2022
Starlark transition logic temporarily explicitly sets all input build settings of a transition to their defaults. Since bazelbuild#13971, these values are cleared after the transition. However, since then they have also been subject to type validation, which is not only unnecessary, but also breaks in the special case of a string build setting with allow_multiple. With this commit, input-only build settings are unconditionally stripped from the post-transition BuildOptions and do not undergo validation. This is made possible by a refactoring of `StarlarkTransition#validate` that extracts the validation logic into a separate function and also improves some variable names. Fixes bazelbuild#14894 Closes bazelbuild#14972. PiperOrigin-RevId: 434589143
Wyverald
pushed a commit
that referenced
this pull request
Mar 15, 2022
Starlark transition logic temporarily explicitly sets all input build settings of a transition to their defaults. Since #13971, these values are cleared after the transition. However, since then they have also been subject to type validation, which is not only unnecessary, but also breaks in the special case of a string build setting with allow_multiple. With this commit, input-only build settings are unconditionally stripped from the post-transition BuildOptions and do not undergo validation. This is made possible by a refactoring of `StarlarkTransition#validate` that extracts the validation logic into a separate function and also improves some variable names. Fixes #14894 Closes #14972. PiperOrigin-RevId: 434589143
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Starlark transition logic temporarily explicitly sets all input build
settings of a transition to their defaults. Since #13971, these values
are cleared after the transition. However, since then they have also
been subject to type validation, which is not only unnecessary, but
also breaks in the special case of a string build setting with
allow_multiple.
With this commit, input-only build settings are unconditionally
stripped from the post-transition BuildOptions and do not undergo
validation. This is made possible by a refactoring of
StarlarkTransition#validate
that extracts the validation logic into aseparate function and also improves some variable names.
Fixes #14894