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

ocaml compiler suite executables fail to load unix.cma #10265

Closed
Ptival opened this Issue Oct 6, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@Ptival
Copy link
Contributor

Ptival commented Oct 6, 2015

I get the following error when trying to load unix.cma in either ocaml, camlp5, or camlp5o, both in 15.09 and unstable:

ocaml unix.cma
Error while loading "/nix/store/9s1lxw0szc8vi1zn9igpli7drqxbj7mp-ocaml-4.01.0/lib/ocaml/unix.cma": error loading shared library: /nix/store/g9savnaxaya238lfgcbb0ziidywpyich-ocaml-4.02.1/lib/ocaml/stublibs/dllunix.so: /nix/store/g9savnaxaya238lfgcbb0ziidywpyich-ocaml-4.02.1/lib/ocaml/stublibs/dllunix.so: undefined symbol: caml_strdup.
camlp5 -I /nix/store/9s1lxw0szc8vi1zn9igpli7drqxbj7mp-ocaml-4.01.0/lib/ocaml/ unix.cma
Error while loading "/nix/store/9s1lxw0szc8vi1zn9igpli7drqxbj7mp-ocaml-4.01.0/lib/ocaml/unix.cma": error loading shared library: /nix/store/g9savnaxaya238lfgcbb0ziidywpyich-ocaml-4.02.1/lib/ocaml/stublibs/dllunix.so: /nix/store/g9savnaxaya238lfgcbb0ziidywpyich-ocaml-4.02.1/lib/ocaml/stublibs/dllunix.so: undefined symbol: caml_strdup.

I don't know why it tries to pull dllunix.so from ocaml-4.02.1, and apparently it gets confused with the newly-introduced caml_strdup (introduced in 4.02).

Here is the environment I am trying to run from:

with import <nixpkgs> {}; {
  env = stdenv.mkDerivation {
    name = "plugin";
    buildInputs = [ coqPackages_8_5.coq ocaml ocamlPackages.camlp5_6_strict ];
  };
}

Paging in @vbgl maybe?

@Ptival Ptival changed the title camlp5 fails to load unix.cma ocaml executables fail to load unix.cma Oct 7, 2015

@Ptival Ptival changed the title ocaml executables fail to load unix.cma ocaml compiler suite executables fail to load unix.cma Oct 7, 2015

@vbgl

This comment has been minimized.

Copy link
Contributor

vbgl commented Oct 7, 2015

Hmm. Cannot reproduce. I tried the following on fedora with the unstable channel and NixOS 15.09:

  1. install (nix-env -i) OCaml-4.02;
  2. start a nix-shell with Coq, OCaml-4.01 and corresponding camlp5;
  3. run the commands you’ve given (ocaml unix.cma and camlp5 -I $(ocamlc -where) unix.cma)

Everything works without error. Have you got any more hint?

@Ptival

This comment has been minimized.

Copy link
Contributor

Ptival commented Oct 7, 2015

Ah, figured it out, my bad, I had a leftover configuration file that set CAML_LD_LIBRARY_PATH to the nonsense value.

Sorry for the noise!
Thanks @gridaphobe for helping me out! :)

@Ptival Ptival closed this Oct 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment