Skip to content

[Build] Add java_binary all_tests_bin as deploy-jar source for Java tests#61668

Merged
aslonnie merged 1 commit intomasterfrom
andrew/revup/master/java-all-tests-bin-deploy-jar
Mar 13, 2026
Merged

[Build] Add java_binary all_tests_bin as deploy-jar source for Java tests#61668
aslonnie merged 1 commit intomasterfrom
andrew/revup/master/java-all-tests-bin-deploy-jar

Conversation

@andrew-anyscale
Copy link
Contributor

@andrew-anyscale andrew-anyscale commented Mar 11, 2026

java_test targets do not produce a _deploy.jar in Bazel 7+. Add a companion
java_binary (all_tests_bin) that produces all_tests_bin_deploy.jar in both
Bazel 6 and Bazel 7, and update all references accordingly.

The java_binary includes //cpp:counter.so and //cpp:plus.so as resources so
that CrossLanguageInvocationTest.getResourceAsStream("/cpp/counter.so") finds
them in the deploy jar classpath.

Topic: java-all-tests-bin-deploy-jar
Relative: macos-raylet-dynamic-lookup
Signed-off-by: andrew andrew@anyscale.com

@andrew-anyscale
Copy link
Contributor Author

andrew-anyscale commented Mar 11, 2026

Reviews in this chain:
#61668 [Build] Add java_binary all_tests_bin as deploy-jar source for Java tests
 └#61669 [Build] Replace rules_boost lzma patches with a custom org_lzma_lzma build file
  └#61694 [Build] Patch protobuf for Bazel 7 exec_tools removal
   └#61695 [Build] Upgrade rules_apple/apple_support and set macOS toolchain flags for Bazel 7
    └#61601 [Build] Upgrade Bazel from 6.5.0 to 7.5.0
     └#61725 [Build] Upgrade protobuf 28.2, absl 20240722.0, grpc 1.68.2, boringssl

@andrew-anyscale
Copy link
Contributor Author

andrew-anyscale commented Mar 11, 2026

# head base diff date summary
0 d63555fd 396daf40 diff Mar 11 16:07 PM 2 files changed, 18 insertions(+), 5 deletions(-)
1 636fcd7b 9f0e1ca3 rebase Mar 12 11:49 AM 0 files changed
2 076937ea 9f0e1ca3 diff Mar 12 12:31 PM 0 files changed
3 df80fe60 09cacbbd diff Mar 12 20:31 PM 0 files changed
4 23649dd4 6d34c30f rebase Mar 13 11:13 AM 0 files changed

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses an issue with Bazel 7+ where java_test targets no longer produce a _deploy.jar file. The solution is to introduce a companion java_binary target, all_tests_bin, which generates the required all_tests_bin_deploy.jar. All references have been updated accordingly. The changes are correct and address the problem described. I've added one comment regarding code duplication between the new java_binary and the existing java_test target, suggesting a refactoring to improve maintainability.

@andrew-anyscale andrew-anyscale added the go add ONLY when ready to merge, run all tests label Mar 11, 2026
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/java-all-tests-bin-deploy-jar branch from d63555f to 636fcd7 Compare March 12, 2026 18:49
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/macos-raylet-dynamic-lookup branch from 396daf4 to 9f0e1ca Compare March 12, 2026 18:49
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/java-all-tests-bin-deploy-jar branch from 636fcd7 to 076937e Compare March 12, 2026 19:31
@andrew-anyscale andrew-anyscale marked this pull request as ready for review March 12, 2026 19:31
@ray-gardener ray-gardener bot added the core Issues that should be addressed in Ray Core label Mar 13, 2026
Base automatically changed from andrew/revup/master/macos-raylet-dynamic-lookup to master March 13, 2026 03:17
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/java-all-tests-bin-deploy-jar branch from 076937e to df80fe6 Compare March 13, 2026 03:31
…ests

java_test targets do not produce a _deploy.jar in Bazel 7+. Add a companion
java_binary (all_tests_bin) that produces all_tests_bin_deploy.jar in both
Bazel 6 and Bazel 7, and update all references accordingly.

The java_binary includes //cpp:counter.so and //cpp:plus.so as resources so
that CrossLanguageInvocationTest.getResourceAsStream("/cpp/counter.so") finds
them in the deploy jar classpath.

Topic: java-all-tests-bin-deploy-jar
Relative: macos-raylet-dynamic-lookup
Signed-off-by: andrew <andrew@anyscale.com>
@aslonnie aslonnie merged commit 4447e6a into master Mar 13, 2026
5 of 6 checks passed
@aslonnie aslonnie deleted the andrew/revup/master/java-all-tests-bin-deploy-jar branch March 13, 2026 21:51
@ayushk7102 ayushk7102 mentioned this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants