Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opam suggests change to OCaml variant type on conflict #4212

Closed
craigfe opened this issue May 29, 2020 · 2 comments
Closed

Opam suggests change to OCaml variant type on conflict #4212

craigfe opened this issue May 29, 2020 · 2 comments

Comments

@craigfe
Copy link

craigfe commented May 29, 2020

On Opam version 2.1.0~alpha, when using a switch with ocaml-variants, opam seems to make no effort to preserve the type of variant installed. For instance,

image

in which opam suggests a switch from a +afl variant to a +statistical-memprof variant in addition to the necessary change to the base compiler version.

This presumably happens because the version of ocaml-variants is opaque to Opam, and so 4.07+afl and 4.07+statistical-memprof are equally valid solutions. My expectation is that users would want the type of OCaml compiler variant they have installed to be preserved if at all possible, using some sort of "invariant" along the lines of:

ocaml-variants = .*+afl

Since this isn't a valid Opam constraint, it's not possible to set it as a switch invariant. The solution here may be to change the way ocaml-variants works to avoid overloading the version string as it does (perhaps ocaml-variants-afl.4.09 rather than ocaml-variants.4.09+afl?).

@AltGr
Copy link
Member

AltGr commented Oct 28, 2020

Your diagnostic is correct, the way these variants are handled is a bit of a hack in the opam-repository, and your result is the downside of it. We have better ways of specifying compiler options and variants in the works, but nothing fully designed yet.

In your case, you probably want to set the switch base (or invariant in 2.1) so that opam won't suggest changing its version at all.

@dra27
Copy link
Member

dra27 commented Jul 8, 2021

This has been addressed in opam-repository with the new ocaml-option- packages!

@dra27 dra27 closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants