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

error message when you omit --ocaml-version #77

Open
quinn-dougherty opened this issue Nov 7, 2021 · 1 comment
Open

error message when you omit --ocaml-version #77

quinn-dougherty opened this issue Nov 7, 2021 · 1 comment

Comments

@quinn-dougherty
Copy link

"$(nix-build --no-out-link ./opam2nix.nix)"/bin/opam2nix resolve ./mytest.opam

error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I) 
+ /nix/store/1zb2as5f9iqyibwy65ln7b023522sg90-ocaml4.12.0-opam2nix-1.1.0/bin/opam2nix resolve ./mytest.opam
Using current <nixpkgs> ocaml version, pass --ocaml-version to override
Fetching...
Importing opam-repository a349ee914e267237677546599e718e417aaae14d into nix store...
Fatal error: exception (Failure "Couldn't extract ocaml version from nixpkgs, pass --ocaml-version")

What's going on here? what would have to happen to get a better error message? is passing --ocaml-version minimally required behavior?

In my head, I thought omitting --ocaml-version would infer the latest possible ocaml in conformance to packages in mytest.opam.

@timbertson
Copy link
Owner

I thought omitting --ocaml-version would infer the latest possible ocaml in conformance to packages in mytest.opam.

It's not that clever I'm afraid - it picks the default ocaml version from nixpkgs - thus the error, since you don't appear to have a nixpkgs channel available.

To be honest it's probably better to just always pass --ocaml-version, though it is a little tedious.

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

No branches or pull requests

2 participants