Fork me on GitHub
#malli
<
2020-07-27
>
steveb8n09:07:54

Q: I’m having trouble with Cursive and shadow compilation ever since I updated to the dynaload/sci update. anyone else seeing weird behaviour?

ikitommi09:07:46

@steveb8n do you have the sci.core preloaded?

borkdude09:07:01

Are you using sci?

steveb8n09:07:03

no but I don’t want sci in the build

steveb8n09:07:09

no, not using sci

borkdude09:07:23

Then you should not preload it and it should all work fine theoretically.

steveb8n09:07:45

I did previously but I don’t need it (yet) so would rather save the bundle output size

ikitommi09:07:53

what kind of errors do you get?

steveb8n09:07:34

➜ client-editor git:(master) ✗ shadow-cljs -A:dev --verbose release frontend shadow-cljs - config: /Users/steve/Documents/dev-personal/nextdoc-cloud/client-editor/shadow-cljs.edn shadow-cljs - starting via “clojure” [:frontend] Compiling ... -> build target: :browser stage: :configure <- build target: :browser stage: :configure (6 ms) -> Resolving Module: :main The required namespace “borkdude.dynaload-cljs” is not available, it was required by “malli/sci.cljc”. ➜ client-editor git:(master) ✗ clojure -Stree org.clojure/clojure 1.10.1 org.clojure/core.specs.alpha 0.2.44 org.clojure/spec.alpha 0.2.176 cljs-http/cljs-http 0.1.46 noencore/noencore 0.3.4 commons-codec/commons-codec 1.11 org.clojure/tools.namespace 0.2.11 org.clojure/core.async 0.4.474 org.clojure/tools.analyzer.jvm 0.7.0 org.clojure/tools.analyzer 0.6.9 org.clojure/core.memoize 0.5.9 org.clojure/core.cache 0.6.5 org.clojure/data.priority-map 0.0.7 org.ow2.asm/asm-all 4.2 com.lucasbradstreet/cljs-uuid-utils 1.0.2 riverford/compound 2020.01.09 appliedscience/js-interop 0.1.19 org.clojure/clojurescript 1.10.520 org.clojure/data.json 0.2.6 org.clojure/google-closure-library 0.0-20170809-b9c14c6b org.clojure/google-closure-library-third-party 0.0-20170809-b9c14c6b org.mozilla/rhino 1.7R5 com.google.javascript/closure-compiler-unshaded v20180805 com.google.jsinterop/jsinterop-annotations 1.0.0 com.google.javascript/closure-compiler-externs v20180805 com.google.guava/guava 25.1-jre com.google.errorprone/error_prone_annotations 2.1.3 org.codehaus.mojo/animal-sniffer-annotations 1.14 com.google.j2objc/j2objc-annotations 1.1 org.checkerframework/checker-qual 2.0.0 com.google.code.findbugs/jsr305 3.0.2 args4j/args4j 2.0.26 com.google.protobuf/protobuf-java 3.0.2 com.google.code.gson/gson 2.7 com.cognitect/transit-cljs 0.8.256 com.cognitect/transit-js 0.8.846 fork/fork https://github.com/luciodale/fork.git 25276c0 grafeo/grafeo 0.1.4 r0man/alumbra.printer 0.1.1 r0man/alumbra.js 0.1.0 clj-http/clj-http 3.9.1 org.apache.httpcomponents/httpasyncclient 4.1.3 org.apache.httpcomponents/httpcore-nio 4.4.6 slingshot/slingshot 0.12.2 commons-io/commons-io 2.6 org.apache.httpcomponents/httpcore 4.4.9 org.apache.httpcomponents/httpclient-cache 4.5.5 org.apache.httpcomponents/httpclient 4.5.5 commons-logging/commons-logging 1.2 potemkin/potemkin 0.4.5 clj-tuple/clj-tuple 0.2.2 org.apache.httpcomponents/httpmime 4.5.5 cheshire/cheshire 5.8.1 com.fasterxml.jackson.dataformat/jackson-dataformat-cbor 2.9.6 tigris/tigris 0.1.1 com.fasterxml.jackson.dataformat/jackson-dataformat-smile 2.9.6 re-frame/re-frame 0.10.6 org.clojure/tools.logging 0.3.1 net.cgrand/macrovich 0.2.0 reagent/reagent 0.7.0 cljsjs/react-dom 15.5.4-0 cljsjs/react 15.5.4-0 cljsjs/react-dom-server 15.5.4-0 cljsjs/create-react-class 15.5.3-0 cljc.java-time/cljc.java-time 0.1.11 cljs.java-time/cljs.java-time 0.1.16 henryw374/js-joda 1.12.0-1 metosin/malli https://github.com/metosin/malli.git 3a670d8 com.gfredericks/test.chuck 0.2.10 instaparse/instaparse 1.3.6 com.andrewmcveigh/cljs-time 0.5.1 borkdude/dynaload https://github.com/borkdude/dynaload.git 52f71bc borkdude/edamame 0.0.11-alpha.12 org.clojure/tools.reader 1.3.2 org.clojure/test.check 1.0.0 funcool/promesa 4.0.2 com.rpl/specter 1.1.3-SNAPSHOT riddley/riddley 0.1.12 metosin/reitit-frontend 0.2.9 metosin/reitit-core 0.2.9 meta-merge/meta-merge 1.0.0 metosin/reitit 0.2.9 metosin/reitit-middleware 0.2.9 metosin/muuntaja 0.6.1 com.cognitect/transit-clj 0.8.313 com.cognitect/transit-java 0.8.337 org.msgpack/msgpack 0.6.12 com.googlecode.json-simple/json-simple 1.1.1 org.javassist/javassist 3.18.1-GA javax.xml.bind/jaxb-api 2.3.0 lambdaisland/deep-diff 0.0-25 mvxcvi/puget 1.0.3 fipp/fipp 0.6.14 mvxcvi/arrangement 1.1.1 org.clojure/core.rrb-vector 0.0.13 tech.droit/clj-diff 1.0.0 metosin/reitit-swagger 0.2.9 metosin/reitit-ring 0.2.9 ring/ring-core 1.7.1 commons-fileupload/commons-fileupload 1.3.3 clj-time/clj-time 0.14.3 joda-time/joda-time 2.9.9 crypto-random/crypto-random 1.2.0 ring/ring-codec 1.1.1 crypto-equality/crypto-equality 1.0.0 metosin/reitit-schema 0.2.9 metosin/schema-tools 0.10.5 prismatic/schema 1.1.9 metosin/reitit-sieppari 0.2.9 metosin/sieppari 0.0.0-alpha6 metosin/reitit-http 0.2.9 metosin/reitit-spec 0.2.9 metosin/spec-tools 0.8.2 com.fasterxml.jackson.core/jackson-databind 2.9.7 com.fasterxml.jackson.core/jackson-core 2.9.7 com.fasterxml.jackson.core/jackson-annotations 2.9.0 metosin/reitit-swagger-ui 0.2.9 metosin/ring-swagger-ui 2.2.10 metosin/jsonista 0.2.2 org.ow2.asm/asm 5.1 virgil/virgil 0.1.6 com.fasterxml.jackson.datatype/jackson-datatype-jsr310 2.9.7 metosin/reitit-interceptors 0.2.9 camel-snake-kebab/camel-snake-kebab 0.4.0 ➜ client-editor git:(master) ✗

