-
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
java_binary
wrapper should forward restricted_to
#20600
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
Otherwise, the synthetic deploy jar target won't be buildable if the `java_binary` has `restricted_to` set to a non-default value.
hvadehra
approved these changes
Dec 19, 2023
@bazel-io flag |
@bazel-io fork 7.0.1 |
bazel-io
pushed a commit
to bazel-io/bazel
that referenced
this pull request
Dec 19, 2023
Otherwise, the synthetic deploy jar target won't be buildable if the `java_binary` has `restricted_to` set to a non-default value. For example, consider the following top-level `BUILD` file. ``` environment_group( name = "foo-env", defaults = [ "foo-default", ], environments = [ "foo-default", "foo-custom", ], ) environment( name = "foo-default", ) environment( name = "foo-custom", ) java_binary( name = "foo", create_executable = False, restricted_to = ["foo-custom"], ) ``` With Bazel 7, one gets an error when building the synthetic `foo_deployjars_internal_rule`. ``` > bazel build //:foo_deployjars_internal_rule ERROR: /Users/tgeng/tmp/java_playground/BUILD:20:12: in deploy_jars_nonexec rule //:foo_deployjars_internal_rule: dependency //:foo doesn't support expected environment: //:foo-default ERROR: /Users/tgeng/tmp/java_playground/BUILD:20:12: in deploy_jars_nonexec rule //:foo_deployjars_internal_rule: the current command line flags disqualify all supported environments because of incompatible select() paths: environment: //:foo-default removed by: //:foo_deployjars_internal_rule (/Users/tgeng/tmp/java_playground/BUILD:20:12) because of a select() that chooses dep: //:foo which lacks: //:foo-default To see why, run: blaze build --target_environment=//:foo-default //:foo ERROR: /Users/tgeng/tmp/java_playground/BUILD:20:12: Analysis of target '//:foo_deployjars_internal_rule' failed ERROR: Analysis of target '//:foo_deployjars_internal_rule' failed; build aborted INFO: Elapsed time: 0.070s, Critical Path: 0.00s INFO: 1 process: 1 internal. ERROR: Build did NOT complete successfully ``` Closes bazelbuild#20600. PiperOrigin-RevId: 592249456 Change-Id: Ifb98c6afff7e49ca25f5b3d570f081e578e85cdb
iancha1992
pushed a commit
that referenced
this pull request
Dec 19, 2023
Otherwise, the synthetic deploy jar target won't be buildable if the `java_binary` has `restricted_to` set to a non-default value. For example, consider the following top-level `BUILD` file. ``` environment_group( name = "foo-env", defaults = [ "foo-default", ], environments = [ "foo-default", "foo-custom", ], ) environment( name = "foo-default", ) environment( name = "foo-custom", ) java_binary( name = "foo", create_executable = False, restricted_to = ["foo-custom"], ) ``` With Bazel 7, one gets an error when building the synthetic `foo_deployjars_internal_rule`. ``` > bazel build //:foo_deployjars_internal_rule ERROR: /Users/tgeng/tmp/java_playground/BUILD:20:12: in deploy_jars_nonexec rule //:foo_deployjars_internal_rule: dependency //:foo doesn't support expected environment: //:foo-default ERROR: /Users/tgeng/tmp/java_playground/BUILD:20:12: in deploy_jars_nonexec rule //:foo_deployjars_internal_rule: the current command line flags disqualify all supported environments because of incompatible select() paths: environment: //:foo-default removed by: //:foo_deployjars_internal_rule (/Users/tgeng/tmp/java_playground/BUILD:20:12) because of a select() that chooses dep: //:foo which lacks: //:foo-default To see why, run: blaze build --target_environment=//:foo-default //:foo ERROR: /Users/tgeng/tmp/java_playground/BUILD:20:12: Analysis of target '//:foo_deployjars_internal_rule' failed ERROR: Analysis of target '//:foo_deployjars_internal_rule' failed; build aborted INFO: Elapsed time: 0.070s, Critical Path: 0.00s INFO: 1 process: 1 internal. ERROR: Build did NOT complete successfully ``` Closes #20600. Commit 04c1577 PiperOrigin-RevId: 592249456 Change-Id: Ifb98c6afff7e49ca25f5b3d570f081e578e85cdb Co-authored-by: Tianyu Geng <[email protected]>
@bazel-io fork 7.1.0 |
The changes in this PR have been included in Bazel 7.0.1 RC2. Please test out the release candidate and report any issues as soon as possible. If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=last_rc. |
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.
Otherwise, the synthetic deploy jar target won't be buildable if the
java_binary
hasrestricted_to
set to a non-default value. For example, consider the following top-levelBUILD
file.With Bazel 7, one gets an error when building the synthetic
foo_deployjars_internal_rule
.