Select Scala toolchain by version and add JVM flags to the toolchain - #113
Merged
Merged
Conversation
jjudd
force-pushed
the
jjudd-toolchain-changes
branch
from
June 12, 2026 19:00
d2087da to
98c2bdd
Compare
jadenPete
reviewed
Jun 16, 2026
jadenPete
approved these changes
Jul 24, 2026
Currently there is no good way to provide JVM flags to our Scala toolchain. This change adds the ability to specify JVM flags used when invoking the Scala toolchain. This is particularly relevant for JDK 25 where lots of warnings about Unsafe appear without specifying certain JVM flags. Currently the Scala toolchain is selected by toolchain name. This causes challenges because the Scala toolchain from the consuming workspace may not match the toolchain name of another ruleset. This causes the Scala toolchain from that other ruleset to be used, but the JDK toolchain from the consuming workspace is used. This can cause problems where a JDK 25 toolchain is used with a Scala toolchain that doesn't provide JVM flags needed to silence warnings that appear when calling the Scala compiler. Changing the Scala toolchain to be selected by version causes the consuming workspace's Scala toolchains to be used, just like the JDK toolchain and other Bazel toolchains.
jjudd
force-pushed
the
jjudd-toolchain-changes
branch
from
July 29, 2026 19:59
98c2bdd to
db82da0
Compare
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.
Currently there is no good way to provide JVM flags to our Scala toolchain. This change adds the ability to specify JVM flags used when invoking the Scala toolchain. This is particularly relevant for JDK 25 where lots of warnings about Unsafe appear without specifying certain JVM flags.
Currently the Scala toolchain is selected by toolchain name. This causes challenges because the Scala toolchain from the consuming workspace may not match the toolchain name of another ruleset. This causes the Scala toolchain from that other ruleset to be used, but the JDK toolchain from the consuming workspace is used.
This can cause problems where a JDK 25 toolchain is used with a Scala toolchain that doesn't provide JVM flags needed to silence warnings that appear when calling the Scala compiler.
Changing the Scala toolchain to be selected by version causes the consuming workspace's Scala toolchains to be used, just like the JDK toolchain and other Bazel toolchains.