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

--ocaml-version does not support pre-releases of the compiler #351

Open
kit-ty-kate opened this issue Nov 15, 2022 · 5 comments
Open

--ocaml-version does not support pre-releases of the compiler #351

kit-ty-kate opened this issue Nov 15, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@kit-ty-kate
Copy link
Contributor

See mirage/mirage#1363

@Leonidas-from-XIV
Copy link
Member

Does it work when the dependency is in the opam file?

I'm trying to find some reasonable repro case because with simple cases I can get it to lock to a 5.0.0~XXX version (we even have tests for beta versions of the compiler and I wrote another one and that passes as well), but I can't get e.g. https://github.com/bikallem/delve to lock (that's another example that's failing) because I'm missing its dependencies.

@Leonidas-from-XIV
Copy link
Member

@kit-ty-kate What --ocaml-version does is to add a dependency on ocaml.<version> to the constraints. This currently doesn't work with OPAM, since there is no ocaml.5.0.0~rc1. There is however ocaml-base-compiler.5.0.0~rc1 and if I change the code to inject that the locking works (at least when I use it on opam-monorepo).

But before I do the change, I would like to understand why OPAM is set up this way, since I am not sure that depending on ocaml-base-compiler is the right thing to do, given it might make sense to pick a compatible ocaml-variants. Is there any info?

Alternatively, users that want a pre-release compiler can use --ocaml-version 5.0.0 at the moment.

@kit-ty-kate
Copy link
Contributor Author

Is there any info?

  • The ocaml is a meta package here to configure the compiler installation.
  • ocaml-base-compiler is just the vanilla ocaml experience
  • ocaml-variants stores all the more custom ocaml experience (configure options, forks, …)
  • ocaml-system is for using installed globally (as in outside of opam)

Why not create a meta package on the fly instead with

depends:
  "ocaml-base-compiler" {= "the requested version"} |
  "ocaml-variants" {= "the requested version"} |
  "ocaml-system" {= "the requested version"}

@Leonidas-from-XIV
Copy link
Member

But why is there a 5.0.0 version of ocaml when no such release exists? I would've expected that something like ocaml.5.0.0~rc1 would exist that would depend on ocaml-base-compiler.5.0.0~rc1 (which does exist).

Yes, that could be an option worth exploring, but I would prefer to keep as little of the current setup of opam-repository duplicated in the code of opam-monorepo (e.g. ocaml-variants is reasonably new or fact that the compiler is actually in a package called ocaml-base-compiler is, for most package descriptions that depend on "ocaml", transparent).

@palainp
Copy link

palainp commented Dec 17, 2022

Hope this will helps, with Ocaml 5.0.0 released I managed to get mirage-skeleton/tutorial/hello to compiles but I had to remove ocaml-variants from the dependencies of base-domains.opam:

$ cat base-domains.opam 
opam-version: "2.0"
maintainer: "https://github.com/ocaml-multicore/multicore-opam/issues"
description: """
Domains-based parallelism distributed with the Multicore OCaml compiler"
"""
depends: [
  "ocaml" {>= "5.0"}
]
$ opam pin base-domains . -y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants