Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Additional export/import capabilities #2211

Open
Drup opened this issue Jun 20, 2015 · 6 comments
Open

Additional export/import capabilities #2211

Drup opened this issue Jun 20, 2015 · 6 comments

Comments

@Drup
Copy link
Contributor

Drup commented Jun 20, 2015

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 ?

@AltGr
Copy link
Member

AltGr commented Jun 23, 2015

Related to #1520
I'm actually on something that may help with this.

@cmangin
Copy link

cmangin commented Jun 23, 2015

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 -A 4.02.1", and now that 4.02.2 is out, I want to migrate them all to 4.02.2.
I can do it by exporting, re-creating the switch, and importing, but I would like something less manual.

@dbuenzli
Copy link
Contributor

dbuenzli commented Aug 5, 2015

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.

@AltGr
Copy link
Member

AltGr commented Aug 11, 2015

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

@dbuenzli
Copy link
Contributor

dbuenzli commented Jun 21, 2022

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 ?

@rjbou
Copy link
Collaborator

rjbou commented Jun 27, 2022

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?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants