emezeske/lein-cljsbuild — Issue #32: Error while building multiple configurations in parallel
Author: kumarshantanu
Created: 2012-02-19 13:46:07+00:00
State: open

I have two build configurations in a project, with some overlapping CLJS and crossover files. When running `lein clean && lein cljsbuild once` on different occasions I noticed following kinds of errors.

***Case 1***

Sometimes I get this exception trace:

```
Exception in thread "main" java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
at clojure.lang.Util.runtimeException(Util.java:165)
at clojure.lang.LazySeq.sval(LazySeq.java:51)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.RT.seq(RT.java:466)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$dorun.invoke(core.clj:2723)
at clojure.core$doall.invoke(core.clj:2739)
at cljsbuild.core$in_threads.invoke(core.clj:154)
at user$eval2057.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6465)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.eval(Compiler.java:6431)
at clojure.core$eval.invoke(core.clj:2795)
at clojure.main$eval_opt.invoke(main.clj:296)
at clojure.main$initialize.invoke(main.clj:315)
at clojure.main$null_opt.invoke(main.clj:348)
at clojure.main$main.doInvoke(main.clj:426)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:405)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.main.main(main.java:37)
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at clojure.core$future_call$reify__5684.deref(core.clj:6054)
at clojure.core$deref.invoke(core.clj:2078)
at clojure.core$map$fn__3811.invoke(core.clj:2432)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
... 20 more
Caused by: java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
at java.util.regex.Matcher.reset(Matcher.java:291)
at java.util.regex.Matcher.(Matcher.java:211)
at java.util.regex.Pattern.matcher(Pattern.java:888)
at clj_stacktrace.utils$re_gsub.invoke(utils.clj:6)
at clj_stacktrace.core$clojure_ns.invoke(core.clj:14)
at clj_stacktrace.core$parse_trace_elem.invoke(core.clj:68)
at clojure.core$map$fn__3811.invoke(core.clj:2432)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.RT.seq(RT.java:466)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$map$fn__3811.invoke(core.clj:2424)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.RT.seq(RT.java:466)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$map$fn__3811.invoke(core.clj:2424)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.Cons.next(Cons.java:39)
at clojure.lang.RT.length(RT.java:1599)
at clojure.lang.RT.seqToArray(RT.java:1555)
at clojure.lang.LazySeq.toArray(LazySeq.java:133)
at clojure.lang.RT.toArray(RT.java:1533)
at clojure.core$to_array.invoke(core.clj:325)
at clojure.core$sort.invoke(core.clj:2697)
at clojure.core$sort.invoke(core.clj:2694)
at clj_stacktrace.repl$find_source_width.invoke(repl.clj:98)
at clj_stacktrace.repl$pst_on.invoke(repl.clj:107)
at clj_stacktrace.repl$pst_PLUS_.doInvoke(repl.clj:129)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at cljsbuild.core$compile_cljs.invoke(core.clj:75)
at cljsbuild.core$run_compiler.invoke(core.clj:179)
at user$eval2057$fn__2058.invoke(NO_SOURCE_FILE:1)
at cljsbuild.core$in_threads$fn__2003$fn__2004.invoke(core.clj:154)
at clojure.core$binding_conveyor_fn$fn__3713.invoke(core.clj:1817)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
```

***Case 2***

Some other times only the first file is generated and I notice the following error message:

```
Feb 19, 2012 7:07:30 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: ERROR - Duplicate input: /Users/shantanu/projects/workspace/basil/.clojurescript-output/basil/error.js

ERROR: JSC_DUPLICATE_INPUT. Duplicate input: /Users/shantanu/projects/workspace/basil/.clojurescript-output/basil/error.js at (unknown source) line (unknown line) : (unknown column)
Feb 19, 2012 7:07:30 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 1 error(s), 0 warning(s)
target/test.js compiled in 1.900348 seconds.
target/basil.js compiled in 3.588077 seconds.
```

***Case 3***

At other times only the first file is generated and I notice the following error message:

```
Feb 19, 2012 7:09:08 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: ERROR - Duplicate input: /Users/shantanu/projects/workspace/basil/.clojurescript-output/basil/error.js

ERROR: JSC_DUPLICATE_INPUT. Duplicate input: /Users/shantanu/projects/workspace/basil/.clojurescript-output/basil/error.js at (unknown source) line (unknown line) : (unknown column)
Feb 19, 2012 7:09:08 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: ERROR - Duplicate input: /Users/shantanu/projects/workspace/basil/.clojurescript-output/basil/group.js

Feb 19, 2012 7:09:08 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: ERROR - Duplicate input: /Users/shantanu/projects/workspace/basil/.clojurescript-output/basil/render.js

Feb 19, 2012 7:09:08 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: ERROR - Duplicate input: /Users/shantanu/projects/workspace/basil/.clojurescript-output/basil/slot.js

Feb 19, 2012 7:09:08 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 4 error(s), 0 warning(s)
ERROR: JSC_DUPLICATE_INPUT. Duplicate input: /Users/shantanu/projects/workspace/basil/.clojurescript-output/basil/group.js at (unknown source) line (unknown line) : (unknown column)
ERROR: JSC_DUPLICATE_INPUT. Duplicate input: /Users/shantanu/projects/workspace/basil/.clojurescript-output/basil/render.js at (unknown source) line (unknown line) : (unknown column)
ERROR: JSC_DUPLICATE_INPUT. Duplicate input: /Users/shantanu/projects/workspace/basil/.clojurescript-output/basil/slot.js at (unknown source) line (unknown line) : (unknown column)
target/test.js compiled in 1.721299 seconds.
target/basil.js compiled in 2.680332 seconds.
```