malli

https://github.com/metosin/malli :malli:
steveb8n 2020-07-27T09:04:54.229Z

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

ikitommi 2020-07-27T09:06:46.229700Z

@steveb8n do you have the sci.core preloaded?

borkdude 2020-07-27T09:07:01.230100Z

Are you using sci?

steveb8n 2020-07-27T09:07:03.230200Z

no but I don’t want sci in the build

steveb8n 2020-07-27T09:07:09.230500Z

no, not using sci

borkdude 2020-07-27T09:07:23.231Z

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

steveb8n 2020-07-27T09:07:45.231500Z

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

ikitommi 2020-07-27T09:07:53.231700Z

what kind of errors do you get?

steveb8n 2020-07-27T09:08:34.231900Z

➜ 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) ✗

steveb8n 2020-07-27T09:09:19.232500Z

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

borkdude 2020-07-27T09:09:55.233100Z

maybe kill your ~/.gitlibs ?

borkdude 2020-07-27T09:10:09.233400Z

and clear out your .cpcache

borkdude 2020-07-27T09:10:15.233600Z

and use -Sforce

steveb8n 2020-07-27T09:10:40.234Z

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.

steveb8n 2020-07-27T09:11:11.234600Z

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

steveb8n 2020-07-27T09:11:18.234800Z

have already deleted .cpcache

steveb8n 2020-07-27T09:11:27.235100Z

trying -Sforce ….

steveb8n 2020-07-27T09:12:05.235300Z

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.

borkdude 2020-07-27T09:12:23.235900Z

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

steveb8n 2020-07-27T09:12:41.236300Z

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

borkdude 2020-07-27T09:13:20.236600Z

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

steveb8n 2020-07-27T09:13:36.237Z

yes. with -Spath it is present

borkdude 2020-07-27T09:13:53.237600Z

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

steveb8n 2020-07-27T09:13:58.237800Z

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

steveb8n 2020-07-27T09:14:32.238400Z

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

ikitommi 2020-07-27T09:14:46.238700Z

➜  ~ 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=&gt; (require 'borkdude.dynaload-clj)
Syntax error (ClassNotFoundException) compiling at (REPL:1:1).
'borkdude.dynaload-clj

borkdude 2020-07-27T09:15:18.239100Z

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

borkdude 2020-07-27T09:15:47.239400Z

the latest SHA is 52f71bc2cb7389a932835fe02f185e3801f7e063

steveb8n 2020-07-27T09:16:16.239600Z

malli is using 52….

steveb8n 2020-07-27T09:16:30.240Z

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

steveb8n 2020-07-27T09:16:44.240200Z

sorry. wrong

steveb8n 2020-07-27T09:16:51.240400Z

repl starts but require fails

steveb8n 2020-07-27T09:17:08.240800Z

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

borkdude 2020-07-27T09:17:12.241Z

$ 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=&gt; (require 'borkdude.dynaload-clj)
nil
user=&gt;

borkdude 2020-07-27T09:17:18.241200Z

works fine over here

borkdude 2020-07-27T09:17:58.241400Z

doing this from a clean dir

steveb8n 2020-07-27T09:18:48.241600Z

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.

steveb8n 2020-07-27T09:19:03.242100Z

must be a deps boycott on Australia

ikitommi 2020-07-27T09:19:23.242400Z

working here now too :thinking_face:

ikitommi 2020-07-27T09:19:43.242800Z

checked out dynaload manually, started working after that.

borkdude 2020-07-27T09:19:54.243300Z

maybe it's a deps.edn bug?

steveb8n 2020-07-27T09:19:58.243400Z

yeah I could try that

steveb8n 2020-07-27T09:20:05.243600Z

explicit checkout locally

borkdude 2020-07-27T09:20:11.244Z

$ clojure -Sdescribe
{:version "1.10.1.536"

ikitommi 2020-07-27T09:20:13.244200Z

borkdude/dynaload {:git/url "<https://github.com/borkdude/dynaload.git>"
                           :sha "52f71bc2cb7389a932835fe02f185e3801f7e063"}

steveb8n 2020-07-27T09:21:08.244500Z

I’ve got 1.10.1.447

steveb8n 2020-07-27T09:21:32.244900Z

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

borkdude 2020-07-27T09:22:13.245500Z

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

1👍
steveb8n 2020-07-27T09:25:48.246200Z

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

steveb8n 2020-07-27T09:26:05.246500Z

still waiting on brew upgrade 🙂

steveb8n 2020-07-27T09:28:39.247100Z

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

steveb8n 2020-07-27T09:30:56.247600Z

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

steveb8n 2020-07-27T09:32:19.248100Z

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

steveb8n 2020-07-27T09:32:29.248400Z

trying Cursive ….

steveb8n 2020-07-27T09:34:31.248900Z

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

borkdude 2020-07-27T09:38:27.249300Z

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

steveb8n 2020-07-27T09:40:10.250400Z

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

steveb8n 2020-07-27T09:40:44.250900Z

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

steveb8n 2020-07-27T09:41:00.251300Z

thanks for the help team 🙏

2
ikitommi 2020-07-27T09:48:02.252300Z

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

borkdude 2020-07-27T09:57:51.252800Z

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

steveb8n 2020-07-27T09:58:24.253200Z

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

steveb8n 2020-07-27T09:58:56.253600Z

I’m now on 1.10.1.561

borkdude 2020-07-27T09:59:00.253700Z

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

borkdude 2020-07-27T09:59:17.254100Z

whereas steveb8n got a file not found related exception

steveb8n 2020-07-27T10:01:19.254700Z

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

steveb8n 2020-07-27T10:02:10.255200Z

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

steveb8n 2020-07-27T10:02:27.255600Z

although I then added vega lite and added another 200k