Fork me on GitHub
#shadow-cljs
<
2017-09-23
>
bolasblack09:09:28

Hi thheller, :cache-root works very well! I encountered NullPointerException when I compiling a file which using clojure.pprint/pprint

bolasblack09:09:40

NullPointerException:
        clojure.lang.Numbers.ops (Numbers.java:1013)
        clojure.lang.Numbers.minus (Numbers.java:137)
        clojure.lang.Numbers.minus (Numbers.java:3712)
        shadow.build.warnings/get-source-excerpts/make-source-excerpt--19935 (warnings.clj:24)
        shadow.build.warnings/get-source-excerpts/iter--19937--19941/fn--19942/fn--19943 (warnings.clj:40)
        shadow.build.warnings/get-source-excerpts/iter--19937--19941/fn--19942 (warnings.clj:39)
        clojure.lang.LazySeq.sval (LazySeq.java:40)
        clojure.lang.LazySeq.seq (LazySeq.java:49)
        clojure.lang.RT.seq (RT.java:525)
        clojure.core/seq--4944 (core.clj:137)
        clojure.core.protocols/seq-reduce (protocols.clj:24)
        clojure.core.protocols/fn--7648 (protocols.clj:75)
        clojure.core.protocols/fn--7648 (protocols.clj:75)
        clojure.core.protocols/fn--7594/G--7589--7607 (protocols.clj:13)
        clojure.core/reduce (core.clj:6704)
        clojure.core/into (core.clj:6771)
        clojure.core/into (core.clj:6763)
        shadow.build.warnings/get-source-excerpts (warnings.clj:41)
        shadow.build.warnings/get-source-excerpts (warnings.clj:6)
        shadow.build/enhance-warnings (build.clj:29)
        shadow.build/enhance-warnings (build.clj:16)
        shadow.build/extract-build-info/fn--21260 (build.clj:84)
        clojure.core/map/fn--5406 (core.clj:2733)
        clojure.lang.LazySeq.sval (LazySeq.java:40)
        clojure.lang.LazySeq.seq (LazySeq.java:49)
        clojure.lang.ChunkedCons.chunkedNext (ChunkedCons.java:59)
        clojure.core/chunk-next (core.clj:700)
        clojure.core.protocols/fn--7660 (protocols.clj:137)
        clojure.core.protocols/fn--7660 (protocols.clj:124)
        clojure.core.protocols/fn--7620/G--7615--7629 (protocols.clj:19)
        clojure.core.protocols/seq-reduce (protocols.clj:31)
        clojure.core.protocols/fn--7648 (protocols.clj:75)
        clojure.core.protocols/fn--7648 (protocols.clj:75)
        clojure.core.protocols/fn--7594/G--7589--7607 (protocols.clj:13)
        clojure.core/reduce (core.clj:6704)
        clojure.core/into (core.clj:6771)
        clojure.core/into (core.clj:6763)
        shadow.build/extract-build-info (build.clj:86)
        shadow.build/extract-build-info (build.clj:59)
        shadow.build/update-build-info-after-compile (build.clj:97)
        shadow.build/update-build-info-after-compile (build.clj:95)
        shadow.build/compile (build.clj:259)
        shadow.build/compile (build.clj:248)
        shadow.cljs.devtools.api/release* (api.clj:223)
        shadow.cljs.devtools.api/release* (api.clj:210)
        shadow.cljs.devtools.cli/do-build-command (cli.clj:29)
        shadow.cljs.devtools.cli/do-build-command (cli.clj:25)
        shadow.cljs.devtools.cli/do-build-commands/fn--538/fn--539 (cli.clj:66)
        clojure.core/binding-conveyor-fn/fn--5297 (core.clj:2027)
        java.util.concurrent.FutureTask.run (FutureTask.java:266)
        java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
        java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
        java.lang.Thread.run (Thread.java:748)

bolasblack09:09:16

This is stack

bolasblack09:09:30

[{:warning :dynamic, :line 776, :column 5, :msg cljs.pprint/*print-base* not declared ^:dynamic, :extra {:ev {:name cljs.pprint/*print-base*, :ns cljs.pprint}, :name cljs.pprint/*print-base*}} {:warning :dynamic, :line 776, :column 5, :msg cljs.pprint/*print-circle* not declared ^:dynamic, :extra {:ev {:name cljs.pprint/*print-circle*, :ns cljs.pprint}, :name cljs.pprint/*print-circle*}} ...
This is part warning

thheller09:09:05

I’ll add a generic catch, failing to get a source excerpt for the warning shouldn’t fail a build 😛

bolasblack09:09:46

And I found some message: dead/moved: null

bolasblack09:09:01

When Flushing optimized modules

thheller09:09:22

ah yeah that should not be null

bolasblack09:09:31

Like this

-> Flushing optimized modules
Flushing: goog.base.js (99 bytes)
dead/moved: null
dead/moved: null
dead/moved: null
dead/moved: null
dead/moved: null
dead/moved: null
Flushing: goog.math.integer.js (3813 bytes)
dead/moved: null
dead/moved: null
dead/moved: null
Flushing: cljs.core.js (138248 bytes)
dead/moved: null
Flushing: cljs.core.async.impl.buffers.js (140 bytes)
dead/moved: null
dead/moved: null
dead/moved: null
dead/moved: null
dead/moved: null
dead/moved: null
dead/moved: null
dead/moved: null
dead/moved: null
dead/moved: null
Flushing: cljs.core.async.impl.timers.js (220 bytes)
dead/moved: null
Flushing: cljs.core.async.js (807 bytes)
Flushing: clojure.string.js (1508 bytes)
dead/moved: null
dead/moved: null
dead/moved: null
dead/moved: null
dead/moved: null
dead/moved: null
Flushing: module$axios.js (137 bytes)
dead/moved: null
Flushing: cljs.nodejs.js (151 bytes)
Flushing: hubot.utils.macro.js (4168 bytes)
Flushing: hubot.utils.js (513 bytes)
Flushing: hubot.notify.js (5460 bytes)
dead/moved: null
Flushing: hubot.todoist.js (1350 bytes)
Flushing: cljs.pprint.js (138907 bytes)
Flushing: module$fs.js (142 bytes)
Flushing: module$path.js (136 bytes)
Flushing: module$glob.js (136 bytes)
Flushing: build.js (2198 bytes)
Flushing: hubot.hello.js (1587 bytes)
Flushing: hubot.codebuild.js (11703 bytes)
<- Flushing optimized modules (11 ms)

thheller09:09:03

yeah it displays the wrong name, it is supposed to display the name of the file that was completely removed as dead code

bolasblack09:09:36

So much dead code 😂

thheller09:09:51

well maybe thats not all that interesting after all. maybe I’ll just remove the message 😛

thheller09:09:09

yeah thats the amazing part of the closure compiler .. it removes sooo much stuff

thheller09:09:31

well some parts may just be moved to other files so its not entirely dead

bolasblack09:09:15

And I found the code will always be optimized, even though I set :optimizations :none in :builds

bolasblack09:09:08

Is that in the expectation?

thheller09:09:19

shadow-cljs release will always optimize yes. thats the point 🙂

thheller09:09:43

shadow-cljs compile or watch will never optimize, no need to set optimizations

thheller09:09:17

the config in shadow-cljs is basically always 2in1 if you are used to other tools

thheller09:09:55

you can use :simple if you don’t want :advanced

bolasblack10:09:35

Aha, that's truly my fault, I forgot I'm using shadow-cljs release