Q: I’m having trouble with Cursive and shadow compilation ever since I updated to the dynaload/sci update. anyone else seeing weird behaviour?
@steveb8n do you have the sci.core
preloaded?
Are you using sci?
no but I don’t want sci in the build
no, not using sci
Then you should not preload it and it should all work fine theoretically.
I did previously but I don’t need it (yet) so would rather save the bundle output size
what kind of errors do you get?
➜ 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) ✗
I can also make it fail by starting a clojure repl in the terminal and trying to require dynaload
maybe kill your ~/.gitlibs
?
and clear out your .cpcache
and use -Sforce
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.
I did try deleting it from gitlibs but I haven’t tried deleting the whole dir
have already deleted .cpcache
trying -Sforce ….
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.
@steveb8n when you do clojure -Spath
do you see borkdude/dynaload there?
what’s even stranger is that it works in another project and in CI for this (problematic) project
maybe it's a shadow problem? can you try with vanilla CLJS?
yes. with -Spath it is present
oh you tried already with the JVM huh. that's strange
that’s why I also tested using the clj repl. to exclude shadow
Cursive is also weird. it appears in the deps panel but not in “external libraries”
➜ ~ clojure -Sdeps '{:deps {metosin/malli {:git/url "<https://github.com/metosin/malli.git>" :sha "627b0f0592d129a317f8ccf3dff5296376948bf9"}}}'
Checking out: <https://github.com/metosin/malli.git> at 627b0f0592d129a317f8ccf3dff5296376948bf9
Clojure 1.10.1
user=> (require 'borkdude.dynaload-clj)
Syntax error (ClassNotFoundException) compiling at (REPL:1:1).
'borkdude.dynaload-clj
what SHA is malli using for dynaload? maybe it was a branch that got deleted?
the latest SHA is 52f71bc2cb7389a932835fe02f185e3801f7e063
malli is using 52….
@ikitommi when I run that in my terminal, it works ok
sorry. wrong
repl starts but require fails
if you try the same require with the 52… sha, does it work?
$ clojure -Sdeps '{:deps {metosin/malli {:git/url "<https://github.com/metosin/malli.git>" :sha "627b0f0592d129a317f8ccf3dff5296376948bf9"}}}'
Cloning: <https://github.com/metosin/malli.git>
Checking out: <https://github.com/metosin/malli.git> at 627b0f0592d129a317f8ccf3dff5296376948bf9
Cloning: <https://github.com/borkdude/dynaload.git>
Checking out: <https://github.com/borkdude/dynaload.git> at 52f71bc2cb7389a932835fe02f185e3801f7e063
Clojure 1.10.1
user=> (require 'borkdude.dynaload-clj)
nil
user=>
works fine over here
doing this from a clean dir
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.
must be a deps boycott on Australia
working here now too :thinking_face:
checked out dynaload manually, started working after that.
maybe it's a deps.edn bug?
yeah I could try that
explicit checkout locally
$ clojure -Sdescribe
{:version "1.10.1.536"
borkdude/dynaload {:git/url "<https://github.com/borkdude/dynaload.git>"
:sha "52f71bc2cb7389a932835fe02f185e3801f7e063"}
I’ve got 1.10.1.447
I’ve seen deps bugs before. I might try updating clojure cli
I'm willing to cut a .jar release later on, but since malli itself is still git only, I wasn't in a hurry
I tried adding an explicit dep on dynaload. same behaviour as with the transitive dep via malli
still waiting on brew upgrade 🙂
are either of you using Cursive? if so, do you see dynaload in the “External Libraries”?
after the clojure deps upgrade, the require works in the terminal. 1 step forward!
shadow compile from cli also now works. it is looking like a deps bug
trying Cursive ….
cursive/shadow via repl still broken. I’ll keep digging…
maybe cursive uses its own version of deps.edn or maybe tools.deps directly which may be behind
that’s exactly what is was! I switched (in prefs) to using the CLI dep executable and now shadow works inside Cursive as well
I got bitten by a double-whammy: deps bug and Cursive config
thanks for the help team 🙏
what was the root cause for the bug? I’m using 1.10.1.536 and still saw it. A stale cache?
maybe in your case, an AOT-cache related bug?
not sure as I’ve blown away so much stuff now
I’m now on 1.10.1.561
I mean in ikitommi's case, since he had a ClassNotFoundException
whereas steveb8n got a file not found related exception
my best guess is a bug in handling transitive deps via git deps
btw: loving the reduction in bundle size. thanks both of you
although I then added vega lite and added another 200k