Skip to content

Loading…

The compiler no longer supports parallel builds #96

Closed
emezeske opened this Issue · 1 comment

1 participant

@emezeske
Owner

Currently, when multiple builds are configured, lein-cljsbuild compiles them all in parallel. This worked with older versions of the ClojureScript compiler, but in recent versions, it causes problems due to the top-level cljs.complier/namespaces atom, which is shared among threads. The problem is that this atom is reset by cljs.closure/build at the beginning of a compiler run, and also updated during that run, and thus multiple threads will see it with various unexpected values.

At best, this problem results in massive amounts of undeclared Var warnings, because one thread may reset the atom while another is checking for undeclared Vars. I haven't seen anything worse than that, but I expect that more subtle problems can occur due to this race.

@emezeske
Owner

For now, I am going to make multiple builds run sequentially, to work around this problem.

One option for a more permanent solution would be to spawn Java processes for each build, but that could require quite a bit of memory. Also, a process pool would have to be used to avoid the Java startup slowness that auto mode is designed to avoid in the first place.

@emezeske emezeske added a commit that referenced this issue
@emezeske Perform multiple builds sequentially.
Closes Issue #96.
77b4427
@emezeske emezeske closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.