Today, opam upgrade (I use 2.1) proposed me to upgrade to preview version of merlin and ocaml-lsp-server. Is there a way (a command line option) to prevent installation of preview / alpha / beta version?
By the way, is there a reason that the documentation on the opam web site is stuck to version 2.0? I tried to read documentation on the subject but were not able to find anything.
Yes, I would like to prevent upgrading to 4.13 while some required packaged are still previews. But more generally I thought someone would be willing to keep a well tested set of versions and avoid previews.
Yes I too was wondering about this. When I want to install ocaml-lsp in a switch now I am being prompted to install 1.9.0~4.13preview when I am mostly interested in installing ocaml lsp 1.8.2. I was able to solve this issue for myself by doing
opam install ocaml-lsp-server.1.8.2
But yes, I agree that the preview version should be an opt in rather than default offered to people.
Actually I just had a look at @kit-ty-kate 's linked PR – it looks like the issue will be resolved when the PR is merged – Thanks!!
It’s merged - thanks for the fix, @kit-ty-kate! Just cross-posting the comment I made with examples of how this changes:
If you are in a 4.13 switch (e.g. opam switch create 4.13 ocaml-base-compiler.4.13.0) and you opam install merlin, you will get the 4.13 preview, but it will upgrade when the upstream release happens
If you are in a 4.12 switch (e.g. opam switch create 4.12 ocaml-base-compiler.4.12.1) and you opam install merlin, you will get 4.3.1-412 (i.e. latest stable) as before
opam will not upgrade to OCaml 4.13 if you have installed merlin in the switch and, when doing opam switch create . opam will not select 4.13 if merlin (or lsp-server) are included in the dependencies of the opam files which get pinned.
you’ll get upgraded to OCaml 4.13.0. NB in opam 2.0.x, none of this applies - you’ll get the preview version, but opam 2.0.x doesn’t tend to upgrade compilers.