[build] reduce downloaded artifacts#17598
Open
titusfortner wants to merge 1 commit into
Open
Conversation
Contributor
Review Summary by QodoReduce Bazel cache size by optimizing Java toolchain and browser dependencies
WalkthroughsDescription• Upgrade Java toolchain from JDK 21 to 25 across build/test/tool • Make pinned-grid browser fetches conditional on --pin_browsers flag • Remove deprecated Security Manager flag from JUnit5 tests • Clean up unused JDK 17 repository entries from MODULE.bazel Diagramflowchart LR
A["JDK 21 to 25<br/>Upgrade"] --> B["Single JDK<br/>in cache"]
C["Bare OS constraints<br/>in pinned-grid"] --> D["OS + pin_browsers<br/>constraints"]
D --> E["Conditional browser<br/>downloads"]
F["Remove JDK 17<br/>repos"] --> B
G["Remove deprecated<br/>Security Manager"] --> H["JDK 24+<br/>compatible"]
B --> I["Reduced cache<br/>size"]
E --> I
File Changes1. java/private/junit5_test.bzl
|
Contributor
This file contains hidden or 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
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.
Trimming our Bazel repository cache to get it under the GitHub 10 GB limit.
This PR decreases Cache sizes
💥 What does this PR do?
pinned-gridjava_binarynow respects--pin_browsers(java/src/org/openqa/selenium/grid/BUILD.bazel). Itsselect()keyed on bare//common:linux///common:macos, so any mac or linux analysis pass — including--pin_browsers=false— unconditionally fetched@mac_chrome,@mac_firefox, drivers, etc. Switching the keys to//common:use_pinned_linux_chrome/use_pinned_macos_chrome(which require both the OS constraint andpin_browsers=true) makes the browser fetches actually conditional.Bumped the build/test/tool JDK from 21 to 25 (.bazelrc).
rules_java9.6.1's per-language-versiondefault_java_toolchainhardcodesjava_runtime = :remotejdk_25so even with--java_runtime_version=remotejdk_21, javac runs on JDK 25. That means we download both JDK 21 (for test/binary runtime) and JDK 25 (for compilation) on every fresh cache. Going to JDK 25 across the board (--java_language_version=25,--java_runtime_version=remotejdk_25, and thetool_variants) leaves only JDK 25 in cache. Released artifacts stay at Java 11 via the unchanged--javacopt="--release 11", and test artifacts stay at Java 17 based onTOOLS_JAVA_VERSION(we can increase this later if we want).🔧 Implementation Notes
-Djava.security.manager=allowfromjunit5_test** (java/private/junit5_test.bzl) since Security Manager was removed in JDK 24🤖 AI assistance
💡 Additional Considerations
🔄 Types of changes