Skip to content

unix.cmxa included twice when myocamlbuild.ml is present #66

@dariusf

Description

@dariusf

I get this error when trying to build a project with -package unix:

$ ocamlbuild -clean
Finished, 0 targets (0 cached) in 00:00:00.

$ ocamlbuild -package unix main.byte
+ /usr/local/bin/ocamlopt.opt unix.cmxa -I /usr/local/lib/ocaml/ocamlbuild /usr/local/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa -I /usr/local/lib/ocaml /usr/local/lib/ocaml/unix.cmxa myocamlbuild.ml /usr/local/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
File "myocamlbuild.ml", line 1:
Error: Files /usr/local/lib/ocaml/unix.cmxa
       and /usr/local/lib/ocaml/unix.cmxa both define a module named Unix
Command exited with code 2.
Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
make: *** [all] Error 10

For some reason, unix.cmxa seems to be included twice in the invocation above.

Minimal repro here. It happens as long as myocamlbuild.ml is present (even when it's empty), and also with -lib unix. Doesn't happen with other OCaml libraries (tried str, num). I'm on 4.02.3, OS X 10.11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions