Skip to content

fix(pkg): attribute cross-platform version conflicts to their platforms - #15988

Closed
Alizter wants to merge 7 commits into
ocaml:mainfrom
Alizter:push-vowwpzlnykxs
Closed

Alizter wants to merge 7 commits into
ocaml:mainfrom
Alizter:push-vowwpzlnykxs

Conversation

@Alizter

@Alizter Alizter commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #15987. Only the final commit is new in this draft.

Summary

  • Attribute version-conflict components whenever a package has any selected platform implementation.
  • Preserve the failing platform side instead of collapsing it into one platform-less component.
  • Include the regression test in the fixing commit so every stack commit remains green.

Tests

  • dune runtest test/blackbox-tests/test-cases/pkg/portable-lockdirs/portable-lockdirs-platform-dependant-version.t
  • dune build @fmt @check

@Alizter Alizter added the package management Dune's package management — `(pkg)` stanza, lockdirs, `dune pkg` commands label Aug 17, 2026
@Alizter
Alizter force-pushed the push-vowwpzlnykxs branch 4 times, most recently from c29590f to b1a572e Compare August 17, 2026 11:50
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Build one solver universe containing every requested platform and invoke SAT once instead of solving each platform independently. Platform-aware roles, availability checks, conflict classes, and result extraction preserve which platforms selected each package while diagnostics are deduplicated by package.

Constrain the platform roles for each package to select the same version. This lets SAT choose an older common version when necessary and makes the joint solve fail when no version supports every requested platform. The cross-platform version-equality encoding follows @art-w's proposal in ocaml#13647.

Generate conditional lock-file data directly from the result and remove the per-platform result-merging APIs.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
When a package was selected on one platform but unavailable on another, the failure diagnostics treated the selected package name as globally satisfied and dropped the unavailable platform's component. Track selections per platform when classifying diagnostic roles so every failing platform is reported.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Portable autolock failures bypass the command-line lock handler that normally adds the solve_for_platforms hint. Expose the hint with the solver failure and attach it in the autolock path as well, so both explicit and automatic locking explain how to request a smaller platform set.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Duplicate solve_for_platforms entries created duplicate platform roles and repeated conditional metadata. Deduplicate platform overlays before constructing the joint solve while preserving the user's first-occurrence order.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter
Alizter force-pushed the push-vowwpzlnykxs branch from b1a572e to 943c4fd Compare August 17, 2026 14:08
Use the conditional lock-file representation for every newly generated lock directory and remove the portable-lock-dir feature flag and split code paths.

Keep old lock directories readable: bare atom-form dependency fields decode as all-platform dependencies, and legacy bare build/install actions continue to run on every platform.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
A package selected on some platforms can still have no solution on others,
and a cross-platform version conflict shows up as a note on an otherwise
satisfied selection. The diagnostics only attributed problems for packages
in good_names (selected with no notes), so the failing side of a version
conflict was deduplicated away and the report showed a single platform-less
component for the satisfied side. Base the attribution on whether the
package has a selected implementation on any platform instead.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter
Alizter force-pushed the push-vowwpzlnykxs branch from 943c4fd to 2dd7426 Compare August 17, 2026 14:13
@Alizter Alizter closed this Aug 17, 2026
@Alizter
Alizter deleted the push-vowwpzlnykxs branch August 22, 2026 18:20
@Alizter
Alizter restored the push-vowwpzlnykxs branch August 22, 2026 18:21
@Alizter
Alizter deleted the push-vowwpzlnykxs branch August 23, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

1 participant