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

Missing error diagnostics using Bazel (for Scala 2.x) #6288

Open
aishfenton opened this issue Apr 6, 2024 · 5 comments
Open

Missing error diagnostics using Bazel (for Scala 2.x) #6288

aishfenton opened this issue Apr 6, 2024 · 5 comments
Assignees
Labels

Comments

@aishfenton
Copy link

Describe the bug

Error diagnostics aren't showing when using Bazel and Metals. This time though for Scala 2.12 (I see the other issue for Scala3 but I presume that's a separate issue).

Expected behavior

No response

Operating system

Linux

Editor/Extension

VS Code

Version of Metals

v1.2.2

Extra context or search terms

See this in the metals.log:

2024.04.05 23:53:46 INFO  INFO: Found 1 target...�[0m
2024.04.05 23:53:46 INFO  checking cached actions�[0m
2024.04.05 23:53:46 INFO  [0 / 2] [Prepa] BazelWorkspaceStatusAction stable-status.txt�[0m
2024.04.05 23:53:46 INFO  [1 / 2] scala @//.../netflix/aeviz/service:service; 0s remote-cache, worker�[0m
2024.04.05 23:53:47 INFO  ERROR: /home/coder/rankresearchv2/aeviz/src/main/scala/com/netflix/aeviz/service/BUILD.bazel:10:14: scala @//aeviz/src/main/scala/com/netflix/aeviz/service:service failed: (Exit 1): scalac failed: error executing command (from target //aeviz/src/main/scala/com/netflix/aeviz/service:service) bazel-out/k8-opt-exec-2B5CBBC6/bin/external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/scalac/scalac '--jvm_flag=-DNetflixInvalidateCacheArg=20220508' '--jvm_flag=-Xss2m' '--jvm_flag=-Xmx2g' ... (remaining 1 argument skipped)�[0m
2024.04.05 23:53:47 INFO  aeviz/src/main/scala/com/netflix/aeviz/service/RankService.scala:49: error: not found: value asfd�[0m
2024.04.05 23:53:47 INFO  asfd�[0m
2024.04.05 23:53:47 INFO  ^�[0m
2024.04.05 23:53:47 INFO  aeviz/src/main/scala/com/netflix/aeviz/service/RankService.scala:87: warning: local val seed in method applyOrElse is never used�[0m
2024.04.05 23:53:47 INFO  val seed = s.getOrElse(defaultSeed)�[0m
2024.04.05 23:53:47 INFO  ^�[0m
2024.04.05 23:53:47 INFO  aeviz/src/main/scala/com/netflix/aeviz/service/RankService.scala:113: warning: local val seed in method applyOrElse is never used�[0m
2024.04.05 23:53:47 INFO  val seed = s.getOrElse(defaultSeed)�[0m
2024.04.05 23:53:47 INFO  ^�[0m
2024.04.05 23:53:47 INFO  aeviz/src/main/scala/com/netflix/aeviz/service/RankService.scala:134: warning: local val seed in method applyOrElse is never used�[0m
2024.04.05 23:53:47 INFO  val seed = s.getOrElse(defaultSeed)�[0m
2024.04.05 23:53:47 INFO  ^�[0m
2024.04.05 23:53:47 INFO  three warnings found�[0m
2024.04.05 23:53:47 INFO  one error found�[0m
2024.04.05 23:53:47 INFO  Build failed�[0m
2024.04.05 23:53:47 INFO  java.lang.RuntimeException: Build failed�[0m
2024.04.05 23:53:47 INFO  at io.bazel.rulesscala.scalac.ScalacInvoker.invokeCompiler(ScalacInvoker.java:53)�[0m
2024.04.05 23:53:47 INFO  at io.bazel.rulesscala.scalac.ScalacWorker.compileScalaSources(ScalacWorker.java:253)�[0m
2024.04.05 23:53:47 INFO  at io.bazel.rulesscala.scalac.ScalacWorker.work(ScalacWorker.java:69)�[0m
2024.04.05 23:53:47 INFO  at io.bazel.rulesscala.worker.Worker.persistentWorkerMain(Worker.java:86)�[0m
2024.04.05 23:53:47 INFO  at io.bazel.rulesscala.worker.Worker.workerMain(Worker.java:39)�[0m
2024.04.05 23:53:47 INFO  at io.bazel.rulesscala.scalac.ScalacWorker.main(ScalacWorker.java:33)�[0m
@aishfenton aishfenton changed the title Missing error eiagnostics using Bazel (for Scala 2.x) Missing error diagnostics using Bazel (for Scala 2.x) Apr 6, 2024
@tgodzik tgodzik self-assigned this Apr 8, 2024
@tgodzik tgodzik added the bazel label Apr 8, 2024
@tgodzik
Copy link
Contributor

tgodzik commented Apr 8, 2024

Thanks for reporting! Did this happen before, were there any changes to bazel/rules-scala versions?

@aishfenton
Copy link
Author

First time I've got this far (a couple of previous, now resolved, bazel-bsp issues meant we hadn't got past import until now).

@tgodzik
Copy link
Contributor

tgodzik commented Apr 8, 2024

Hmm... does this happen for you on some sample Bazel repos or only in yours? Are you able to provide the versions of Bazel rules-scala and bazel-bsp versions you are using?

@aishfenton
Copy link
Author

aishfenton commented Apr 8, 2024

We're using Scala 2.12.18, Bazel 6.3.2, rules_scala 6.4.0 and nightly build of Metals 1.2.2+99-c0e45169-SNAPSHOT (can update to a newer nightly if that helps?)

@tgodzik
Copy link
Contributor

tgodzik commented Apr 16, 2024

Looks like this might be related to JetBrains/bazel-bsp#547 (comment)

Some diagnostics are sent with progress, which is not read by Bazel BSP. We can confirm once the fix is merged.

@tgodzik tgodzik added this to Triage in Metals Issue Board via automation Apr 16, 2024
@tgodzik tgodzik moved this from Triage to To do in Metals Issue Board Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants