Skip to content

Conversation

@gridbugs
Copy link
Collaborator

The message that prints after solving lists each package in the solution. When a solution is portable, it's possible (though hopefully rare) that the version of a package included in a solution will be different depending on the platform. This led to multiple versions of the same package appearing in the message for non-obvious reasons, which some found confusing.

This commit changes the message when portable lockdirs are enabled, such that the packages common to all platforms are printed together, and each set of platform-specific dependencies is printetd separately from the common dependencies.

@gridbugs
Copy link
Collaborator Author

Related to #11868

@gridbugs
Copy link
Collaborator Author

Here's an example of the message printed after solving:

$ dune pkg lock
Solution for dune.lock

This solution is supports the following platforms:
- arch = arm64; os = linux
- arch = arm64; os = macos
- arch = arm64; os = win32
- arch = x86_64; os = linux
- arch = x86_64; os = macos
- arch = x86_64; os = win32

Dependencies on all supported platforms:
- base.v0.17.3
- base-unix.base
- csexp.1.5.2
- dune-configurator.3.20.2
- jane-street-headers.v0.17.0
- jst-config.v0.17.0
- ocaml.5.3.0
- ocaml-base-compiler.5.3.0
- ocaml-compiler.5.3.0
- ocaml-compiler-libs.v0.17.0
- ocaml-config.3
- ocaml_intrinsics_kernel.v0.17.1
- ppx_assert.v0.17.0
- ppx_base.v0.17.0
- ppx_cold.v0.17.0
- ppx_compare.v0.17.0
- ppx_derivers.1.2.1
- ppx_enumerate.v0.17.0
- ppx_expect.v0.17.3
- ppx_globalize.v0.17.2
- ppx_hash.v0.17.0
- ppx_here.v0.17.0
- ppx_inline_test.v0.17.1
- ppx_optcomp.v0.17.1
- ppx_sexp_conv.v0.17.1
- ppxlib.0.37.0
- ppxlib_jane.v0.17.4
- sexplib0.v0.17.0
- stdio.v0.17.0
- stdlib-shims.0.3.0
- time_now.v0.17.0

Additionally, some packages will only be built on specific platforms.

arch = arm64; os = macos:
- cmdliner.1.3.0

arch = arm64; os = win32:
- cmdliner.2.0.0
- conf-mingw-w64-gcc-i686.1
- flexdll.0.44
- ocaml-env-mingw32.1
- system-mingw.1

arch = x86_64; os = macos:
- cmdliner.1.3.0

arch = x86_64; os = win32:
- arch-x86_64.1
- cmdliner.2.0.0
- conf-mingw-w64-gcc-x86_64.1
- flexdll.0.44
- ocaml-env-mingw64.1
- system-mingw.1

@@ -29,6 +29,7 @@ val extend : t -> t -> t
val with_defaults : t

val pp : t -> 'a Pp.t
Copy link
Member

Choose a reason for hiding this comment

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

Is this function still used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, it's still used in places where only a single Solver_env.t is printed.

@gridbugs gridbugs force-pushed the portable-lockdirs-print-packages-by-platform branch 3 times, most recently from b41334d to 25fbabd Compare October 27, 2025 07:13
The message that prints after solving lists each package in the
solution. When a solution is portable, it's possible (though hopefully
rare) that the version of a package included in a solution will be
different depending on the platform. This led to multiple versions of
the same package appearing in the message for non-obvious reasons, which
some found confusing.

This commit changes the message when portable lockdirs are enabled, such
that the packages common to all platforms are printed together, and each
set of platform-specific dependencies is printetd separately from the
common dependencies.

Signed-off-by: Stephen Sherratt <[email protected]>
@gridbugs gridbugs force-pushed the portable-lockdirs-print-packages-by-platform branch from 25fbabd to 0ff4e15 Compare October 27, 2025 08:53
@gridbugs gridbugs merged commit be54d96 into ocaml:main Oct 27, 2025
26 checks passed
MixiMaxiMouse pushed a commit to MixiMaxiMouse/dune that referenced this pull request Nov 3, 2025
The message that prints after solving lists each package in the
solution. When a solution is portable, it's possible (though hopefully
rare) that the version of a package included in a solution will be
different depending on the platform. This led to multiple versions of
the same package appearing in the message for non-obvious reasons, which
some found confusing.

This commit changes the message when portable lockdirs are enabled, such
that the packages common to all platforms are printed together, and each
set of platform-specific dependencies is printetd separately from the
common dependencies.

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.

2 participants