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

[Scala 2.13.12] Issue with scala.tools.nsc.reporters.Reporter when compiling #1514

Closed
scoquelin opened this issue Sep 22, 2023 · 0 comments · Fixed by #1517
Closed

[Scala 2.13.12] Issue with scala.tools.nsc.reporters.Reporter when compiling #1514

scoquelin opened this issue Sep 22, 2023 · 0 comments · Fixed by #1517

Comments

@scoquelin
Copy link
Contributor

scoquelin commented Sep 22, 2023

Seems like this change in the Scala codebase has broken compilation of DepsTrackingReporter.java since it introduces a new parameter (with a default value) to existing error/warning methods that Java cannot interpret seamlessly.

Here is the stacktrace I get when compiling with Scala 2.13.12 (builds fine with 2.13.11 btw)

ERROR: /private/var/tmp/_bazel_sebastien/beeef587c4e635c319809c3cfc50320b/external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/scalac/reporter/BUILD:5:13: Building external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/scalac/reporter/libreporter.jar (2 source files) [for tool] failed: (Exit 1): java failed: error executing command (from target @io_bazel_rules_scala//src/java/io/bazel/rulesscala/scalac/reporter:reporter) external/remotejdk11_macos_aarch64/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 18 arguments skipped)
warning: [path] bad path element "/private/var/tmp/_bazel_sebastien/beeef587c4e635c319809c3cfc50320b/execroot/platform/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/io_bazel_rules_scala_scala_compiler/io_bazel_rules_scala_scala_compiler.stamp/scala-reflect.jar": no such file or directory
warning: [path] bad path element "/private/var/tmp/_bazel_sebastien/beeef587c4e635c319809c3cfc50320b/execroot/platform/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/io_bazel_rules_scala_scala_compiler/io_bazel_rules_scala_scala_compiler.stamp/scala-library.jar": no such file or directory
external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/scalac/reporter/DepsTrackingReporter.java:220: error: method warning in class Reporter cannot be applied to given types;
            reporter.warning(NoPosition$.MODULE$, strictDepsReport.toString());
                    ^
  required: Position,String,List<CodeAction>
  found: NoPosition$,String
  reason: actual and formal argument lists differ in length
external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/scalac/reporter/DepsTrackingReporter.java:222: error: method error in class Reporter cannot be applied to given types;
            reporter.error(NoPosition$.MODULE$, strictDepsReport.toString());
                    ^
  required: Position,String,List<CodeAction>
  found: NoPosition$,String
  reason: actual and formal argument lists differ in length
external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/scalac/reporter/DepsTrackingReporter.java:228: error: method warning in class Reporter cannot be applied to given types;
            reporter.warning(NoPosition$.MODULE$, compilerDepsReport.toString());
                    ^
  required: Position,String,List<CodeAction>
  found: NoPosition$,String
  reason: actual and formal argument lists differ in length
external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/scalac/reporter/DepsTrackingReporter.java:230: error: method error in class Reporter cannot be applied to given types;
            reporter.error(NoPosition$.MODULE$, compilerDepsReport.toString());
                    ^
  required: Position,String,List<CodeAction>
  found: NoPosition$,String
  reason: actual and formal argument lists differ in length
external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/scalac/reporter/DepsTrackingReporter.java:250: error: method warning in class Reporter cannot be applied to given types;
            reporter.warning(NoPosition$.MODULE$, unusedDepsReport.toString());
                    ^
  required: Position,String,List<CodeAction>
  found: NoPosition$,String
  reason: actual and formal argument lists differ in length
external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/scalac/reporter/DepsTrackingReporter.java:252: error: method error in class Reporter cannot be applied to given types;
            reporter.error(NoPosition$.MODULE$, unusedDepsReport.toString());
                    ^
  required: Position,String,List<CodeAction>
  found: NoPosition$,String
  reason: actual and formal argument lists differ in length

I could try to take a stab at it however since all existing tests are currently based on Scala 2.13.6 and I this change would require to be targeting a specific Scala version I would appreciate some guidance on how to approach this. Thanks !

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

Successfully merging a pull request may close this issue.

1 participant