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

Add warning when checkouts contain project versions not matching declared dependencies #686

Open
hugoduncan opened this issue Jul 16, 2012 · 6 comments

Comments

@hugoduncan
Copy link
Contributor

When working with checkouts that are symlinks, it is very easy to checkout out a branch in your sub-project's canonical directory, or otherwise modify it, and forget that the sub-project is symlinked. This can lead to a top level project misbehaving for non-obvious reasons.

Please add a warning when a subproject in checkouts contains a project.clj file with a version different to that listed in the top level project's :dependencies.

@scgilardi
Copy link
Collaborator

I ran into a case where I had forgotten about some checkouts and then saw odd behavior and didn't put the two together. Phil and I discussed it some. A warning would have been very helpful.

I support Hugo's request above.

Perhaps an additional situation should trigger a warning:

  • warn if there exists an available release version (non-snapshot) identical to the version specified in the checkout's project.clj.

This covers the case where I've checked out a dep, put it in the checkouts dir, made some tweaks to its code, but haven't bothered to update the main project's :dependencies or the dep's project.clj.

Warning: using my.great.lib version 2.0.4 from checkouts/my-great-lib, not the released version.

@j-po
Copy link

j-po commented Feb 28, 2016

Gonna give it a shot. This'll be my first open-source Clojure work, though (I use it at work).

@hypirion
Copy link
Collaborator

@j-po: thanks for looking into this!

If there's anything you wonder about, want to be reviewed or similar, feel free to ask in this issue – or me directly if you prefer that.

j-po pushed a commit to j-po/leiningen that referenced this issue Mar 7, 2016
@firesofmay
Copy link

Is this already done? I can see a commit but this issue is still open.

@j-po
Copy link

j-po commented Jun 27, 2016

It's not yet, sorry. My life got complicated and I haven't gotten s chance
to finish it.

On Sun, Jun 26, 2016, 20:53 Mayank Jain notifications@github.com wrote:

Is this already done? I can see a commit but this issue is still open.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#686 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ADgeZuxgZ-fR59K14o0Szd1KtpVah_kLks5qP0k_gaJpZM4AEgdR
.

brstf pushed a commit to brstf/leiningen that referenced this issue Sep 6, 2017
…on not matching parent project's dependency version, and a checkout-project version overriding a release version, fixes (technomancy#686)
@brstf
Copy link

brstf commented Sep 6, 2017

@j-po Would you mind if I fixed this issue? I took a look at it as an entry point to learning the leiningen code base and have a working solution ready for review.

@hypirion If so, I've committed my changes, but I have a few questions about the implementation / wouldn't mind a review. My primary concern is for the second warning case:

  • warn if there exists an available release version (non-snapshot) identical to the version specified in the checkout's project.clj.

I implemented this by calling aether/resolve-artifacts* for each checkout project to check if there is an available release that matches the declared version. However, I don't like that this is doing a request for each checkout project individually, but if I try all at once and any project isn't found in the remote repositories, an ArtifactResolutionException is thrown and I may mess correctly printing a warning.

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

No branches or pull requests

6 participants