steveb8n09:07:19

I can also make it fail by starting a clojure repl in the terminal and trying to require dynaload

borkdude09:07:55

maybe kill your ~/.gitlibs ?

borkdude09:07:09

and clear out your .cpcache

borkdude09:07:15

and use -Sforce

steveb8n09:07:40

Clojure 1.10.1or git:(master) ✗ clojure user=> (require ’borkdude.dynaload-clj) Execution error (FileNotFoundException) at user/eval1 (REPL:1). Could not locate borkdude/dynaload_clj__init.class, borkdude/dynaload_clj.clj or borkdude/dynaload_clj.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.

steveb8n09:07:11

I did try deleting it from gitlibs but I haven’t tried deleting the whole dir

steveb8n09:07:18

have already deleted .cpcache

steveb8n09:07:27

trying -Sforce ….

steveb8n09:07:05

clojure -Sforce Clojure 1.10.1 user=> (require ’borkdude.dynaload-clj) Execution error (FileNotFoundException) at user/eval1 (REPL:1). Could not locate borkdude/dynaload_clj__init.class, borkdude/dynaload_clj.clj or borkdude/dynaload_clj.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.

borkdude09:07:23

@steveb8n when you do clojure -Spath do you see borkdude/dynaload there?

steveb8n09:07:41

what’s even stranger is that it works in another project and in CI for this (problematic) project

borkdude09:07:20

maybe it's a shadow problem? can you try with vanilla CLJS?

steveb8n09:07:36

yes. with -Spath it is present

borkdude09:07:53

oh you tried already with the JVM huh. that's strange

steveb8n09:07:58

that’s why I also tested using the clj repl. to exclude shadow

steveb8n09:07:32

Cursive is also weird. it appears in the deps panel but not in “external libraries”

ikitommi09:07:46

