salesforce / salesforce/bazel-jdt-java-toolchain

Compile error with rules_jvm_external

Open
#28 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
12
Forks
8
PR merge metrics
No merged PRs in 30d

Description

I am trying this toolchain in our bazel 7.2.1 project. We use modules and rules_jvm_external. I fixed one small issue with windows, and then am seeing this problem:

Is there a way to resolve this? or a way to use JDT conditionally only for our own code?

Do you still recommend use of JDT in bazel7/modules world?

I can contribute fixes if I can get some guidance as to where the issue is.

D:\workdir\javaproject2>bazel build //... --verbose_failures
INFO: Analyzed 12 targets (0 packages loaded, 0 targets configured).
ERROR: D:/udu/b/xipfius7/external/rules_jvm_external~/private/tools/java/com/github/bazelbuild/rules_jvm_external/jar/BUILD:3:12: Building external/rules_jvm_external~/private/tools/java/com/github/bazelbuild/rules_jvm_external/jar/AddJarManifestEntry.jar (1 source file) [for tool] failed: (Exit 1): java.exe failed: error executing Javac command (from target @@rules_jvm_external~//private/tools/java/com/github/bazelbuild/rules_jvm_external/jar:AddJarManifestEntry)
  cd /d D:/udu/b/xipfius7/execroot/_main
  SET LC_CTYPE=en_US.UTF-8
    SET PATH=<redacted>
  external\rules_java~~toolchains~remotejdk21_win\bin\java.exe --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.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=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED -Dsun.io.useCanonCaches=false -XX:-CompactStrings -Xlog:disable -Xlog:all=warning:stderr:uptime,level,tags -XX:-MaxFDLimit -jar external/bazel_jdt_java_toolchain/compiler/export/JdtJavaBuilder_deploy.jar @bazel-out/x64_windows-opt-exec-ST-d57f47055a04/bin/external/rules_jvm_external~/private/tools/java/com/github/bazelbuild/rules_jvm_external/jar/AddJarManifestEntry.jar-0.params @bazel-out/x64_windows-opt-exec-ST-d57f47055a04/bin/external/rules_jvm_external~/private/tools/java/com/github/bazelbuild/rules_jvm_external/jar/AddJarManifestEntry.jar-1.params
# Configuration: db806cde30d1954eb42b8b71bb10bbf7e2f4f7575e90723f381588aac94e2bae
# Execution platform: @@platforms//host:host
----------
1. ERROR in D:\udu\b\xipfius7\execroot\_main\external\rules_jvm_external~\private\tools\java\com\github\bazelbuild\rules_jvm_external\jar\AddJarManifestEntry.java (at line 6)
        import com.github.bazelbuild.rules_jvm_external.ByteStreams;
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The import com.github.bazelbuild.rules_jvm_external.ByteStreams cannot be resolved
----------
2. ERROR in D:\udu\b\xipfius7\execroot\_main\external\rules_jvm_external~\private\tools\java\com\github\bazelbuild\rules_jvm_external\jar\AddJarManifestEntry.java (at line 7)
        import com.github.bazelbuild.rules_jvm_external.zip.StableZipEntry;
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The import com.github.bazelbuild.rules_jvm_external.zip cannot be resolved
----------
3. ERROR in D:\udu\b\xipfius7\execroot\_main\external\rules_jvm_external~\private\tools\java\com\github\bazelbuild\rules_jvm_external\jar\AddJarManifestEntry.java (at line 191)
        ZipEntry newManifestEntry = new StableZipEntry(JarFile.MANIFEST_NAME);
                                        ^^^^^^^^^^^^^^
StableZipEntry cannot be resolved to a type
----------
4. ERROR in D:\udu\b\xipfius7\execroot\_main\external\rules_jvm_external~\private\tools\java\com\github\bazelbuild\rules_jvm_external\jar\AddJarManifestEntry.java (at line 211)
        ByteStreams.copy(in, zos);
        ^^^^^^^^^^^
ByteStreams cannot be resolved
----------
4 problems (4 errors)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the failing Bazel command and the external rules_jvm_external target shown in the log, then inspect AddJarManifestEntry.java and the JdtJavaBuilder_deploy.jar invocation. Determine why ByteStreams and StableZipEntry are unavailable under the reported JDK and toolchain configuration; done means the target compiles successfully with the affected modules setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.