-
Notifications
You must be signed in to change notification settings - Fork 459
Fix: merge multiple identical opam pins on a local package #13232
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
base: main
Are you sure you want to change the base?
Conversation
e7c5163 to
1d609d2
Compare
| We pick the opam version here. | ||
| $ dune_pkg_lock_normalized | ||
| Solution for dune.lock: | ||
| - trouble.0.0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very dubious to me, especially since there is this comment in a related test:
| We try to use a project that has both opam files and a dune-project file. We | |
| should favor the dune metadata in such a case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is quite dubious. I would say if the versions disagree we should error and not pick sides, to be consistent with how it works when it is pinned twice via dune.
But this isn't introduced by this code, right? In such case it could be fixed in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed this wasn't introduced by this PR, it was already present behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it dubious? This is exactly what we do everywhere else. The opam pins are there for opam users presumably.
|
Usability note: the bug was discovered while trying to build irmin, and I can confirm that with this patch irmin builds correctly! |
|
The errors seem to be non deterministic? Perhaps you need to sort them? |
Leonidas-from-XIV
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the code is fine, the main question is whether that dubious behavior comes from this PR or not.
| We pick the opam version here. | ||
| $ dune_pkg_lock_normalized | ||
| Solution for dune.lock: | ||
| - trouble.0.0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is quite dubious. I would say if the versions disagree we should error and not pick sides, to be consistent with how it works when it is pinned twice via dune.
But this isn't introduced by this code, right? In such case it could be fixed in a separate PR.
| [1] | ||
|
|
||
| If instead of two opam pins or one each, we have two pins in dune-projects, | ||
| we hit the same problem as in override-single-workspace.t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is? It seems a bit odd to defer to another test, especially given the tests evolve separately.
1d609d2 to
8dea19a
Compare
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
8dea19a to
1a1d444
Compare
Fixes #12990
Commit 1 expands the test
Commit 2 fixes one bug, but there is remaining weirdness going on
Commit 3 is just what felt to me like a readibility improvement, completely optionaldeleted as not wanted