opam
opam copied to clipboard
Additional export/import capabilities
I would like the ability to import
- only root packages
- ignore versions
Basically, I want to move from one version of ocaml to another and have globally the same root packages (and pins, and repo) but let the precise dependency handling free (so that packages that are ocaml-version senstive works, like camlp4).
I know you can do awk magic, but I think it should be in opam directly. Maybe as an opam migrate
tool ?
Related to #1520 I'm actually on something that may help with this.
Somewhat related, I would like to be able to move an entire switch from one compiler to another.
More precisely, I created several switches with "opam switch
Supporting a way to opam import SWITCH
to stand for opam switch SWITCH; opam switch export /tmp/bla ; opam switch OTHERSWITCH; opam switch import /tmp/bla
would be nice.
Good idea, but note that you can already shorten this to
opam switch export - --switch FROM | opam switch import - --yes
that won't work if you want interactive mode though, but in that case, bash version
opam switch import <(opam switch export - --switch FROM)
should be ok
opam switch import <(opam switch export - --switch FROM)
Now that compilers became packages this no longer works:
* No agreement on the version of ocaml-base-compiler:
- (invariant) → ocaml-base-compiler >= 4.14.0
- ocaml = 4.12.0 → ocaml-base-compiler < 4.12.1~
You can temporarily relax the switch invariant with `--update-invariant'
No solution found, exiting
I certainly do not want to relax the switch invariant since this will result in having in 4.12 in my 4.14 switch.
What's the expected workflow nowadays ?
The workflow didn't change (and shouldn't). It's a regression that need to be fixed. Can you open a separate issue for it?