➜  ~ clojure -Sdeps '{:deps {metosin/malli {:git/url "" :sha "627b0f0592d129a317f8ccf3dff5296376948bf9"}}}'
Checking out:  at 627b0f0592d129a317f8ccf3dff5296376948bf9
Clojure 1.10.1
user=> (require 'borkdude.dynaload-clj)
Syntax error (ClassNotFoundException) compiling at (REPL:1:1).
'borkdude.dynaload-clj

borkdude09:07:18

what SHA is malli using for dynaload? maybe it was a branch that got deleted?

borkdude09:07:47

the latest SHA is 52f71bc2cb7389a932835fe02f185e3801f7e063

steveb8n09:07:16

malli is using 52….

steveb8n09:07:30

@ikitommi when I run that in my terminal, it works ok

steveb8n09:07:44

sorry. wrong

steveb8n09:07:51

repl starts but require fails

steveb8n09:07:08

if you try the same require with the 52… sha, does it work?

borkdude09:07:12

$ clojure -Sdeps '{:deps {metosin/malli {:git/url "" :sha "627b0f0592d129a317f8ccf3dff5296376948bf9"}}}'
Cloning: 
Checking out:  at 627b0f0592d129a317f8ccf3dff5296376948bf9
Cloning: 
Checking out:  at 52f71bc2cb7389a932835fe02f185e3801f7e063
Clojure 1.10.1
user=> (require 'borkdude.dynaload-clj)
nil
user=>

borkdude09:07:18

works fine over here

borkdude09:07:58

doing this from a clean dir

steveb8n09:07:48

clojure -Sdeps ‘{:deps {metosin/malli {:git/url “https://github.com/metosin/malli.git” :sha “627b0f0592d129a317f8ccf3dff5296376948bf9"}}}’ Clojure 1.10.1 user=> user=> user=> (require ’borkdude.dynaload-clj) Execution error (FileNotFoundException) at user/eval1 (REPL:1). Could not locate borkdude/dynaload_clj__init.class, borkdude/dynaload_clj.clj or borkdude/dynaload_clj.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.

steveb8n09:07:03

must be a deps boycott on Australia

ikitommi09:07:23

working here now too :thinking_face:

ikitommi09:07:43

checked out dynaload manually, started working after that.

borkdude09:07:54

maybe it's a deps.edn bug?

steveb8n09:07:58

yeah I could try that

steveb8n09:07:05

explicit checkout locally

borkdude09:07:11

$ clojure -Sdescribe
{:version "1.10.1.536"

ikitommi09:07:13

borkdude/dynaload {:git/url ""
                           :sha "52f71bc2cb7389a932835fe02f185e3801f7e063"}

steveb8n09:07:08

I’ve got 1.10.1.447

steveb8n09:07:32

I’ve seen deps bugs before. I might try updating clojure cli

borkdude09:07:13

I'm willing to cut a .jar release later on, but since malli itself is still git only, I wasn't in a hurry

👍 3
steveb8n09:07:48

I tried adding an explicit dep on dynaload. same behaviour as with the transitive dep via malli

steveb8n09:07:05

still waiting on brew upgrade 🙂

steveb8n09:07:39

are either of you using Cursive? if so, do you see dynaload in the “External Libraries”?

steveb8n09:07:56

after the clojure deps upgrade, the require works in the terminal. 1 step forward!

steveb8n09:07:19

shadow compile from cli also now works. it is looking like a deps bug

steveb8n09:07:29

trying Cursive ….

steveb8n09:07:31

cursive/shadow via repl still broken. I’ll keep digging…

borkdude09:07:27

maybe cursive uses its own version of deps.edn or maybe tools.deps directly which may be behind

steveb8n09:07:10

that’s exactly what is was! I switched (in prefs) to using the CLI dep executable and now shadow works inside Cursive as well

steveb8n09:07:44

I got bitten by a double-whammy: deps bug and Cursive config

steveb8n09:07:00

thanks for the help team 🙏

bananadance 6
ikitommi09:07:02

what was the root cause for the bug? I’m using 1.10.1.536 and still saw it. A stale cache?

borkdude09:07:51

maybe in your case, an AOT-cache related bug?

steveb8n09:07:24

not sure as I’ve blown away so much stuff now

steveb8n09:07:56

I’m now on 1.10.1.561

borkdude09:07:00

I mean in ikitommi's case, since he had a ClassNotFoundException

borkdude09:07:17

whereas steveb8n got a file not found related exception

steveb8n10:07:19

my best guess is a bug in handling transitive deps via git deps

steveb8n10:07:10

btw: loving the reduction in bundle size. thanks both of you

steveb8n10:07:27

although I then added vega lite and added another 200k