Skip to content

opam install . --deps-only comply with the real constraints of packages#6530

Merged
rjbou merged 2 commits intoocaml:masterfrom
rjbou:clean-universe-from-simulated-pin
Jun 5, 2025
Merged

opam install . --deps-only comply with the real constraints of packages#6530
rjbou merged 2 commits intoocaml:masterfrom
rjbou:clean-universe-from-simulated-pin

Conversation

@rjbou
Copy link
Copy Markdown
Collaborator

@rjbou rjbou commented Jun 4, 2025

When a package pkg is already installed and opam install ./pkg --deps is called, if there is a conflict between installed pkg dependencies and local pkg declaration, the conflict is not seen and the already installed pkg is kept.

For the code itself, the universe given to the solver was retrieving information from the simulated switch state, so the simulated pinned package information, not the good opam definition. We keep then the old information in the switch state, like that we can rearrange the package set given to the solver when creating the universe.

Fix #6529

of removed system dependencies. Only packages which are unavailable end up
in this set, they are otherwise put in {!field:reinstall}. *)

overwrote_opams: (bool * OpamFile.OPAM.t) package_map;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last commit can be removed if we merge #6531 before. To be squashed otherwise

@kit-ty-kate kit-ty-kate added this to the 2.4.0~alpha3 milestone Jun 4, 2025
@rjbou rjbou force-pushed the clean-universe-from-simulated-pin branch from 0294522 to 46c4cea Compare June 4, 2025 19:48
Copy link
Copy Markdown
Member

@kit-ty-kate kit-ty-kate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested beautifully together with #6522, #6520, #6533

rjbou added 2 commits June 5, 2025 14:07
- reinstall trigger for pin
- reinstall trigger for simulated pin (deps-only)
- fetch process for simulated pin (deps-only)
@kit-ty-kate
Copy link
Copy Markdown
Member

As a side note the same problem also exist elsewhere, such as the build steps, but this new field will make fixing that issue very easy. See #6535

@rjbou rjbou merged commit 1aa02c9 into ocaml:master Jun 5, 2025
44 checks passed
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.

opam install . --deps-only do not comply with packages constraints

2 participants