benedekfazekas / mranderson

Dependency inlining and shadowing
Eclipse Public License 1.0
151 stars 14 forks source link

`move-ns-file`: `core.cljs` not found #90

Closed kimo-k closed 1 year ago

kimo-k commented 1 year ago

Hey there,

Re-frame-10x invokes MrAnderson from a shell script. Running this script on the latest release, it fails with a FileNotFoundException.

Mr. Anderson tries to access core.cljs, which isn't there. It does exist in the library repo, though.

$ ./source-deps.sh 
project prefix:  day8.re-frame-10x.inlined-deps
retrieve dependencies and munge clojure source files
in RESOLVED-TREE mode, working on a resolved dependency tree
 [garden "1.3.10" :exclusions [[com.yahoo.platform.yui/yuicompressor]]]
 [net.dhleong/spade "1.1.0" :exclusions [[org.clojure/clojure] [org.clojure/clojurescript] [garden]]]
 [re-frame "1.1.2" :exclusions [[reagent] [net.cgrand/macrovich] [org.clojure/tools.logging]]]
 [reagent "1.0.0" :exclusions [[cljsjs/react] [cljsjs/react-dom] [cljsjs/react-dom-server]]]
unzipping [ re-frame  [ v1v1v2 ]]
unzipping [ spade  [ v1v1v0 ]]
unzipping [ garden  [ v1v3v10 ]]
unzipping [ reagent  [ v1v0v0 ]]
  munge source files of reagent artifact on branch [] exposed false.
  munge source files of garden artifact on branch [] exposed false.
  munge source files of spade artifact on branch [] exposed false.
Error encountered performing task 'do' with profile(s): 'mranderson'
java.io.FileNotFoundException: target/srcdeps/day8/re_frame_10x/inlined_deps/spade/v1v1v0/spade/core.cljs (No such file or directory)
        at java.base/java.io.FileInputStream.open0(Native Method)
        at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
        at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
        at clojure.java.io$fn__11546.invokeStatic(io.clj:354)
        at clojure.java.io$fn__11546.invoke(io.clj:354)
        at clojure.lang.MultiFn.invoke(MultiFn.java:239)
        at clojure.java.io$copy.invokeStatic(io.clj:406)
        at clojure.java.io$copy.doInvoke(io.clj:391)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at mranderson.move$move_ns_file.invokeStatic(move.clj:278)
        at mranderson.move$move_ns_file.invoke(move.clj:267)
        at mranderson.move$move_ns.invokeStatic(move.clj:309)
        at mranderson.move$move_ns.invoke(move.clj:297)
        at mranderson.core$update_artifact_BANG_.invokeStatic(core.clj:227)
        at mranderson.core$update_artifact_BANG_.invoke(core.clj:196)
        at mranderson.dependency.tree$walk_ordered_deps$fn__2353$fn__2358.invoke(tree.clj:83)
        at clojure.core$map$fn__5866.invoke(core.clj:2755)
        at clojure.lang.LazySeq.sval(LazySeq.java:42)
        at clojure.lang.LazySeq.seq(LazySeq.java:51)
        at clojure.lang.Cons.next(Cons.java:39)
        at clojure.lang.RT.next(RT.java:713)
        at clojure.core$next__5386.invokeStatic(core.clj:64)
        at clojure.core$dorun.invokeStatic(core.clj:3142)
        at clojure.core$dorun.invoke(core.clj:3133)
        at mranderson.dependency.tree$walk_ordered_deps$fn__2353.invoke(tree.clj:83)
        at mranderson.dependency.tree$walk_ordered_deps.invokeStatic(tree.clj:82)
        at mranderson.dependency.tree$walk_ordered_deps.invoke(tree.clj:73)
        at mranderson.core$mranderson_resolved_deps_BANG_.invokeStatic(core.clj:321)
        at mranderson.core$mranderson_resolved_deps_BANG_.invoke(core.clj:302)
        at mranderson.core$mranderson.invokeStatic(core.clj:352)
        at mranderson.core$mranderson.invoke(core.clj:328)
        at leiningen.inline_deps$inline_deps.invokeStatic(inline_deps.clj:62)
        at leiningen.inline_deps$inline_deps.doInvoke(inline_deps.clj:49)
        at clojure.lang.RestFn.invoke(RestFn.java:410)
        at clojure.lang.AFn.applyToHelper(AFn.java:154)
        at clojure.lang.RestFn.applyTo(RestFn.java:132)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.core$apply.invokeStatic(core.clj:667)
        at clojure.core$apply.invoke(core.clj:660)
        at leiningen.core.main$partial_task$fn__6931.doInvoke(main.clj:284)
        at clojure.lang.RestFn.invoke(RestFn.java:410)
        at clojure.lang.AFn.applyToHelper(AFn.java:154)
        at clojure.lang.RestFn.applyTo(RestFn.java:132)
        at clojure.lang.AFunction$1.doInvoke(AFunction.java:31)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.core$apply.invokeStatic(core.clj:667)
        at clojure.core$apply.invoke(core.clj:660)
        at leiningen.core.main$apply_task.invokeStatic(main.clj:334)
        at leiningen.core.main$apply_task.invoke(main.clj:320)
        at leiningen.core.main$resolve_and_apply.invokeStatic(main.clj:343)
        at leiningen.core.main$resolve_and_apply.invoke(main.clj:336)
        at leiningen.do$do.invokeStatic(do.clj:40)
        at leiningen.do$do.doInvoke(do.clj:32)
        at clojure.lang.RestFn.applyTo(RestFn.java:139)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.core$apply.invokeStatic(core.clj:667)
        at clojure.core$apply.invoke(core.clj:660)
        at leiningen.core.main$partial_task$fn__6931.doInvoke(main.clj:284)
        at clojure.lang.RestFn.applyTo(RestFn.java:139)
        at clojure.lang.AFunction$1.doInvoke(AFunction.java:31)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.core$apply.invokeStatic(core.clj:667)
        at clojure.core$apply.invoke(core.clj:660)
        at leiningen.core.main$apply_task.invokeStatic(main.clj:334)
        at leiningen.core.main$apply_task.invoke(main.clj:320)
        at leiningen.with_profile$with_profiles_STAR_.invokeStatic(with_profile.clj:14)
        at leiningen.with_profile$with_profiles_STAR_.invoke(with_profile.clj:8)
        at leiningen.with_profile$apply_task_with_profiles.invokeStatic(with_profile.clj:53)
        at leiningen.with_profile$apply_task_with_profiles.invoke(with_profile.clj:45)
        at leiningen.with_profile$with_profile$fn__10821.invoke(with_profile.clj:85)
        at clojure.core$mapv$fn__8445.invoke(core.clj:6912)
        at clojure.core.protocols$fn__8159.invokeStatic(protocols.clj:168)
        at clojure.core.protocols$fn__8159.invoke(protocols.clj:124)
        at clojure.core.protocols$fn__8114$G__8109__8123.invoke(protocols.clj:19)
        at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
        at clojure.core.protocols$fn__8146.invokeStatic(protocols.clj:75)
        at clojure.core.protocols$fn__8146.invoke(protocols.clj:75)
        at clojure.core.protocols$fn__8088$G__8083__8101.invoke(protocols.clj:13)
        at clojure.core$reduce.invokeStatic(core.clj:6828)
        at clojure.core$mapv.invokeStatic(core.clj:6903)
        at clojure.core$mapv.invoke(core.clj:6903)
        at leiningen.with_profile$with_profile.invokeStatic(with_profile.clj:85)
        at leiningen.with_profile$with_profile.doInvoke(with_profile.clj:63)
        at clojure.lang.RestFn.applyTo(RestFn.java:146)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.core$apply.invokeStatic(core.clj:667)
        at clojure.core$apply.invoke(core.clj:660)
        at leiningen.core.main$partial_task$fn__6931.doInvoke(main.clj:284)
        at clojure.lang.RestFn.applyTo(RestFn.java:139)
        at clojure.lang.AFunction$1.doInvoke(AFunction.java:31)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.core$apply.invokeStatic(core.clj:667)
        at clojure.core$apply.invoke(core.clj:660)
        at leiningen.core.main$apply_task.invokeStatic(main.clj:334)
        at leiningen.core.main$apply_task.invoke(main.clj:320)
        at leiningen.core.main$resolve_and_apply.invokeStatic(main.clj:343)
        at leiningen.core.main$resolve_and_apply.invoke(main.clj:336)
        at leiningen.core.main$_main$fn__7020.invoke(main.clj:452)
        at leiningen.core.main$_main.invokeStatic(main.clj:442)
        at leiningen.core.main$_main.doInvoke(main.clj:439)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.core$apply.invokeStatic(core.clj:665)
        at clojure.main$main_opt.invokeStatic(main.clj:514)
        at clojure.main$main_opt.invoke(main.clj:510)
        at clojure.main$main.invokeStatic(main.clj:664)
        at clojure.main$main.doInvoke(main.clj:616)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.main.main(main.java:40)
