Skip to content

Conversation

@ElectreAAS
Copy link
Collaborator

@ElectreAAS ElectreAAS commented Jan 7, 2026

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 optional deleted as not wanted

We pick the opam version here.
$ dune_pkg_lock_normalized
Solution for dune.lock:
- trouble.0.0.1
Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

Copy link
Collaborator Author

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

Copy link
Member

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.

@ElectreAAS
Copy link
Collaborator Author

Usability note: the bug was discovered while trying to build irmin, and I can confirm that with this patch irmin builds correctly!

@rgrinberg
Copy link
Member

The errors seem to be non deterministic? Perhaps you need to sort them?

Copy link
Collaborator

@Leonidas-from-XIV Leonidas-from-XIV left a 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
Copy link
Collaborator

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
Copy link
Collaborator

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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple pin-depends in opam files on a single local package fails

3 participants