Skip to content

fix(pkg): evaluate local dependency formulas the way the solver does - #15618

Merged
Alizter merged 1 commit into
ocaml:mainfrom
Alizter:push-wsmwprqlrxyp
Jul 31, 2026
Merged

Alizter merged 1 commit into
ocaml:mainfrom
Alizter:push-wsmwprqlrxyp

Conversation

@Alizter

@Alizter Alizter commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Description

Factor local-package dependency-formula evaluation into Lock_pkg.local_package_dependencies and use it from both the solver and Package_universe.

The shared path binds the local package name and version as self variables, injects the running Dune version, and removes the Dune pseudo-package from the concrete dependency list. This keeps validation aligned with lock solving and fixes both self-referencing version constraints and direct dependencies on Dune.

Related Issue and Motivation

Depends on #15617, which adds the self-referencing constraint regression test. This PR is stacked on that change and remains a draft while the predecessor is under review.

Checklist

@Alizter
Alizter force-pushed the push-wsmwprqlrxyp branch 2 times, most recently from 87fb9c8 to 99177b7 Compare July 29, 2026 12:36
@Alizter
Alizter marked this pull request as ready for review July 29, 2026 12:36
@Alizter
Alizter requested a review from punchagan July 29, 2026 12:37
@Alizter
Alizter force-pushed the push-wsmwprqlrxyp branch 2 times, most recently from 59a8574 to cbe1106 Compare July 29, 2026 12:46
Comment thread src/dune_pkg/lock_pkg.mli Resolved
@Alizter
Alizter force-pushed the push-wsmwprqlrxyp branch from cbe1106 to 72f9eba Compare July 30, 2026 14:22
Factor the solver's local-package dependency-formula evaluation (self
bindings, running Dune version injection, and stripping of the Dune
pseudo-package) into a single shared helper
Lock_pkg.local_package_dependencies, used by both the solver and
Package_universe so the two can no longer drift.

This fixes Package_universe reporting a freshly generated lockdir as
having no solution for a local package that depends directly on dune,
and validation silently dropping version constraints that refer to the
depending package's own version instead of binding it.

Signed-off-by: Ali Caglayan <[email protected]>
@Alizter
Alizter force-pushed the push-wsmwprqlrxyp branch from 72f9eba to c08fe07 Compare July 31, 2026 13:47
@Alizter
Alizter merged commit ba634e0 into ocaml:main Jul 31, 2026
35 of 36 checks passed
@Alizter
Alizter deleted the push-wsmwprqlrxyp branch July 31, 2026 13:59
@Alizter Alizter added this to the 3.25.0 milestone Aug 1, 2026
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.

2 participants