Skip to content

Conversation

@gridbugs
Copy link
Collaborator

@gridbugs gridbugs commented Nov 5, 2025

Previously all expanded solver variables were omitted from lockdirs, as some solver variables are specific to the platform being solved for. This was too strict, and meant that non-platform-specific solver variables like "with-doc" were incorrectly omitted. This change adds non-platform-specific expanded solver variables to portable lockdirs.

@gridbugs gridbugs requested review from Alizter and art-w November 5, 2025 04:54
@gridbugs gridbugs marked this pull request as ready for review November 5, 2025 04:54
@gridbugs gridbugs force-pushed the portable-lockdirs-add-non-platform-specific-solver-variables branch 3 times, most recently from a124243 to d85eae5 Compare November 7, 2025 01:09
@gridbugs gridbugs requested a review from shonfeder November 7, 2025 01:09
@rgrinberg
Copy link
Member

A general comment that is related to this PR but isn't necessarily directly applicable: the code base needs to move away from distinguishing portable from non portable lock directories. What I mean by that is:

  • A lock directory can contain more than one configuration.
  • The lock directory's format is optimized for multiple configurations that share dependencies.

Given those, the current definitions are just:

  • A portable lock directory is a lock directory with more than one configuration
  • A non portable lock directory is just a lock with a single configuration that matches the user's environment.

In practice, I think this means that we should not be having flags as portable_lock_dir and should be passing some value that reflects the configurations the lock dir should contain.

@gridbugs gridbugs closed this Nov 10, 2025
@gridbugs
Copy link
Collaborator Author

Oops didn't mean to close this!

@gridbugs gridbugs reopened this Nov 10, 2025
-> repos:Opam_repo.t list option
-> expanded_solver_variable_bindings:Solver_stats.Expanded_variable_bindings.t
-> solved_for_platform:Solver_env.t option
(* TODO: make this non-optional when portable lockdirs becomes the default *)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
(* TODO: make this non-optional when portable lockdirs becomes the default *)
(* TODO: make this ^^^ non-optional when portable lockdirs becomes the default *)

otherwise the comment is a bit confusing

Previously all expanded solver variables were omitted from lockdirs, as
some solver variables are specific to the platform being solved for.
This was too strict, and meant that non-platform-specific solver
variables like "with-doc" were incorrectly omitted. This change adds
non-platform-specific expanded solver variables to portable lockdirs.

Signed-off-by: Stephen Sherratt <[email protected]>
@gridbugs gridbugs force-pushed the portable-lockdirs-add-non-platform-specific-solver-variables branch from d85eae5 to 6d24064 Compare November 11, 2025 01:03
@gridbugs gridbugs merged commit 21c3e94 into ocaml:main Nov 11, 2025
25 checks passed
@gridbugs gridbugs deleted the portable-lockdirs-add-non-platform-specific-solver-variables branch November 11, 2025 01:49
Sudha247 pushed a commit to Sudha247/dune that referenced this pull request Nov 14, 2025
…#12678)

Previously all expanded solver variables were omitted from lockdirs, as
some solver variables are specific to the platform being solved for.
This was too strict, and meant that non-platform-specific solver
variables like "with-doc" were incorrectly omitted. This change adds
non-platform-specific expanded solver variables to portable lockdirs.

Signed-off-by: Stephen Sherratt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants