Skip to content
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

Overriding default java toolchain with source version 17 is failing in com.google.turbine.options.LanguageVersion: invalid -source version: 17 #14474

Closed
davido opened this issue Dec 25, 2021 · 4 comments

Comments

@davido
Copy link
Contributor

davido commented Dec 25, 2021

On Bazel@HEAD (46ed5d5) I'm trying to override default_java_toolchain to promote Error Prone bug patterns to ERROR severity:

default_java_toolchain(
    name = "error_prone_warnings_toolchain_java17",
    package_configuration = [
        ":error_prone",
    ],
    java_runtime = "@bazel_tools//tools/jdk:remotejdk_17",
    source_version = "17",
    target_version = "17",
    visibility = ["//visibility:public"],
)

# Error Prone errors enabled by default; see ../.bazelrc for how this is
# enabled. This warnings list is originally based on:
# https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl
# Additionally, items used internally in google is added. Such items have
# the same or higher verbosity level than in google.
# However, feel free to add any additional errors. Thus far they have all been pretty useful.
# All warnings are commented to avoid noise in the output.
# Newer versions of error-prone have XepDisableAllWarnings flag which could
# be used instead of commenting. Bazel should be updated to use a new version
# of error-prone.
java_package_configuration(
    name = "error_prone",
    javacopts = [
        "-XepDisableWarningsInGeneratedCode",
[...]

and register this custom toolchain in WORKSPACE:

register_toolchains("//tools:error_prone_warnings_toolchain_java17_definition")

and activate it like this in .bazelrc:

# Builds using remote_jdk17, executes using remote_jdk17 or local_jdk
build --java_language_version=17
build --java_runtime_version=17
build --tool_java_language_version=17
build --tool_java_runtime_version=17

Now, the build is failing:

  $ bazeldev build --verbose_failures java/com/google/gerrit/common:server

NFO: Invocation ID: 49cd923d-3a0b-429c-a910-7f038e35dbae
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=219
INFO: Reading rc options for 'build' from /home/davido/projects/gerrit/.bazelrc:
  'build' options: --workspace_status_command=python3 ./tools/workspace_status.py --repository_cache=~/.gerritcodereview/bazel-cache/repository --action_env=PATH --disk_cache=~/.gerritcodereview/bazel-cache/cas --incompatible_use_toolchain_resolution_for_java_rules --java_language_version=17 --java_runtime_version=17 --tool_java_language_version=17 --tool_java_runtime_version=17 --incompatible_strict_action_env --announce_rc
INFO: Reading rc options for 'build' from /home/davido/.bazelrc:
  'build' options: --experimental_generate_json_trace_profile --experimental_profile_cpu_usage
DEBUG: /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:59:14: 
Current running Bazel is not a release version and one was not defined explicitly in rbe_autoconfig target. Falling back to '4.0.0'
INFO: Analyzed target //java/com/google/gerrit/common:server (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/external/jgit/org.eclipse.jgit/BUILD:49:13: Compiling Java headers external/jgit/org.eclipse.jgit/libinsecure_cipher_factory-hjar.jar (1 source file) failed: (Exit 1): java failed: error executing command (from target @jgit//org.eclipse.jgit:insecure_cipher_factory) 
  (cd /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/sandbox/linux-sandbox/2231/execroot/gerrit && \
  exec env - \
    LC_CTYPE=en_US.UTF-8 \
    PATH=/home/davido/.yarn/bin:/home/davido/.config/yarn/global/node_modules/.bin:/home/davido/pgm/apache-maven-3.5.2/bin:/home/davido/bin:/home/davido/.yarn/bin:/home/davido/.config/yarn/global/node_modules/.bin:/home/davido/pgm/google-cloud-sdk/bin:/home/davido/pgm/apache-maven-3.5.2/bin:/home/davido/bin:/home/davido/bin:/usr/local/bin:/usr/bin:/bin \
  external/remotejdk17_linux/bin/java -XX:-CompactStrings '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.resources=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED' '--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED' '--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED' '--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED' '--add-opens=java.base/java.nio=ALL-UNNAMED' '--add-opens=java.base/java.lang=ALL-UNNAMED' '--patch-module=java.compiler=external/remote_java_tools/java_tools/java_compiler.jar' '--patch-module=jdk.compiler=external/remote_java_tools/java_tools/jdk_compiler.jar' -jar external/remote_java_tools/java_tools/turbine_direct_binary_deploy.jar --output bazel-out/k8-fastbuild/bin/external/jgit/org.eclipse.jgit/libinsecure_cipher_factory-hjar.jar --output_deps bazel-out/k8-fastbuild/bin/external/jgit/org.eclipse.jgit/libinsecure_cipher_factory-hjar.jdeps --bootclasspath bazel-out/k8-fastbuild/bin/external/bazel_tools/tools/jdk/platformclasspath.jar --sources external/jgit/org.eclipse.jgit/src/org/eclipse/jgit/transport/InsecureCipherFactory.java --javacopts -source 17 -target 17 '-XDskipDuplicateBridges=true' '-XDcompilePolicy=simple' -g -parameters '-XepOpt:ReturnValueIgnored:ObjectMethods=false' -Xep:InsecureCryptoUsage:OFF -- --target_label @@jgit//org.eclipse.jgit:insecure_cipher_factory --reduce_classpath_mode NONE)
# Configuration: 10b5231a30440c8ec3e7e32386ea16772552b77bf353b6e3677624ece23d387d
# Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
java.lang.IllegalArgumentException: invalid -source version: 17
	at com.google.turbine.options.LanguageVersion.sourceVersion(LanguageVersion.java:56)
	at com.google.turbine.main.Main.bind(Main.java:264)
	at com.google.turbine.main.Main.compile(Main.java:158)
	at com.google.turbine.main.Main.compile(Main.java:133)
	at com.google.turbine.main.Main.main(Main.java:89)
Target //java/com/google/gerrit/common:server failed to build
ERROR: /home/davido/projects/gerrit/java/com/google/gerrit/common/BUILD:15:13 Building java/com/google/gerrit/common/libserver.jar (18 source files) and running annotation processors (AutoAnnotationProcessor, AutoValueProcessor, AutoOneOfProcessor) failed: (Exit 1): java failed: error executing command (from target @jgit//org.eclipse.jgit:insecure_cipher_factory) 
  (cd /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/sandbox/linux-sandbox/2231/execroot/gerrit && \
  exec env - \
    LC_CTYPE=en_US.UTF-8 \
    PATH=/home/davido/.yarn/bin:/home/davido/.config/yarn/global/node_modules/.bin:/home/davido/pgm/apache-maven-3.5.2/bin:/home/davido/bin:/home/davido/.yarn/bin:/home/davido/.config/yarn/global/node_modules/.bin:/home/davido/pgm/google-cloud-sdk/bin:/home/davido/pgm/apache-maven-3.5.2/bin:/home/davido/bin:/home/davido/bin:/usr/local/bin:/usr/bin:/bin \
  external/remotejdk17_linux/bin/java -XX:-CompactStrings '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.resources=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED' '--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED' '--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED' '--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED' '--add-opens=java.base/java.nio=ALL-UNNAMED' '--add-opens=java.base/java.lang=ALL-UNNAMED' '--patch-module=java.compiler=external/remote_java_tools/java_tools/java_compiler.jar' '--patch-module=jdk.compiler=external/remote_java_tools/java_tools/jdk_compiler.jar' -jar external/remote_java_tools/java_tools/turbine_direct_binary_deploy.jar --output bazel-out/k8-fastbuild/bin/external/jgit/org.eclipse.jgit/libinsecure_cipher_factory-hjar.jar --output_deps bazel-out/k8-fastbuild/bin/external/jgit/org.eclipse.jgit/libinsecure_cipher_factory-hjar.jdeps --bootclasspath bazel-out/k8-fastbuild/bin/external/bazel_tools/tools/jdk/platformclasspath.jar --sources external/jgit/org.eclipse.jgit/src/org/eclipse/jgit/transport/InsecureCipherFactory.java --javacopts -source 17 -target 17 '-XDskipDuplicateBridges=true' '-XDcompilePolicy=simple' -g -parameters '-XepOpt:ReturnValueIgnored:ObjectMethods=false' -Xep:InsecureCryptoUsage:OFF -- --target_label @@jgit//org.eclipse.jgit:insecure_cipher_factory --reduce_classpath_mode NONE)
# Configuration: 10b5231a30440c8ec3e7e32386ea16772552b77bf353b6e3677624ece23d387d
# Execution platform: @local_config_platform//:host

If I downgrade the source version to 11 in custom toolchain:

default_java_toolchain(
    name = "error_prone_warnings_toolchain_java17",
    package_configuration = [
        ":error_prone",
    ],
    java_runtime = "@bazel_tools//tools/jdk:remotejdk_17",
    source_version = "11",
    target_version = "17",
    visibility = ["//visibility:public"],
)

it works as expected:

  $ bazeldev build --verbose_failures java/com/google/gerrit/common:server
INFO: Invocation ID: 20637940-a455-4fdf-b21d-49649ad0b6d0
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=219
INFO: Reading rc options for 'build' from /home/davido/projects/gerrit/.bazelrc:
  'build' options: --workspace_status_command=python3 ./tools/workspace_status.py --repository_cache=~/.gerritcodereview/bazel-cache/repository --action_env=PATH --disk_cache=~/.gerritcodereview/bazel-cache/cas --incompatible_use_toolchain_resolution_for_java_rules --java_language_version=17 --java_runtime_version=17 --tool_java_language_version=17 --tool_java_runtime_version=17 --incompatible_strict_action_env --announce_rc
INFO: Reading rc options for 'build' from /home/davido/.bazelrc:
  'build' options: --experimental_generate_json_trace_profile --experimental_profile_cpu_usage
DEBUG: /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:59:14: 
Current running Bazel is not a release version and one was not defined explicitly in rbe_autoconfig target. Falling back to '4.0.0'
INFO: Analyzed target //java/com/google/gerrit/common:server (1 packages loaded, 81 targets configured).
INFO: Found 1 target...
INFO: From Building external/com_google_protobuf/java/core/liblite.jar (86 source files):
external/com_google_protobuf/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java:293: warning: [removal] AccessController in java.security has been deprecated and marked for removal
          AccessController.doPrivileged(
          ^
Target //java/com/google/gerrit/common:server up-to-date:
  bazel-bin/java/com/google/gerrit/common/libserver.jar
INFO: Elapsed time: 0.598s, Critical Path: 0.35s
INFO: 6 processes: 5 disk cache hit, 1 internal.
INFO: Build completed successfully, 6 total actions

and major byte version 61 is produced:

  $ javap -v -cp bazel-bin/java/com/google/gerrit/common/libserver.jar com.google.gerrit.common.data.PatchScript | grep major
  major version: 61

However, custom Error Prone severity level doesn't seem to be respected, in the example below the build is failed with ReturnValueIgnored error prone bug pattern violation:

  $ bazeldev build --config java17 java/com/google/gerrit/server/restapi
  INFO: Invocation ID: 96a7115b-0f24-46b3-bd0f-747235096a48
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=219
INFO: Reading rc options for 'build' from /home/davido/projects/gerrit/.bazelrc:
  'build' options: --workspace_status_command=python3 ./tools/workspace_status.py --repository_cache=~/.gerritcodereview/bazel-cache/repository --action_env=PATH --disk_cache=~/.gerritcodereview/bazel-cache/cas --java_language_version=11 --java_runtime_version=11 --tool_java_language_version=11 --tool_java_runtime_version=11 --incompatible_strict_action_env --announce_rc
INFO: Reading rc options for 'build' from /home/davido/.bazelrc:
  'build' options: --experimental_generate_json_trace_profile --experimental_profile_cpu_usage
INFO: Found applicable config definition build:java17 in file /home/davido/projects/gerrit/.bazelrc: --java_language_version=17 --java_runtime_version=17 --tool_java_language_version=17 --tool_java_runtime_version=17
DEBUG: /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:59:14: 
Current running Bazel is not a release version and one was not defined explicitly in rbe_autoconfig target. Falling back to '4.0.0'
INFO: Analyzed target //java/com/google/gerrit/server/restapi:restapi (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/davido/projects/gerrit/java/com/google/gerrit/server/restapi/BUILD:7:13: Building java/com/google/gerrit/server/restapi/librestapi.jar (302 source files) and running annotation processors (AutoAnnotationProcessor, AutoValueProcessor, AutoOneOfProcessor) failed: (Exit 1): java failed: error executing command (from target //java/com/google/gerrit/server/restapi:restapi) external/remotejdk17_linux/bin/java '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED' ... (remaining 15 arguments skipped)
java/com/google/gerrit/server/restapi/change/TestSubmitRule.java:79: error: [ReturnValueIgnored] Return value of 'orElseThrow' must be used
        .orElseThrow(() -> new BadRequestException("project not found " + rsrc.getProject()));
                    ^
    (see https://errorprone.info/bugpattern/ReturnValueIgnored)
  Did you mean to remove this line?
Target //java/com/google/gerrit/server/restapi:restapi failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 6.528s, Critical Path: 6.25s
INFO: 3 processes: 3 internal.
FAILED: Build did NOT complete successfully

Even though it was demoted to WARN level in custom java toolchain definition (and it works as expected for JDK 11):

java_package_configuration(
    name = "error_prone",
    javacopts = [
    [...]
    "-Xep:ReturnValueIgnored:WARN",
    [...]
  ],
)

Reproduced is here: [1]

//CC @comius @cushon

[1] https://gerrit-review.googlesource.com/c/gerrit/+/291864

@cushon
Copy link
Contributor

cushon commented Dec 25, 2021

external/remotejdk17_linux/bin/java ... --patch-module=java.compiler=external/remote_java_tools/java_tools/java_compiler.jar ... -jar external/remote_java_tools/java_tools/turbine_direct_binary_deploy.jar ... --javacopts -source 17 -target 17 -- ...
...
java.lang.IllegalArgumentException: invalid -source version: 17
	at com.google.turbine.options.LanguageVersion.sourceVersion(LanguageVersion.java:56)
	at com.google.turbine.main.Main.bind(Main.java:264)
	at com.google.turbine.main.Main.compile(Main.java:158)
	at com.google.turbine.main.Main.compile(Main.java:133)
	at com.google.turbine.main.Main.main(Main.java:89)

That error means that turbine can't load javax.lang.model.SourceVersion.RELEASE_17. It should be available in JDK 17, the issue here is that --patch-module=java.compiler= is overriding the version of javax.lang.model.SourceVersion in JDK 17 to use an older version.

Those flags are not necessary anymore, the custom javac build hasn't been necessary since JDK 13 (#11262 (comment)).

I can build your repro with the following change to omit the --patch-module= flags:

diff --git a/tools/BUILD b/tools/BUILD
index aac288cd66..6630f95ef8 100644
--- a/tools/BUILD
+++ b/tools/BUILD
@@ -1,6 +1,6 @@
 load(
     "@bazel_tools//tools/jdk:default_java_toolchain.bzl",
-    "JDK9_JVM_OPTS",
+    "BASE_JDK9_JVM_OPTS",
     "default_java_toolchain",
 )
 load("@rules_java//java:defs.bzl", "java_package_configuration")
@@ -9,6 +9,10 @@ exports_files(["nongoogle.bzl"])
 
 default_java_toolchain(
     name = "error_prone_warnings_toolchain_java11",
+    jvm_opts = BASE_JDK9_JVM_OPTS,
+    misc = [
+        "-Xep:ReturnValueIgnored:WARN",
+    ],
     package_configuration = [
         ":error_prone",
     ],
@@ -22,10 +26,14 @@ default_java_toolchain(
 default_java_toolchain(
     name = "error_prone_warnings_toolchain_java17",
     java_runtime = "@bazel_tools//tools/jdk:remotejdk_17",
+    jvm_opts = BASE_JDK9_JVM_OPTS,
+    misc = [
+        "-Xep:ReturnValueIgnored:WARN",
+    ],
     package_configuration = [
         ":error_prone",
     ],
-    source_version = "11",
+    source_version = "17",
     target_version = "17",
     visibility = ["//visibility:public"],
 )

(I'm not sure what's up with ReturnValueIgnored yet.)

@cushon
Copy link
Contributor

cushon commented Dec 25, 2021

I can't reproduce the ReturnValueIgnored issue, the only error I'm seeing is

external/jgit/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateStore.java:222: error: [ReturnValueIgnored] Return value of 'hasNext' must be used
				hasNext();
				       ^

which I think isn't covered by the java_package_configuration because it's in a different workspace.

@cushon
Copy link
Contributor

cushon commented Dec 26, 2021

Also the reason the built-in Java 17 toolchain works correctly is that it sets configuration = dict(), which disables the --patch-module= stuff:

configuration = dict(),

Including that in the custom toolchain definition in gerrit would also work, as an alternative to jvm_opts = BASE_JDK9_JVM_OPTS,.

@davido
Copy link
Contributor Author

davido commented Dec 26, 2021

Thanks for the fast answer!

It works now with suggested workaround, with addition of configuration = dict() to default_java_toolchain override.

To demonstrate it, I added new record to the source base:

package com.google.gerrit.common;

@SuppressWarnings("UnusedVariable")
public record AddressRecord(String street, String postCode, String town, String country) {}

And while the build is failing with default (Java 11) toolchain (as expected):

  [...]
  ERROR: /home/davido/projects/gerrit/java/com/google/gerrit/common/BUILD:15:13: Building java/com/google/gerrit/common/libserver.jar (19 source files) and running annotation processors (AutoAnnotationProcessor, AutoValueProcessor, AutoOneOfProcessor) failed: (Exit 1): java failed: error executing command external/remotejdk11_linux/bin/java -XX:-CompactStrings '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED' ... (remaining 17 arguments skipped)
java/com/google/gerrit/common/AddressRecord.java:4: error: class, interface, or enum expected
public record AddressRecord(String street, String postCode, String town, String country) {
       ^
Target //java/com/google/gerrit/common:server failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.356s, Critical Path: 0.92s
INFO: 4 processes: 4 internal.
FAILED: Build did NOT complete successfully

It just works with --config java17:

  $ bazelisk build --config java17 java/com/google/gerrit/common:server
INFO: Invocation ID: 0c4849d1-b5ca-4d8a-9349-c45c62b36ee9
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=219
INFO: Reading rc options for 'build' from /home/davido/projects/gerrit/.bazelrc:
  'build' options: --workspace_status_command=python3 ./tools/workspace_status.py --repository_cache=~/.gerritcodereview/bazel-cache/repository --action_env=PATH --disk_cache=~/.gerritcodereview/bazel-cache/cas --java_language_version=11 --java_runtime_version=11 --tool_java_language_version=11 --tool_java_runtime_version=11 --incompatible_strict_action_env --announce_rc
INFO: Reading rc options for 'build' from /home/davido/.bazelrc:
  'build' options: --experimental_generate_json_trace_profile --experimental_profile_cpu_usage
INFO: Found applicable config definition build:java17 in file /home/davido/projects/gerrit/.bazelrc: --java_language_version=17 --java_runtime_version=17 --tool_java_language_version=17 --tool_java_runtime_version=17
DEBUG: /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:106:14: rbe_jdk11 not using checked in configs as bazel rc version was used 
INFO: Analyzed target //java/com/google/gerrit/common:server (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //java/com/google/gerrit/common:server up-to-date:
  bazel-bin/java/com/google/gerrit/common/libserver.jar
INFO: Elapsed time: 1.129s, Critical Path: 0.85s
INFO: 2 processes: 1 internal, 1 worker.
INFO: Build completed successfully, 2 total actions

And the class file is there:

  $ javap -v -cp bazel-bin/java/com/google/gerrit/common/libserver.jar com.google.gerrit.common.AddressRecord | grep major
  major version: 61

Also sorry for the confusion with ReturnValueIgnored, it seems something messed up here. It works as you've confirmed.

@davido davido closed this as completed Dec 26, 2021
kjcartledge added a commit to kjcartledge/bazel that referenced this issue Mar 9, 2022
…rly.

There are really two changes here:
  1. Fix the reference to `//tools/jdk:remote_jdk11` to have `@bazel_tools`. Without this, a direct copy/paste will fail to even build.
  2. Change from `JDK9_JVM_OPTS` to `BASE_JDK9_JVM_OPTS` as the former includes `--patch-module=java.compiler=` which overrides `source_version` and can also cause build failures. See bazelbuild#14474 (comment) for an example.
bazel-io pushed a commit that referenced this issue Mar 10, 2022
…rrectly

There are really two changes here:

1. Fix the reference to `//tools/jdk:remote_jdk11` to have `@bazel_tools`. Without this, a direct copy/paste will fail to even build.
2. Change from `JDK9_JVM_OPTS` to `BASE_JDK9_JVM_OPTS` as the former includes `--patch-module=java.compiler=` which overrides `source_version` and can also cause build failures. See [this issue](#14474 (comment)) for an example.

Closes #15009.

PiperOrigin-RevId: 433750777
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants