Skip to content

test(pkg): validate-lockdir on a direct dune dependency - #15616

Merged
Alizter merged 1 commit into
ocaml:mainfrom
Alizter:push-wvvswkpwwypm
Jul 29, 2026
Merged

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

Conversation

@Alizter

@Alizter Alizter commented Jul 29, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Add a regression test showing that dune pkg validate-lockdir rejects a freshly generated lock directory when a local workspace package depends directly on Dune. The solver injects the running Dune version and omits it from the lock directory, while validation currently resolves the dependency formula without that injection.

Related Issue and Motivation

This captures the validation mismatch.

Checklist

  • Tests added, if applicable.
  • Change log entry added for any user-facing changes. (Not applicable: test-only change.)
  • Documentation added for any user-facing changes. (Not applicable: test-only change.)

The solver evaluates local dependency formulas with the running version
of dune injected and strips dune from the solution, so a local package
with a direct dependency on dune locks to an empty lockdir. Validation
resolves the same formula without injecting dune and reports the
freshly generated lockdir as having no solution, with a regenerate hint
that cannot help.

Signed-off-by: Ali Caglayan <[email protected]>
@Alizter Alizter added no changelog package management Dune's package management — `(pkg)` stanza, lockdirs, `dune pkg` commands labels Jul 29, 2026
@Alizter
Alizter requested review from Copilot and punchagan July 29, 2026 10:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a blackbox regression test for dune pkg validate-lockdir that demonstrates the current mismatch when a local (workspace) package depends directly on dune: the lockdir solver implicitly injects the running Dune version (so it doesn’t appear in the lockdir), but validate-lockdir re-checks the dependency formula without that injection and rejects the freshly generated lockdir.

Changes:

  • Extend the existing validate-lockdir blackbox test to create a local package that directly depends on dune.
  • Assert that dune pkg lock produces a lockdir with no locked dependencies in this case.
  • Assert that dune pkg validate-lockdir then fails with “Package "dune" is missing”, capturing the regression.

@punchagan punchagan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice catch! Looks good to me.

@Alizter
Alizter merged commit 0fbdfb8 into ocaml:main Jul 29, 2026
37 of 40 checks passed
@Alizter
Alizter deleted the push-wvvswkpwwypm branch July 29, 2026 10:35
@Alizter Alizter added this to the 3.25.0 milestone Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog package management Dune's package management — `(pkg)` stanza, lockdirs, `dune pkg` commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants