leiningen
leiningen copied to clipboard
Add warning when checkouts contain project versions not matching declared dependencies
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.
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.
Gonna give it a shot. This'll be my first open-source Clojure work, though (I use it at work).
@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.
Is this already done? I can see a commit but this issue is still open.
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 [email protected] 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 https://github.com/technomancy/leiningen/issues/686#issuecomment-228649028, or mute the thread https://github.com/notifications/unsubscribe/ADgeZuxgZ-fR59K14o0Szd1KtpVah_kLks5qP0k_gaJpZM4AEgdR .
@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.