Open brendanzab opened 1 year ago
ocaml-base-compiler = "*"
just gets passed along to opam
as --packages ocaml-base-compiler
, which should select the latest version (to some definition of "latest"). I believe 5.0.0
is a release, and thus should be "stable"?
Ahh, wonder why it is not selecting it 😕 – the docs on version ordering are here.
The
~
character is special as it sorts even before the end of sequence (i.e. before anything shorter: "\~" sorts before "", "a\~b" before "a"). It's most convenient for pre-releases, allowing1.0~beta
to be before1.0
.
Not sure what else you are expecting? It seems to be behaving according to the documentation.
You might to be looking at the wrong version of opam-repository; mind that by default opam-nix
uses the version pinned in flake.lock (at this point, it's 786c55fa77c37f07eceea7d6a9bec04d2225e302)
Not sure what else you are expecting? It seems to be behaving according to the documentation.
I would have expected it to select the most recent non-prerelease version (i.e. nothing after the tilde), based on what is on the pinned version of opam-repository
. But perhaps I don’t understand opam versioning that well (I’m used to how it works with Cargo).
Maybe I should just set the compiler version explicitly to avoid this in the future, as opposed to relying on *
?
As an aside, is there a good way to query what versions of a package in the local opam-repository
? At the moment I have just been going into the github repository to check what is at the current commit pinned in my flake, but that seems a little round-about. I assume there’s probably some OCaml tool that can help?
You might to be looking at the wrong version of opam-repository; mind that by default opam-nix uses the version pinned in flake.lock (at this point, it's 786c55fa77c37f07eceea7d6a9bec04d2225e302)
I was looking at the commit of opam-repository
that I pinned on my flake. Sorry, I probably should have mentioned that – I was planning to, but I must have forgot. In the commit I linked to it was https://github.com/ocaml/opam-repository/commit/8241abf97ddbcb63f614372f31abeb306312f33c. I guess I’m wondering if this is exposing an issue that is not obvious in the currently pinned version of opam-repository
?
Describe the bug opam-nix selects
ocaml 5.0.0~rc1
overocaml 5.0.0
when usingocaml-base-compiler = "*"
To Reproduce
ocaml
version:Apply the following diff:
ocaml
version:Expected behavior opam-nix would select the most recent stable version when
"*"
is specified. Alternatively it would select the most recent unstable version (there are more recent versions ofocaml-base-compiler
now).Environment