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

coq fails #78

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

coq fails #78

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

Comments

@quinn-dougherty
Copy link

Hi! I was having some issues with coq in an opam2nix project, namely nix-shell default.nix --pure --run "coqc --version" after following instructions would fail. I was drawing up a minimal replicator to file an issue to learn more about how I'm supposed to be using the tool, when I couldn't even get that far and the larger project that previously at least had a successfully built shell stopped working too somehow.

$ cat opam2nix.nix 
import (builtins.fetchTarball "https://github.com/timbertson/opam2nix/archive/v1.tar.gz")
$ cat mytest.opam
opam-version: "2.0"

depends: [
         "coq" { >= "8.13.0" & < "8.14" }
]

build: [ "dune" "build" "-p" name "-j" jobs ]
$ cat default.nix
{ pkgs ? import (builtins.fetchTarball {
    url = "https://github.com/NixOS/nixpkgs/archive/refs/tags/21.05.tar.gz";
  }) {} }:
let
  opam2nix = import ./opam2nix.nix {};
  ocaml = pkgs.ocaml;
  selection = opam2nix.build {
    inherit ocaml;
    selection = ./opam-selection.nix;
    src = ./.;
  };
in selection.mytest
$ "$(nix-build --no-out-link ./opam2nix.nix)"/bin/opam2nix resolve --ocaml-version 4.12.0 ./mytest.opam 
$ nix-shell default.nix
...
<OCAMLC trying to compile coq>
...
OCAMLC    checker/votour.mli
OCAMLC -a bin/doc_grammar
"/nix/store/zxwc73n4pjcvl8bv4pw695wn6z12a5w3-ocamlfind-1.9.1/bin/ocamlfind" ocamlc -thread -rectypes -w +a-4-9-27-41-42-44-45-48-58-67   -safe-string -strict-sequence  ide/coqide/default_bindings_src.ml -o ide/coqide/default_bindings_src.exe
CHECK revision
sh: ./dev/tools/make_git_revision.sh: /usr/bin/env: bad interpreter: No such file or directory
make[1]: *** [Makefile.dev:34: revision] Error 126
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/build/coq-8.13.2'
make: *** [Makefile.make:178: submake] Error 2
Command failed.
error: builder for '/nix/store/48bpq8irly0wwm0ja5rz3xmhqwjqsq8a-coq-8.13.2.drv' failed with exit code 2                                            

Any ideas?

@Zimmi48
Copy link

Zimmi48 commented Nov 9, 2021

I have no idea what opam2nix does, but from the error message, it looks like there was no step to patch shebangs in scripts that are run during the build. See the corresponding code from the nixpkgs derivation: https://github.com/NixOS/nixpkgs/blob/e74894146a42ba552ebafa19ab2d1df7ccbc1738/pkgs/applications/science/logic/coq/default.nix#L153-L159

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