Skip to content
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

dependency resolution issue after lein2 clean #8

Closed
ccfontes opened this issue Aug 26, 2012 · 5 comments
Closed

dependency resolution issue after lein2 clean #8

ccfontes opened this issue Aug 26, 2012 · 5 comments

Comments

@ccfontes
Copy link

replication: with lein2 and after doing lein2 clean, then lein2 run and it outputs:
Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate ring/middleware/head__init.class or ring/middleware/head.clj on classpath:

suggestion: drawbridge needs its dependency "ring-core" updated to at least "1.1.0".

@cemerick
Copy link
Collaborator

Except that drawbridge doesn't require 1.1.0. I suspect you are aiming to use some version of ring >= to that, but drawbridge's lower dependency is (unfortunately) overriding it.

This same problem will occur when using any library that doesn't require a newer version of ring, because ring itself only specifies a "soft" version number dependency on ring-core. If that were changed to e.g. [ring/ring-core "[1.1.0,)"] (meaning, that ring v1.1.0 requires 1.1.0 or higher of ring-core), then drawbridge's lower version dependency would not countermand that.

Maybe this is something @weavejester would consider for future releases?

@weavejester
Copy link

I tend to steer clear of version ranges for these reasons.

@cemerick
Copy link
Collaborator

Like most "X considered harmful" sorts of posts, some subtleties and certain circumstances that are glossed over. Version ranges are sometimes indispensable.

@ccfontes I would suggest changing your ring dependency(ies) to a version that sets 1.1.0 as a hard lower bound, instead of the "soft" version number I presume you have set currently.

@weavejester
Copy link

There may be rare circumstances where version ranges are useful, but in general I find they're more trouble than they're worth. For example, if [ring "1.1.0"] had a dependency of [ring/ring.core "[1.1.0,)"], then it would depend on the latest snapshot of Ring, which might be incompatible with 1.1.0 (e.g. a hypothetical [ring/ring.core "2.0.0-SNAPSHOT"])

In general it's best to stick with soft version numbers, and to remember that the closer dependencies take priority over the latter ones. This can cause problems, but they can be resolved by specifying explicit dependencies in your project file. Problems with version ranges, particularly hard ones, are not so easily to resolve.

@cemerick
Copy link
Collaborator

Using [com.cemerick/drawbridge "$VERSION" :exclusions [ring/ring-core]] will have to be the "official" workaround until something can be done to smooth this general problem over in Leiningen (see cemerick/friend#15 for another example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants