-
Notifications
You must be signed in to change notification settings - Fork 121
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
"javac returned non-zero exit code", but no errors #520
Comments
That would be confirmed by #376, which I closed because I couldn't reproduce. |
This is an attempt to fix sbt/zinc#520
To diagnose this problem further, I suggest setting |
I sat down with the customer today with his laptop, and was able to reproduce this. On the environment,
In other words, the bug is likely in the error handling of forked mode. |
This is an improvement over the status quo of forked Javac error parsing, but likely not a complete fix. "Normal" Java error messages look like: ``` /path/a.java:100:1: error message if (x.isBar) { ^ symbol: xxx location: xxx ``` However, under certain circumstances javac reports compiler errors are reported as: ``` /path/a.java:100:1: error message symbol: xxx location: xxx if (x.isBar) { ``` Current parsing assumes existence of `^` as well as indentation before "symbol" etc. Ultimately a better way of handling forking probably is to define our own small commandline app, like forked tests are done.
This is an improvement over the status quo of forked Javac error parsing, but likely not a complete fix. "Normal" Java error messages look like: ``` /path/a.java:100:1: error message if (x.isBar) { ^ symbol: xxx location: xxx ``` However, under certain circumstances javac reports compiler errors are reported as: ``` /path/a.java:100:1: error message symbol: xxx location: xxx if (x.isBar) { ``` Current parsing assumes existence of `^` as well as indentation before "symbol" etc. Ultimately a better way of handling forking probably is to define our own small commandline app, like forked tests are done.
I finally found the root of the error here. This happens whenever |
I'm hitting on this error in building a pure Java module and lack of error messages makes it near impossible to be productive while writing Java code. A workaround is to explicitly declare javaHome.in(Compile) := {
Some(file(sys.props("java.home")).getParentFile)
} |
Cross-linking #415, which contains an example reproducing this error. I'm closing that ticket and keeping this one open as it's richer in details. |
Any workaround for this issue? |
@wpc009 The workaround in #520 (comment) works for me under sbt version 1.1.6 but not the latest sbt 1.2.x. |
Is this fixed by #448 or is there more work to do? |
Until we find a new failure mode other than the one fixed in #448 etc, I am going to close this. |
- Remove generated java sources from the repo - Move every subproject to scala 2.13 - Remove inferJavaHome hack (the issue has been fixed apparently: sbt/zinc#520) - Add myself as a developer - Change license link to https
- Move every subproject to scala 2.13 - Remove inferJavaHome hack (the issue has been fixed apparently: sbt/zinc#520) - Add myself as a developer - Change license link to https
- Move every subproject to scala 2.13 - Remove inferJavaHome hack (the issue has been fixed apparently: sbt/zinc#520) - Change developers list - Change license link to https
There's been a report that the user would see
but the actual error messages from Java does not get printed out.
I think I've seen some of these myself as well.
Ref sbt/sbt#2256
Ref sbt/sbt#3665
Ref #376
The text was updated successfully, but these errors were encountered: