boot-clj / boot

Build tooling for Clojure.
https://boot-clj.github.io/
Eclipse Public License 1.0
1.75k stars 180 forks source link

Command line --checkouts option fails with NPE #636

Open martinklepsch opened 7 years ago

martinklepsch commented 7 years ago

Providing the checkouts option on the command line currently throws an exception:

boot --dependencies clojure.java-time:0.3.0 --checkouts clojure.java-time:0.3.0 repl
java.lang.NullPointerException
    at boot.main$dep_ns_decls.invoke(main.clj:52)
    at boot.main$export_task_namespaces$fn__1667.invoke(main.clj:65)
    at clojure.core$map$fn__4785.invoke(core.clj:2644)
    at clojure.lang.LazySeq.sval(LazySeq.java:40)
    at clojure.lang.LazySeq.seq(LazySeq.java:49)
    at clojure.lang.RT.seq(RT.java:521)
    at clojure.core$seq__4357.invokeStatic(core.clj:137)
    at clojure.core$apply.invokeStatic(core.clj:641)
    at clojure.core$mapcat.invokeStatic(core.clj:2674)
    at clojure.core$mapcat.doInvoke(core.clj:2674)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at boot.main$export_task_namespaces.invoke(main.clj:67)
    at boot.main$_main.invoke(main.clj:179)
    at clojure.lang.Var.invoke(Var.java:394)
    at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke(ClojureRuntimeShimImpl.java:159)
    at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke(ClojureRuntimeShimImpl.java:150)
    at boot.App.runBoot(App.java:399)
    at boot.App.main(App.java:488)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at Boot.main(Boot.java:258)
slava92 commented 5 years ago

It seems the issue is due the --dependencies and --checkouts referring to the same artifact. As a result, (pod/resolve-dependency-jar ...) returns nil for that dependency when it takes out :checkouts out of :dependencies under the hood. My guess is that :dependencies and :checkouts are mutually exclusive. When I tried to implement removal of :checkouts out of :dependencies, boot appears to be working fine. My patch is at /boot/core/src/boot/main.clj I might be wrong though about two list being mutually exclusive. Please take a look. Slava