Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

creating local switch only works if there already is a switch #3874

Closed
vogler opened this issue Jun 17, 2019 · 1 comment · Fixed by #3884
Closed

creating local switch only works if there already is a switch #3874

vogler opened this issue Jun 17, 2019 · 1 comment · Fixed by #3884
Milestone

Comments

@vogler
Copy link

vogler commented Jun 17, 2019

I wanted to start using local switches.
Locally, with several existing global switches (one being 4.07.1), opam switch -y create ./ --deps-only works fine (log says installed ocaml-system.4.07.1).
On travis-ci, after opam init -y -a --bare (without having any switches installed), it fails with No available version of ocaml-base-compiler satisfies the constraints (see log).
There it only works if I specify a compiler version, e.g., opam switch -y create ./ --deps-only ocaml-base-compiler.4.07.1.
I would expect that local switches also install a compiler if there is none yet.
The version constraint in the opam file is "ocaml" {>= "4.04.1" & < "4.08"}.

vogler added a commit to goblint/analyzer that referenced this issue Jun 18, 2019
@rjbou
Copy link
Collaborator

rjbou commented Jun 25, 2019

It is not related to opam initialisation, but there is actually a mistake in the choice of compiler for a specific case, and you reach it: local switch based on local repo, no compiler selected, and range on constraint, and more than one compiler compliant.
Thanks for the report!

@rjbou rjbou added this to the 2.1.0 milestone Jun 26, 2019
vogler referenced this issue in goblint/analyzer Jul 12, 2019
…able, which makes opam abort.

[ERROR] Compiler selection '4.07.1' is ambiguous. matching packages: {
        ocaml-base-compiler.4.07.1, ocaml-system.4.07.1 }

On Linux we don't have any OCaml installed, so safe choice is to always download and compile OCaml by specifying ocaml-base-compiler.4.07.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants