Build process dies dramatically in case of issues when compiling the test-fixtures

Issue #102 resolved
Michael Eichberg repo owner created an issue

I.e., if the test fixtures don't compile, the whole process should "just stop" - throwing "dramatic exceptions" is not necessary.

[error] (BytecodeInfrastructure/test:javaFixtureCompile) scala.collection.parallel.CompositeThrowable: Multiple exceptions thrown during a parallel computation: java.lang.IllegalStateException: compiling the Java test fixtures failed [error] org.opalj.javacompilation.FixtureCompileSpec$OPALTestFixtureCompiler.compile(FixtureCompileSpec.scala:145) [error] org.opalj.javacompilation.JavaFixtureCompiler$Javacompilation$$anonfun$4.apply(JavaFixtureCompiler.scala:148) [error] org.opalj.javacompilation.JavaFixtureCompiler$Javacompilation$$anonfun$4.apply(JavaFixtureCompiler.scala:147) [error] scala.collection.parallel.mutable.ParArray$Map.leaf(ParArray.scala:658) [error] scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply$mcV$sp(Tasks.scala:54) [error] scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply(Tasks.scala:53) [error] scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply(Tasks.scala:53) [error] scala.collection.parallel.Task$class.tryLeaf(Tasks.scala:56) [error] scala.collection.parallel.mutable.ParArray$Map.tryLeaf(ParArray.scala:650) [error] scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask$class.internal(Tasks.scala:183) [error] . [error] . [error] . [error] [error] java.lang.IllegalStateException: compiling the Java test fixtures failed [error] org.opalj.javacompilation.FixtureCompileSpec$OPALTestFixtureCompiler.compile(FixtureCompileSpec.scala:145) [error] org.opalj.javacompilation.JavaFixtureCompiler$Javacompilation$$anonfun$4.apply(JavaFixtureCompiler.scala:148) [error] org.opalj.javacompilation.JavaFixtureCompiler$Javacompilation$$anonfun$4.apply(JavaFixtureCompiler.scala:147) [error] scala.collection.parallel.mutable.ParArray$Map.leaf(ParArray.scala:658) [error] scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply$mcV$sp(Tasks.scala:54) [error] scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply(Tasks.scala:53) [error] scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply(Tasks.scala:53) [error] scala.collection.parallel.Task$class.tryLeaf(Tasks.scala:56) [error] scala.collection.parallel.mutable.ParArray$Map.tryLeaf(ParArray.scala:650) [error] scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask$class.compute(Tasks.scala:165)

Comments (6)

  1. Simon Leischnig

    It was not meant to be dramatic -- the little I found on failing an sbt task suggested to do so with an exception. Mark O' Harrah suggested this also on http://grokbase.com/t/gg/simple-build-tool/134cjtzkhb/sbt-sbt-fail-build-gracefully

    When I changed one compiler.config file in a test fixture to provoke an error, it suppressed the stack trace and just printed out:

    (from a clean sbt test invocation)

    [...]
    [info] Compiling test fixtures: /home/simon/git/opal_hiwi/OPAL/bi/src/test/fixtures-java/projects/lambdas /home/simon/git/opal_hiwi/OPAL/bi/src/test/fixtures-java/support/annotations -d /home/simon/git/opal_hiwi/OPAL/bi/target/scala-2.11/resource_managed/test/lambdas-1.8-g-paraters-genericsignature -Xemacs -encoding utf8  -1.8 -g -paraters -genericsignature
    [error] Unrecognized option : -paraters
    [info] Compiling test fixtures: /home/simon/git/opal_hiwi/OPAL/bi/src/test/fixtures-java/projects/methods  -d /home/simon/git/opal_hiwi/OPAL/bi/target/scala-2.11/resource_managed/test/methods -Xemacs -encoding utf8  -g -8 -parameters -genericsignature
    [info] Compiling test fixtures: /home/simon/git/opal_hiwi/OPAL/bi/src/test/fixtures-java/projects/types  -d /home/simon/git/opal_hiwi/OPAL/bi/target/scala-2.11/resource_managed/test/types -Xemacs -encoding utf8  -g -8 -parameters -genericsignature
    [...]
    

    and at the end:

    [...]
    [warn]     ^
    [warn] 10 warnings found
    [info] Main Scala API documentation successful.
    [trace] Stack trace suppressed: run last BytecodeInfrastructure/test:javaFixtureCompile for the full output.
    [error] (BytecodeInfrastructure/test:javaFixtureCompile) java.lang.IllegalStateException: compiling the Java test fixtures failed
    [error] Total time: 554 s, completed Sep 25, 2017 4:10:17 PM
    [...]
    

    Am I correct in assuming the above stacktrace in the issue was printed by invoking "last" in the sbt shell? In which context was it produced? One form to read the issue is that the whole sbt build should be aborted. Is this correct? Do you have any suggestions on how to perform the desired "just stopping of the process" behavior? Thanks!

  2. Michael Eichberg reporter

    I can't reproduce the issue anymore; when the fixtures don't compile, the error message ist perfectly fine (now?).

  3. Log in to comment