Currently i feel like most people who try to create a switch will use for example opam switch create 5.3.0.
This does create a switch with an invariant filled with compiler packages matching version number 5.3.0.
However, i think that for most people, having an exact version of the compiler package doesn't matter, they would rather have something like that: opam switch create 5.3 which would hypothetically create a switch named 5.3 with an invariant that takes into account patch versions such as ["ocaml-base-compiler" {>= "5.3.0~" & < "5.4.0~"}] which would upgrade when a version 5.3.1 is available.
Relatedly it is currently pretty much impossible to create a switch that just follow whatever the latest stable compiler is. An empty invariant has no such guarantee and in my opinion should be avoided for solver performance reasons (as every single compilers would be available for the solver).
To fix that i can see several solutions:
- having yet another meta-package in opam-repository
- simplifying the formula syntax (e.g.
opam switch create 5.3 --formula 'ocaml-base-compiler >= 5.3.0~ < 5.4.0~')
- have a simplified syntax for ranges of versions (e.g.
opam switch create 5.3 "5.3.*", in that can we could even detect that syntax and make the name of the switch optional as-in opam switch create "5.3.*" would create a switch named 5.3`)
Does anyone have a better idea?
Currently i feel like most people who try to create a switch will use for example
opam switch create 5.3.0.This does create a switch with an invariant filled with compiler packages matching version number
5.3.0.However, i think that for most people, having an exact version of the compiler package doesn't matter, they would rather have something like that:
opam switch create 5.3which would hypothetically create a switch named 5.3 with an invariant that takes into account patch versions such as["ocaml-base-compiler" {>= "5.3.0~" & < "5.4.0~"}]which would upgrade when a version 5.3.1 is available.Relatedly it is currently pretty much impossible to create a switch that just follow whatever the latest stable compiler is. An empty invariant has no such guarantee and in my opinion should be avoided for solver performance reasons (as every single compilers would be available for the solver).
To fix that i can see several solutions:
opam switch create 5.3 --formula 'ocaml-base-compiler >= 5.3.0~ < 5.4.0~')opam switch create 5.3 "5.3.*", in that can we could even detect that syntax and make the name of the switch optional as-inopam switch create "5.3.*" would create a switch named5.3`)Does anyone have a better idea?