xsc / lein-ancient

Check your Projects for outdated Dependencies
MIT License
561 stars 33 forks source link

Slingshot missing on leiningen `2.8.1` #87

Closed philomates closed 6 years ago

philomates commented 6 years ago

Hi, I've upgraded to ancient-clj 0.6.14 in my project and am able to run it fine with leiningen 2.7.1.

When I upgrade to leiningen 2.8.1 I get the error pasted below.

If I remove the exclusion of slingshot here, then everything works fine. Shall I open a PR with that change, or is there a reason that such an exclusion is needed?

Thanks

clojure.lang.Compiler$CompilerException: java.io.FileNotFoundException: Could not locate slingshot/slingshot__init.class or slingshot/slingshot.clj on classpath., compiling:(clj_http/client.clj:1:1)
 at clojure.lang.Compiler.load (Compiler.java:7391)
    clojure.lang.RT.loadResourceScript (RT.java:372)
    clojure.lang.RT.loadResourceScript (RT.java:363)
    clojure.lang.RT.load (RT.java:453)
    clojure.lang.RT.load (RT.java:419)
    clojure.core$load$fn__5677.invoke (core.clj:5893)
    clojure.core$load.invokeStatic (core.clj:5892)
    clojure.core$load.doInvoke (core.clj:5876)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.core$load_one.invokeStatic (core.clj:5697)
    clojure.core$load_one.invoke (core.clj:5692)
    clojure.core$load_lib$fn__5626.invoke (core.clj:5737)
    clojure.core$load_lib.invokeStatic (core.clj:5736)
    clojure.core$load_lib.doInvoke (core.clj:5717)
    clojure.lang.RestFn.applyTo (RestFn.java:142)
    clojure.core$apply.invokeStatic (core.clj:648)
    clojure.core$load_libs.invokeStatic (core.clj:5774)
    clojure.core$load_libs.doInvoke (core.clj:5758)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:648)
    clojure.core$require.invokeStatic (core.clj:5796)
    clojure.core$require.doInvoke (core.clj:5796)
    clojure.lang.RestFn.invoke (RestFn.java:421)
    ancient_clj.io.http$eval3675$loading__5569__auto____3676.invoke (http.clj:1)
    ancient_clj.io.http$eval3675.invokeStatic (http.clj:1)
    ancient_clj.io.http$eval3675.invoke (http.clj:1)
   ...
    ancient_clj.io$eval3669$loading__5569__auto____3670.invoke (io.clj:1)
    ancient_clj.io$eval3669.invokeStatic (io.clj:1)
    ancient_clj.io$eval3669.invoke (io.clj:1)
   ...
    ancient_clj.core$eval2480$loading__5569__auto____2481.invoke (core.clj:1)
    ancient_clj.core$eval2480.invokeStatic (core.clj:1)
    ancient_clj.core$eval2480.invoke (core.clj:1)
    clojure.lang.Compiler.eval (Compiler.java:6927)
    clojure.lang.Compiler.eval (Compiler.java:6916)
    clojure.lang.Compiler.load (Compiler.java:7379)
    clojure.lang.RT.loadResourceScript (RT.java:372)
    clojure.lang.RT.loadResourceScript (RT.java:363)
    clojure.lang.RT.load (RT.java:453)
    clojure.lang.RT.load (RT.java:419)
    clojure.core$load$fn__5677.invoke (core.clj:5893)
    clojure.core$load.invokeStatic (core.clj:5892)
    clojure.core$load.doInvoke (core.clj:5876)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.core$load_one.invokeStatic (core.clj:5697)
    clojure.core$load_one.invoke (core.clj:5692)
    clojure.core$load_lib$fn__5626.invoke (core.clj:5737)
    clojure.core$load_lib.invokeStatic (core.clj:5736)
    clojure.core$load_lib.doInvoke (core.clj:5717)
    clojure.lang.RestFn.applyTo (RestFn.java:142)
    clojure.core$apply.invokeStatic (core.clj:648)
    clojure.core$load_libs.invokeStatic (core.clj:5774)
    clojure.core$load_libs.doInvoke (core.clj:5758)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:648)
    clojure.core$require.invokeStatic (core.clj:5796)
    clojure.core$require.doInvoke (core.clj:5796)
    clojure.lang.RestFn.invoke (RestFn.java:482)
xsc commented 6 years ago

@phillipm Thanks for reporting! Can you paste the output of lein deps :plugin-tree from the project that causes the above exception to be thrown?

The reason I'm asking is that, while ancient-clj excludes slingshot (it was an optional dependency for clj-http) lein-ancient does not, so for me the above command prints (using Leiningen 2.8.1 on Java 1.8.0_131 Java HotSpot(TM) 64-Bit Server VM):

 [lein-ancient "0.6.14"]
   [clj-http "3.7.0" :exclusions [[commons-codec] [org.apache.httpcomponents/httpcore]]]
     [commons-io "2.5" :exclusions [[org.clojure/clojure]]]
     [org.apache.httpcomponents/httpasyncclient "4.1.3" :exclusions [[org.clojure/clojure]]]
       [org.apache.httpcomponents/httpcore-nio "4.4.6"]
     [org.apache.httpcomponents/httpclient "4.5.3" :exclusions [[org.clojure/clojure]]]
       [commons-logging "1.2"]
     [org.apache.httpcomponents/httpmime "4.5.3" :exclusions [[org.clojure/clojure]]]
     [potemkin "0.4.3" :exclusions [[org.clojure/clojure]]]
       [clj-tuple "0.2.2"]
       [riddley "0.1.12"]
     [slingshot "0.12.2" :exclusions [[org.clojure/clojure]]]
   [com.amazonaws/aws-java-sdk-s3 "1.11.28" :exclusions [[joda-time] [commons-logging]]]
     [com.amazonaws/aws-java-sdk-core "1.11.28"]
       [com.fasterxml.jackson.core/jackson-databind "2.6.6"]
         [com.fasterxml.jackson.core/jackson-annotations "2.6.0"]
         [com.fasterxml.jackson.core/jackson-core "2.6.6"]
       [com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.6.6"]
     [com.amazonaws/aws-java-sdk-kms "1.11.28"]
     [com.amazonaws/jmespath-java "1.0"]
 [lein-license "0.1.7-SNAPSHOT"]
   [org.yaml/snakeyaml "1.17"]
   [rewrite-clj "0.5.0" :exclusions [[org.clojure/clojure]]]
     [org.clojure/tools.reader "0.10.0" :exclusions [[org.clojure/clojure]]]
 [lein-try "0.4.3"]

As you can see, slingshot is there.

philomates commented 6 years ago

I've pasted it below. Looking at the differences, aside from the fact that your dependency tree uses lein-ancient and mine ancient-clj, is the fact that the clj-http version is different. I tried updating ancient-clj to use clj-http 3.7.0 locally, and it fixed my issue with slingshot. Perhaps that is the way forward with this?

[lein-midje "3.2.1"]
 [...my-plugin-that-I'm-having-issues-with... "0.7.5-SNAPSHOT"]
   [ancient-clj "0.6.14"]
     [clj-http "2.1.0" :exclusions [[com.cognitect/transit-clj] [crouton] [org.apache.httpcomponents/httpclient] [slingshot]]]
       [commons-codec "1.10" :exclusions [[org.clojure/clojure]]]
       [commons-io "2.4" :exclusions [[org.clojure/clojure]]]
       [org.apache.httpcomponents/httpcore "4.4.4" :exclusions [[org.clojure/clojure]]]
       [org.apache.httpcomponents/httpmime "4.5.1" :exclusions [[org.clojure/clojure]]]
     [commons-logging "1.2"]
     [joda-time "2.9.2"]
     [org.clojure/data.xml "0.0.8"]
       [org.clojure/clojure "1.4.0"]
     [potemkin "0.4.3"]
       [clj-tuple "0.2.2"]
       [riddley "0.1.12"]
     [version-clj "0.1.2"]
 [s3-wagon-private "1.3.0" :exclusions [[commons-codec] [commons-logging]]]
   [com.amazonaws/aws-java-sdk-s3 "1.11.28" :exclusions [[com.fasterxml.jackson.core/jackson-core] [com.fasterxml.jackson.core/jackson-databind]]]
     [com.amazonaws/aws-java-sdk-core "1.11.28"]
       [com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.6.6"]
       [org.apache.httpcomponents/httpclient "4.5.2"]
     [com.amazonaws/aws-java-sdk-kms "1.11.28"]
     [com.amazonaws/jmespath-java "1.0"]
   [com.fasterxml.jackson.core/jackson-core "2.5.5"]
   [com.fasterxml.jackson.core/jackson-databind "2.5.5"]
     [com.fasterxml.jackson.core/jackson-annotations "2.5.0"]
   [org.springframework.build/aws-maven "4.8.0.RELEASE" :exclusions [[com.amazonaws/aws-java-sdk]]]
     [ch.qos.logback/logback-classic "1.0.12"]
       [ch.qos.logback/logback-core "1.0.12"]
     [org.slf4j/jcl-over-slf4j "1.7.5"]
     [org.slf4j/slf4j-api "1.7.5"]
 [venantius/ultra "0.5.1" :exclusions [[org.clojure/clojure]]]
   [grimradical/clj-semver "0.3.0" :exclusions [[org.clojure/clojure]]]
   [io.aviso/pretty "0.1.30"]
   [mvxcvi/puget "1.0.1"]
     [fipp "0.6.6"]
       [org.clojure/core.rrb-vector "0.0.11"]
     [mvxcvi/arrangement "1.1.0"]
   [mvxcvi/whidbey "1.3.0"]
     [org.clojure/data.codec "0.1.0"]
   [org.clojars.brenton/google-diff-match-patch "0.1"]
   [org.clojure/tools.nrepl "0.2.12"]
   [robert/hooke "1.3.0"]
   [venantius/glow "0.1.4" :exclusions [[hiccup] [garden]]]
     [clj-antlr "0.2.3"]
       [org.antlr/antlr4-runtime "4.5.3"]
       [org.antlr/antlr4 "4.5.3"]
     [instaparse "1.4.1"]
philomates commented 6 years ago

Actually, I spoke too soon. I accidentally used a local ancient-clj version where I removed the slingshot exclusion. Simply bumping clj-http while leaving in the exclusion doesn't fix this issue :(

xsc commented 6 years ago

Ah, I misread ancient-clj as lein-ancient. Sorry for that!

So, I think my mistake here is that I thought that slingshot was an optional dependency. The tests are passing because midje, the testing framework, actually depends on slingshot. This is a bug!

If you explicitly include [slingshot "0.12.2"] in your plugin's dependencies, it should work for now, I'll fix it in ancient-clj as quickly as possible.

bobbermac commented 6 years ago

A heads-up, in case this is useful: using 0.6.15 did not fix this issue for me -- I'm still getting the slingshot not found error when attempting to use the lein-ancient plugin with lein 2.8.1.

I tried the following (unsuccessfully) to solve this:

  1. Ran lein with-profile +test deps :tree and updated :exclusions and :dependencies until no more errors were displayed
  2. Explicitly added [slingshot "0.12.2"] in deps

Odd/unexpected things in addition to the continued failure of lein-ancient on lein 2.8.1:

Other useful info:

xsc commented 6 years ago

@bobbermac Thank you for providing that much information on your problem! Unfortunately, the best way for me to investigate this would still be a minimal complete project.clj that illustrates the issue. Could you provide one?

However, there is one thing I can already comment on. The stacktrace you provided contains:

at ancient.ancient_clj.v0v3v14.ancient_clj.io.http$eval2020$loading__5569__auto____2021.invoke(http.clj:1)
at ancient.ancient_clj.v0v3v14.ancient_clj.io.http$eval2020.invokeStatic(http.clj:1)
at ancient.ancient_clj.v0v3v14.ancient_clj.io.http$eval2020.invoke(http.clj:1)

This means you're calling a version of lein-ancient that used mranderson to inline [ancient-clj "0.3.14"]. The only version that did that was [lein-ancient "0.6.10"] (see f8b3a060), so it seems that you're not using the version of lein-ancient that you think you are.

bobbermac commented 6 years ago

Oh, wow -- good catch. Given the explicit versions in the project.clj, your observation indicates that there's something somewhere else overriding this ... and sure enough, I found an old profiles.clj file in my home dir.

Everything works like a charm, now -- thanks so much!