$ ls target/srcdeps/day8/re_frame_10x/inlined_deps/spade/v1v1v0/spade/
core.cljc  util.cljc

{...
  :profiles {:dev        {:dependencies [[binaryage/dirac "RELEASE"]
                                         [metosin/malli   "0.5.1"]
                                         [clj-kondo       "RELEASE"]]
                          :plugins      [[com.github.liquidz/antq "RELEASE"]
                                         [thomasa/mranderson      "0.5.3"]
                                         [lein-count              "1.0.9"]
                                         [lein-pprint             "1.3.2"]]
                          :antq         {}
                          :aliases      {"lint" ["run" "-m" "clj-kondo.main"
                                                 "--lint"
                                                 "src"  ; ~#(clojure.string/join ";" (leiningen.core.classpath/get-classpath %))
                                                 "--config"
                                                 ".clj-kondo/config.edn"
                                                 "--parallel"
                                                 "--copy-configs"]}}
             :mranderson {:mranderson {:project-prefix "day8.re-frame-10x.inlined-deps"}
                          :dependencies ^:replace [^:source-dep [re-frame "1.1.2"
                                                                 :exclusions [reagent
                                                                              net.cgrand/macrovich
                                                                              org.clojure/tools.logging]]
                                                   ^:source-dep [reagent "1.0.0"
                                                                 :exclusions [cljsjs/react
                                                                              cljsjs/react-dom
                                                                              cljsjs/react-dom-server]]
                                                   ; We need a source-dep on Garden, as there are breaking changes between
                                                   ; versions, and consuming projects can override this version of Garden.
                                                   ^:source-dep [garden "1.3.10"
                                                                 :exclusions [com.yahoo.platform.yui/yuicompressor]]
                                                   ^:source-dep [net.dhleong/spade "1.1.0"
                                                                 :exclusions [org.clojure/clojure
                                                                              org.clojure/clojurescript
                                                                              garden]]]}}
benedekfazekas commented 1 year ago

hi @kimo-k,

thanks for filling the issue. Can you try the latest snapshot "0.5.4-SNAPSHOT" and let me know if that fixes it.

kimo-k commented 1 year ago

Yep, same issue on "0.5.4-SNAPSHOT".

benedekfazekas commented 1 year ago

maybe i can mitigate with publishing a newer snapshot -- have the faint memory that something like this got already fixed lately --, but let me try and test with the above project locally. will get back to you in a few days tops.

benedekfazekas commented 1 year ago

had a quick look, unfortunately this is not fixed by latest snapshot. #72 seems to be related maybe but I will need to dig into this further. will keep you updated

benedekfazekas commented 1 year ago

will look into putting a new snapshot onto clojars. if you want to test beforhand, just checkout mranderson and run make install and use 0.5.4-SNAPSHOT

benedekfazekas commented 1 year ago

ignore previous, latest snapshot is on clojars

kimo-k commented 1 year ago

It works now, thanks!