Skip to content

Commit 52fa7fd

Browse files
committed
Enable Starlark java_binary in bazel
RELNOTES[inc]: `java_binary` is now implemented in Starlark. The only visible change is that `java_binary` is now a macro, with the `_deploy.jar` target(s) created by a separate rule. This affects the results of `blaze query` and has a (small) memory regression for builds with very many `java_binary` targets. Downstream tests: An earlier build had one windows launcher related failure: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2786 which has now been fixed: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2791 (but other unrelated changes in the meantime have broken many more projects) PiperOrigin-RevId: 496393229 Change-Id: I64eb93f6fd1f4259eece29191828d81d8fe42879
1 parent 3125f64 commit 52fa7fd

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main/starlark/builtins_bzl/bazel/exports.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ load("@_builtins//:common/java/java_plugin.bzl", "java_plugin")
1919
load("@_builtins//:common/java/java_import.bzl", "java_import")
2020
load("@_builtins//:common/java/proto/java_proto_library.bzl", "java_proto_library")
2121
load("@_builtins//:common/cc/cc_proto_library.bzl", "cc_proto_library")
22+
load(":bazel/java/bazel_java_binary_wrapper.bzl", "java_binary")
2223

2324
exported_toplevels = {}
2425
exported_rules = {
@@ -27,5 +28,6 @@ exported_rules = {
2728
"+java_import": java_import,
2829
"java_proto_library": java_proto_library,
2930
"+cc_proto_library": cc_proto_library,
31+
"+java_binary": java_binary,
3032
}
3133
exported_to_java = {}

src/test/shell/integration/jvm_flags_escaping_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ function test_untokenizable_jvm_flag_when_escaping_is_enabled() {
279279
# On Windows, Bazel will check the flag.
280280
bazel build --verbose_failures "${pkg}:cannot_tokenize" \
281281
2>"$TEST_log" && fail "expected failure" || true
282-
expect_log "ERROR:.*in jvm_flags attribute of java_binary rule"
282+
expect_log "Error in tokenize: unterminated quotation"
283283
else
284284
# On other platforms, Bazel will build the target but it fails to run.
285285
bazel build --verbose_failures "${pkg}:cannot_tokenize" \

0 commit comments

Comments
 (0)