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
java_package_configuration
is ignored when rules_java
is overridden
#19815
Comments
|
@hvadehra Thanks for clarifying.
Changing the order solved the problem.
If we just use default default_java_toolchain(
name = "error_prone_warnings_toolchain_java17",
configuration = dict(),
java_runtime = "@rules_java_builtin//toolchains:remotejdk_17",
package_configuration = [
":error_prone",
],
source_version = "17",
target_version = "17",
visibility = ["//visibility:public"],
) Reproducer: https://gerrit-review.googlesource.com/c/gerrit/+/387360 Before the upgrade of Bazel from 6.x to 7.x, we used: |
Do I understand correctly that referencing If you wish to use the version of |
Yeah, it works. But you are right, I was able to revert to |
Description of the bug:
Gerrit Code Review has custom
java_package_configuration
, witherror-prone
specific parameters:tools/BUILD:
All is fine, when
rules_java
version shipped with Bazel is used.However, if we are trying to override even the same
rules_java
version used on Bazel@HEAD 3.6.1,java package configuration seems to be ignored:
WORKSPACE:
Then all the custom
error-prone
options are ignored, and we are seeingerror-prone
errors reported:Even though the severity level for those bug patterns was demoted to warning, e.g.:
-Xep:BanJNDI:WARN
.What are we trying to achieve?
We try to use JDK 21 added recently, in
rules_java
.I've conducted a custom
rules_java
release and am trying to integrate it like this in gerrit:WORKSPACE:
While I am able to build some basic targets using JDK 21 and produce major java byte version 65:
$> bazeldev build --java_language_version=21 \ --java_runtime_version=remotejdk_21 \ --tool_java_language_version=21 \ --tool_java_runtime_version=remotejdk_21 \ java/com/google/gerrit/entities
It's failing to build other targets with overridden
rules_java
version, becauseerror-prone
parameters are ignored:bazeldev build java/com/google/gerrit/auth
.Which category does this issue belong to?
Java Rules
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Fetch this CL form Gerrit Review: [1], and run:
[1] https://gerrit-review.googlesource.com/c/gerrit/+/387837
Which operating system are you running Bazel on?
Linux
What is the output of
bazel info release
?Bazel@HEAD or 7.0.0-pre.20230926.1
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.bazelisk build src:bazel-bin-dev
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
It works as expected when
rules_java
shipped with Bazel is used.Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: