-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
javacopts order differs from java_library #1550
Comments
@patrick-premont Did you end up finding a resolution? I believe the issue is here: https://sourcegraph.com/github.com/bazelbuild/rules_scala/-/blob/scala/private/rule_impls.bzl?L150 |
We fixed by building the io_rules_scala from source and patching like this:
|
I created a fix #1613 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The order of javacopts parameters passed to javac differs from the order seen in java_library.
This can result in different options taking precedence within the same toolchain based on whether it is used from scala_library or java_library.
In the example below
--release
and-source/-target
are being reordered leading to a java_library with Java 8 classes and a scala_library with Java 21 classes.BUILD.bazel
WORKSPACE.bazel
Running
Then running
we can see that
custom_toolchain
is selected for bothjava_library
andscala_library
.And the class major versions in each jar are those of Java 21 (65) and Java 8(52):
Then to see the contents of the
params
files we can add an optionbadoption
tocustom_package_config
.For java we can run
and we get this order:
For scala we run
and get
We can see that
--release 8
occurs before-source 21 -target 21
in the scala library only.The text was updated successfully, but these errors were encountered: