bazel-contrib / bazel-contrib/rules_scala
Error messages on scala compilation includes superfluous RuntimeException stack trace of ScalacProcessor
- Dominant language
- Starlark
- Stars
- 384
- Forks
- 292
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 47
Description
Error messages on scala compilation includes superfluous RuntimeException stack trace of ScalacProcessor.
This stack trace does nothing to the understanding of what is the source of the compilation error. in fact it can obscure the real problem.
An example of the issue:
```
some/package/SomeClass.scala:5: error: value foo is not a member of object some.package.SomeOtherClass
SomeOtherClass.foo
^
one error found
one error found
java.lang.RuntimeException: Build failed
at io.bazel.rulesscala.scalac.ScalacProcessor.compileScalaSources(ScalacProcessor.java:248)
at io.bazel.rulesscala.scalac.ScalacProcessor.processRequest(ScalacProcessor.java:68)
at io.bazel.rulesscala.worker.GenericWorker.run(GenericWorker.java:125)
at io.bazel.rulesscala.scalac.ScalaCInvoker.main(ScalaCInvoker.java:41)
Use --strategy=Scalac=standalone to disable sandboxing for the failing actions.
Target //test_expect_failure/missing_direct_deps/internal_deps:direct_dependency failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2.226s, Critical Path: 2.03s
```
Compared to java build:
```
src/main/java/com/example/A.java:6: error: cannot find symbol
System.out.printl("Hi!");
^
symbol: method printl(String)
location: variable out of type PrintStream
Target //:A failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.415s, Critical Path: 0.19s
```
which does not have such a stack trace
Contributor guide
Research direction
Start at io.bazel.rulesscala.scalac.ScalacProcessor.compileScalaSources, especially ScalacProcessor.java:248, and trace how compilation failures are reported to the worker. Reproduce the example Scala compilation failure and verify that the compiler diagnostic remains while the superfluous RuntimeException stack trace is no longer shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, scala
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100