-
-
Notifications
You must be signed in to change notification settings - Fork 286
javacopts order differs from java_library #1550
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@patrick-premont Did you end up finding a resolution? I believe the issue is here: |
We fixed by building the io_rules_scala from source and patching like this:
|
I created a fix #1613 |
This was referenced Jan 24, 2025
fzakaria
referenced
this issue
in confluentinc/rules_scala
Jan 24, 2025
cherry-pick: bazelbuild#1550 Co-authored-by: thomasbao12 <thomasbao12@gmail.com>
# for free
to join this conversation on GitHub.
Already have an account?
# 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: