Circular dependencies with parallel build cause the compiler get stuck

Description

If you have circular dependencies between namespaces, arallel-build is enabled and :optimizations is something other than :none, the compiler won't show an error message about the circular dependencies and the compilation never finishes.

Reproduction: https://github.com/miikka/cljs-circular-deps-repro

Looking at the code, I think that this happens because the parallel builder threads wait for their dependencies to be built before they proceed. With circular dependencies, this never happens. I suspect that commit 9ad6d5d61c introduced this problem, as it disabled the circularity-checking code that was run before the parallel compilation.

Environment

ClojureScript 1.9.562

Activity

Show:
Dieter Komendera
December 13, 2017, 10:43 AM

example reproducing the issue

Dieter Komendera
December 13, 2017, 11:02 AM
Jan Rychter
March 5, 2018, 12:26 PM

I also ran into this problem with `:optimizations :none` on 1.9.946.

David Nolen
March 5, 2018, 2:31 PM

We probably have enough helpers in `module_graph.cljc` to write a simple dependency check on the inputs before we start parallel building.

David Nolen
March 10, 2018, 5:17 PM
Completed

Assignee

David Nolen

Reporter

Miikka Koskinen

Labels

None

Approval

None

Patch

None

Priority

Critical
Configure