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

Java runfiles library no longer compiles with Java 8 #16849

Closed
fmeum opened this issue Nov 25, 2022 · 3 comments
Closed

Java runfiles library no longer compiles with Java 8 #16849

fmeum opened this issue Nov 25, 2022 · 3 comments
Labels

Comments

@fmeum
Copy link
Collaborator

fmeum commented Nov 25, 2022

Description of the bug:

In Bazel 6.0.0rc2, the Java runfiles library no longer builds with Java 8:

ERROR: /home/runner/.cache/bazel/_bazel_runner/6bc610921f14939de4c55cf170d55a62/external/bazel_tools/tools/java/runfiles/BUILD:1:13: Building external/bazel_tools/tools/java/runfiles/librunfiles.jar (2 source files) failed: (Exit 1): java failed: error executing command (from target @bazel_tools//tools/java/runfiles:runfiles) 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 16 arguments skipped)
external/bazel_tools/tools/java/runfiles/Runfiles.java:413: error: no suitable constructor found for FileReader(String,Charset)
    try (BufferedReader r = new BufferedReader(new FileReader(path, StandardCharsets.UTF_8))) {
                                               ^
    constructor FileReader.FileReader(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor FileReader.FileReader(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor FileReader.FileReader(FileDescriptor) is not applicable
      (actual and formal argument lists differ in length)

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Point JAVA_HOME to a Java 8 JDK
  2. In any Bazel project, run bazel build @bazel_tools//tools/java/runfiles --java_runtime_version=local_jdk_8.

Which operating system are you running Bazel on?

Any

What is the output of bazel info release?

6.0.0rc2

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@fmeum
Copy link
Collaborator Author

fmeum commented Nov 25, 2022

@bazel-io flag

@bazel-io bazel-io added the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Nov 25, 2022
@fmeum
Copy link
Collaborator Author

fmeum commented Nov 25, 2022

Submitted a fix in #16851

@meteorcloudy
Copy link
Member

@bazel-io fork 6.0.0

@bazel-io bazel-io removed the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Nov 28, 2022
fmeum added a commit to fmeum/bazel that referenced this issue Nov 28, 2022
The `FileReader(String,Charset)` constructor is not available in Java 8.

Fixes bazelbuild#16849
Work towards bazelbuild#16124

Closes bazelbuild#16851.

PiperOrigin-RevId: 491310720
Change-Id: I26f7bce346038d10285b0a1ee7b29216ba151010
meteorcloudy pushed a commit that referenced this issue Nov 28, 2022
The `FileReader(String,Charset)` constructor is not available in Java 8.

Fixes #16849
Work towards #16124

Closes #16851.

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

Successfully merging a pull request may close this issue.

4 participants