Git Product home page Git Product logo

Comments (5)

 avatar commented on May 24, 2024

Hi Dave,

Thanks for the report. I think :scope "provided" may be the more accurate way to specify the Clojure dependency, but I am curious as to what other circumstances caused this to be a problem.

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,
–S

from component.

daveyarwood avatar daveyarwood commented on May 24, 2024

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.

from component.

 avatar commented on May 24, 2024

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 :scope "provided" is probably the "correct" thing to do, but it does have a downside:

If a project depends on a version of Clojure earlier than 1.7, and it uses Component 0.3.0 or later, lein deps :tree will print a warning, and lein with :pedantic? :abort will abort.

If I change the dependency in Component to [org.clojure/clojure "1.7.0" :scope "provided"] then there is no warning, even with :pedantic?, but attempting to load the Component library will fail with a mysterious error:

Could not locate com/stuartsierra/component__init.class or com/stuartsierra/component.clj on classpath

So adding :scope "provided" removes the warning from Boot about overriding with a later version of Clojure, but potentially removes a warning about overriding with an incompatible, earlier version of Clojure.

Assuming that most Clojure users are already using 1.8 or later, I think it's an acceptable trade-off to add :scope "provided", so I will make the change.

from component.

daveyarwood avatar daveyarwood commented on May 24, 2024

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!

from component.

 avatar commented on May 24, 2024

This is the script I'm using to test, if anyone is curious https://gist.github.com/stuartsierra/7df465cdd4b0632b1e7a0627b7dff931

from component.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.