Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
zinc doesn't seems to work in multithreading environment #31
I am using zinc 0.2.5 with scala-maven-plugin and using maven parallel build.
The build is successful most of the times, but sometimes fails, e.g. with  or couldn't find dependency libraries .
Seems like the root cause is that Sun Java compiler is not thread safe, despite claiming so (there are some bugs on web with similar symptom, e.g. https://code.google.com/p/maven-annotation-plugin/issues/detail?id=32 ).
Can we add an argument to zinc which will cause to always fork/not reuse at the same java compiler? It is unlikely that Java compiler will get fixed in short time, but that's how maven-compiler-plugin deal with it (http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#fork ).
@pvlugter Thank so much for your reply.
I just checked on my machine on JAVA HOME is not set:
Version = 0.2.5
Zinc compiler cache limit = 5
Compiler(Scala 2.10.0) [3005d89e]
Will set it and see if that helped.
Not sure if it's related, but I hit also error where dependency is not found:
It happens only when zinc is used.
Unfortunately rather not, it is a code of my employer (Sumo Logic). Moreover, it's fairly large (~100 modules) and sometime I have to build a few times before I hit the issue.
I would rather spent some time to isolate/replicate that issue on smaller project.