opam icon indicating copy to clipboard operation
opam copied to clipboard

Solver inconsistency between 0install and mccs

Open dra27 opened this issue 5 months ago • 4 comments

Not dug into this more fully, but I've been noticing that I've been getting more depexts than I expected with opam 2.4.1 on Windows:

C:\>opam switch create solver --empty --repos=ocaml-compiler-msvc=git+https://github.com/dra27/opam-repository.git#466c7158336346c795d8cc05c7312a677dfb161a
C:\>opam install ocaml-base-compiler.5.3.0 system-msvc --solver=builtin-mccs+glpk
The following actions will be performed:
=== install 21 packages
  ∗ arch-x86_64                 1          [required by ocaml-compiler]
  ∗ base-bigarray               base
  ∗ base-domains                base
  ∗ base-effects                base
  ∗ base-nnp                    base
  ∗ base-threads                base
  ∗ base-unix                   base
  ∗ conf-msvc64                 1          [required by ocaml-env-msvc64]
  ∗ flexdll                     0.44       [required by ocaml-compiler]
  ∗ host-arch-x86_64            1
  ∗ host-system-msvc            1
  ∗ msvs-detect                 0.7.0      [required by conf-msvc64]
  ∗ ocaml                       5.3.0
  ∗ ocaml-base-compiler         5.3.0
  ∗ ocaml-compiler              5.3.0      [required by ocaml-base-compiler]
  ∗ ocaml-config                3
  ∗ ocaml-env-msvc64            1          [required by system-msvc]
  ∗ ocaml-option-no-compression 1          [required by ocaml-compiler]
  ∗ ocaml-options-vanilla       1
  ∗ system-msvc                 1
  ∗ winpthreads                 20240209-1 [required by ocaml-compiler]

Proceed with ∗ 21 installations? [Y/n]

With the now-default 0install solver I get mingw-w64-shims (and therefore an extra C compiler):

C:\Devel\opam-repository\packages>opam install ocaml-base-compiler.5.3.0 system-msvc --solver=builtin-0install
The following actions will be performed:
=== install 23 packages
  ∗ arch-x86_64                 1          [required by ocaml-compiler]
  ∗ base-bigarray               base
  ∗ base-domains                base
  ∗ base-effects                base
  ∗ base-nnp                    base
  ∗ base-threads                base
  ∗ base-unix                   base
  ∗ conf-mingw-w64-gcc-x86_64   1          [required by mingw-w64-shims]
  ∗ conf-msvc64                 1          [required by ocaml-env-msvc64]
  ∗ flexdll                     0.44       [required by ocaml-compiler]
  ∗ host-arch-x86_64            1
  ∗ host-system-msvc            1
  ∗ mingw-w64-shims             0.2.0      [required by ocaml-compiler]
  ∗ msvs-detect                 0.7.0      [required by conf-msvc64]
  ∗ ocaml                       5.3.0
  ∗ ocaml-base-compiler         5.3.0
  ∗ ocaml-compiler              5.3.0      [required by ocaml-base-compiler]
  ∗ ocaml-config                3
  ∗ ocaml-env-msvc64            1          [required by system-msvc]
  ∗ ocaml-option-no-compression 1          [required by ocaml-compiler]
  ∗ ocaml-options-vanilla       1
  ∗ system-msvc                 1
  ∗ winpthreads                 20240209-1 [required by ocaml-compiler]

Proceed with ∗ 23 installations? [Y/n]

dra27 avatar Sep 05 '25 11:09 dra27

Thanks for the report, that could indeed be the sign of a not-quite-right CUDF to 0install internal representation transformation. The code doing the transformation for disjunction can be tricky to think about so i'm indeed not too surprised if there is indeed a bug in it.

I'll try to look into it when i have some time

kit-ty-kate avatar Sep 05 '25 11:09 kit-ty-kate

Do you know if the 0install tool has the same problem?

kit-ty-kate avatar Sep 05 '25 11:09 kit-ty-kate

Can I (lazily!) ask for the command I'd need to run to see? 😁

dra27 avatar Sep 16 '25 09:09 dra27

opam-0install ocaml-base-compiler.5.3.0 system-msvc i believe

kit-ty-kate avatar Sep 16 '25 18:09 kit-ty-kate