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
Compiler should not call System.exit #5674
Comments
Imported From: https://issues.scala-lang.org/browse/SI-5674?orig=1 |
@gkossakowski said: |
@adriaanm said: scala/tools/cmd/Demo.scala:51 override def errorFn(msg: String) = { println("Error: " + msg) ; sys.exit(0) }
scala/tools/cmd/package.scala:19 sys.exit(0)
scala/tools/nsc/Driver.scala:68 sys.exit(if (reporter.hasErrors) 1 else 0)
scala/tools/nsc/MainGenericRunner.scala:106 sys.exit(1)
scala/tools/nsc/MainTokenMetric.scala:53 sys.exit(if (reporter.hasErrors) 1 else 0)
scala/tools/nsc/interactive/REPL.scala:66 /*sys.*/exit(if (reporter.hasErrors) 1 else 0)// Don't use sys yet as this has to run on 2.8.2 also.
scala/tools/nsc/interactive/REPL.scala:189 exit(1) // Don't use sys yet as this has to run on 2.8.2 also.
scala/tools/nsc/interactive/tests/InteractiveTest.scala:127 sys.exit(0)
scala/tools/nsc/interactive/tests/Tester.scala:206 sys.exit(0)
scala/tools/util/SocketServer.scala:21 def fatal(msg: String) = { warn(msg) ; sys.exit(1) }
scala/tools/util/VerifyClass.scala:51 System.exit(if(errors.size > 0) 1 else 0) |
/me shudders is there a good samaritan who wants to tackle this? |
I could have a look into this. What does |
well, that might depend on context. in general compiler code, just throw an exception, e.g. with perhaps there will be cases where there would be room to do even better, e.g. by reporting some kind of proper compiler error? but you needn't go there unless you really feel like it, feel free to scope the issue narrowly. |
thought: it's conceivable that one or more of the remaining calls is actually legit, like maybe in an |
@SethTisue Looking more closely at some of the uses, a lot of them are Edit: |
@NthPortal sorry but I haven't had time to take a closer look at this and won't this week either. we can look at it on a case-by-case basis on the PR. |
@SethTisue No worries For all of the ones where |
...except under very specific/clear circumstances. To do so otherwise seriously hampers interoperation with maven, sbt, osgi, any situation where we don't completely own the running jvm.
The text was updated successfully, but these errors were encountered: