Skip to content

Commit

Permalink
Enable Starlark java_binary in bazel
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hvadehra authored and copybara-github committed Dec 19, 2022
1 parent fefc19f commit f15124c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/starlark/builtins_bzl/bazel/exports.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ load("@_builtins//:common/java/java_plugin.bzl", "java_plugin")
load("@_builtins//:common/java/java_import.bzl", "java_import")
load("@_builtins//:common/java/proto/java_proto_library.bzl", "java_proto_library")
load("@_builtins//:common/cc/cc_proto_library.bzl", "cc_proto_library")
load(":bazel/java/bazel_java_binary_wrapper.bzl", "java_binary")

exported_toplevels = {}
exported_rules = {
Expand All @@ -27,5 +28,6 @@ exported_rules = {
"+java_import": java_import,
"java_proto_library": java_proto_library,
"+cc_proto_library": cc_proto_library,
"+java_binary": java_binary,
}
exported_to_java = {}
2 changes: 1 addition & 1 deletion src/test/shell/integration/jvm_flags_escaping_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ function test_untokenizable_jvm_flag_when_escaping_is_enabled() {
# On Windows, Bazel will check the flag.
bazel build --verbose_failures "${pkg}:cannot_tokenize" \
2>"$TEST_log" && fail "expected failure" || true
expect_log "ERROR:.*in jvm_flags attribute of java_binary rule"
expect_log "Error in tokenize: unterminated quotation"
else
# On other platforms, Bazel will build the target but it fails to run.
bazel build --verbose_failures "${pkg}:cannot_tokenize" \
Expand Down

0 comments on commit f15124c

Please sign in to comment.