You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed a very odd thing where the javacopts are duplicated if any javacopts are provided for a scala_library. This only affects if there are Java files in the target
Looking at the code, I can see that the default_javac_opts are being provided to the compile method (
I can confirm this by looking at the params file (bazel-out/k8-fastbuild/bin/liba_java.jar-0.params)
) created for each JAR and I notice that the default javacopts are duplicated.
How I am very stumped, is that given the code I linked, I would expect the duplicate javacopts to always be duplicated, yet if the list is empty, it's only present once.
I suspect this has something to do with depsets and strings but I'm not sure quite yet. 🤷
I've fixed it locally by removing the default inclusion. I think that's a worthwhile fix but I would sure love to understand what's causing this. java_library doesn't suffer from the same symptom but it's calling into the same code in rules_java.
Why is this all a problem?
By duplicating the default javacopts, we are having trouble overwriting toolchain values.
I think there is some similarity to #1550 but the duplication seems to be new/different.
The text was updated successfully, but these errors were encountered:
I've noticed a very odd thing where the javacopts are duplicated if any
javacopts
are provided for ascala_library
.This only affects if there are Java files in the target
Looking at the code, I can see that the
default_javac_opts
are being provided to the compile method (rules_scala/scala/private/rule_impls.bzl
Line 160 in a8ae50e
I can confirm this by looking at the params file (bazel-out/k8-fastbuild/bin/liba_java.jar-0.params)
) created for each JAR and I notice that the default javacopts are duplicated.
example
I created a
scala_library
You can see the duplicate here.
If I remove the
javacopts
from thescala_library
we get (notice no duplicate)How I am very stumped, is that given the code I linked, I would expect the duplicate javacopts to always be duplicated, yet if the list is empty, it's only present once.
I've fixed it locally by removing the default inclusion. I think that's a worthwhile fix but I would sure love to understand what's causing this.
java_library
doesn't suffer from the same symptom but it's calling into the same code inrules_java
.Why is this all a problem?
By duplicating the default javacopts, we are having trouble overwriting toolchain values.
I think there is some similarity to #1550 but the duplication seems to be new/different.
The text was updated successfully, but these errors were encountered: