New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component includes org.clojure/clojure as a transitive dependency #65
Comments
Hi Dave, Thanks for the report. I think Since Component version 0.3.0, the minimum required Clojure version is 1.7.0, to support conditional read. If you try to use Component 0.3.0 or later in a project on Clojure 1.6.0 or earlier, it will fail to load. If your project has a declared or transitive dependency on any version of Clojure after 1.7.0, then most tools will silently upgrade to that later Clojure version. I can't come up with a scenario in which the declared dependency on Clojure 1.7.0 would transitively load the "wrong" version, but transitive dependencies have all sorts of edge cases, so I could have easily missed one. Thanks, |
I don't recall exactly how I ran across this a couple weeks ago, but IIRC, my build tool (Boot) did load the later Clojure version, which is good, but it also emitted a warning about how it would not load Clojure 1.7.0 because it had already loaded Clojure 1.9.0 or whatever version it was that my project specified. |
OK, I can reproduce equivalent behavior in Leiningen, although it doesn't print a warning when overriding with a later Clojure version. I still think If a project depends on a version of Clojure earlier than 1.7, and it uses Component 0.3.0 or later, If I change the dependency in Component to
So adding Assuming that most Clojure users are already using 1.8 or later, I think it's an acceptable trade-off to add |
That's an interesting find! It feels like maybe a bug in Boot (and I guess Leiningen?), or maybe pomegranate, the library that it's using to resolve dependencies. Thanks for looking into this! |
This is the script I'm using to test, if anyone is curious https://gist.github.com/stuartsierra/7df465cdd4b0632b1e7a0627b7dff931 |
This prevents a specific Clojure version from being loaded as a transitive dependency of this library. See also stuartsierra/component#65
To use a different version of Clojure in a project that uses component, one has to exclude
org.clojure/clojure
via:exclusions
as a workaround to avoid bringing in Clojure 1.9.0 as a transitive dependency.The fix for this is to specify
:scope "provided"
on theorg.clojure/clojure
dependency vector in project.clj.I have a fix for this here -- happy to open a PR if you'd like.
The text was updated successfully, but these errors were encountered: