In opam 2.0, it should definitely be possible to do it with a kind of dummy 
package which has a version constraint on the underlying OCaml package holding 
the appropriate ocaml package below the next version (e.g. < 4.03.0 for the 
4.02 channel – there might be a cleverer constraint than that even, IIRC). Each 
major version would correspond to a version of the package (say 
ocaml-branch.4.02 or something) which you’d then pin at that version. A neat 
side-effect is that if a new maintenance release were made, the switch would be 
upgradable. It would also not require maintenance, beyond adding new major 
release versions.

It’s not aliases, but would it do what you’re after? All of that’s impossible 
in OPAM 1.x – the best bet there would be to have an opam-admin script which 
can process the compilers directory and re-generate the branch packages 
(something similar to Anil’s script for the GPRs).


David

PS My strange patching work means I do keenly remember all point releases since 
3.07 – who released 4.03.1 without telling me ;o)

From: opam-devel [mailto:opam-devel-boun...@lists.ocaml.org] On Behalf Of 
Gabriel Scherer
Sent: 30 December 2016 17:07
To: opam-devel@lists.ocaml.org
Subject: [opam-devel] Multiple names for the same switch (aliases that are 
really aliases)

Hi opam-devel,
A few weeks ago I discussed with Jeremy Yallop the idea of having switches for 
major OCaml versions (4.01, 4.02, 4.03...) that would point to the 
currently-best minor version of them (do you remember? 4.01.0, 4.02.3, 4.03.1).
I would be willing to invest the effort of doing that and maintaining this 
mapping, but I feel that just creating new switches is too heavy-handed to be 
useful. If I already have a 4.02.3 switch, I would like "opam switch 4.02" to 
bring me to that switch, not install a new, distinct one with name 4.02 that 
would in fact install the same compiler as 4.02.3.
Do I correctly understand that this feature is not possible in OPAM 1.2.x? (If 
it is, I may do it.)
Is it possible in 2.x?
(Louis: I do distinctly remember your call to try out 2.x at ICFP and I feel 
guilty about not having done much yet. Apologies.)
_______________________________________________
opam-devel mailing list
opam-devel@lists.ocaml.org
http://lists.ocaml.org/listinfo/opam-devel

Reply via email to