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

Build fails: Exception Sys_error("main.mli.depends: No such file or directory"). #28

Open
yurivict opened this issue Feb 9, 2020 · 11 comments

Comments

@yurivict
Copy link

yurivict commented Feb 9, 2020

make[4]: Entering directory '/usr/ports/lang/lem/work/lem-2020-01-30/src'
ocamlbuild -use-ocamlfind -cflags -g main.native
Exception Sys_error("main.mli.depends: No such file or directory").
Compilation unsuccessful after building 2 targets (0 cached) in 00:00:00.
make[2]: *** [Makefile:2: all] Error 100

Despite this error, the build continues and later fails again:

make[2]: Entering directory '/usr/ports/lang/lem/work/lem-2020-01-30'
make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make -C ocaml-lib all
make[3]: Entering directory '/usr/ports/lang/lem/work/lem-2020-01-30/ocaml-lib'
ocamlbuild.mk:40: *** multiple target patterns.  Stop.
make[3]: Leaving directory '/usr/ports/lang/lem/work/lem-2020-01-30/ocaml-lib'
make[2]: *** [Makefile:73: ocaml-libs] Error 2
make[2]: Leaving directory '/usr/ports/lang/lem/work/lem-2020-01-30'
gmake[1]: *** [Makefile:53: libs_phase_1] Error 2
gmake[1]: Leaving directory '/usr/ports/lang/lem/work/lem-2020-01-30'

FreeBSD 12

@bauereiss
Copy link
Contributor

Which versions of OCaml, ocamlbuild, and ocamlfind are you using?

@yurivict
Copy link
Author

ocaml-4.05.0_1, ocaml-ocamlbuild-0.14.0, ocaml-findlib-1.7.1

@bauereiss
Copy link
Contributor

I've tried it with a FreeBSD VM, and can reproduce the error. It seems the problem is the initialisation of the INSTALLDIR variable in ocamlbuild.mk; it uses the shell command ocamlfind printconf destdir, which in the default FreeBSD installation of ocamlfind returns not one, but two directories, separated by a colon, and that confuses make. I'm not sure what to do about that in general. As a workaround you could try manually overriding INSTALLDIR when invoking make.

@yurivict
Copy link
Author

When I added INSTALLDIR=${LOCALBASE}/lib/ocaml/site-lib it now fails in another way:

mkdir: /usr/ports/lang/lem/work/lem-2020-01-30/src/_build: File exists
Command exited with code 1.

@bauereiss
Copy link
Contributor

Hm, I don't see a command in the Lem Makefiles that creates that directory, other than ocamlbuild. Maybe something went wrong during an earlier run of the latter? Does this error occur in a clean checkout of Lem?

@yurivict
Copy link
Author

It occurs in a clean build.

@bauereiss
Copy link
Contributor

What's the context of this error, i.e. what is happening before?

@yurivict
Copy link
Author

It looks like the previous error was intermittent. Now it fails in this way:

===>  Building for lem-language-2020.01.30
gmake[1]: Entering directory '/usr/ports/lang/lem/work/lem-2020-01-30'
echo "(* Generated file -- do not edit. *)" > src/version.ml
echo "(* Generated file -- do not edit. *)" > src/share_directory.ml
make -C library
echo 'let v="2018-04-23"' >> src/version.ml
echo let d=\"/usr/ports/lang/lem/work/lem-2020-01-30/share/lem\" >> src/share_directory.ml
make[2]: Entering directory '/usr/ports/lang/lem/work/lem-2020-01-30'
make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make -C src all
make[2]: Entering directory '/usr/ports/lang/lem/work/lem-2020-01-30'
make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make -C .. build-lem
ocamlbuild -use-ocamlfind -cflags -g main.native
make[3]: Entering directory '/usr/ports/lang/lem/work/lem-2020-01-30'
echo "(* Generated file -- do not edit. *)" > src/version.ml
echo 'let v="2018-04-23"' >> src/version.ml
echo "(* Generated file -- do not edit. *)" > src/share_directory.ml
echo let d=\"/usr/ports/lang/lem/work/lem-2020-01-30/share/lem\" >> src/share_directory.ml
make -C src all
make[4]: Entering directory '/usr/ports/lang/lem/work/lem-2020-01-30/src'
ocamlbuild -use-ocamlfind -cflags -g main.native
Exception Sys_error("main.mli.depends: No such file or directory").
Compilation unsuccessful after building 2 targets (0 cached) in 00:00:00.
make[2]: *** [Makefile:2: all] Error 100
make[2]: Leaving directory '/usr/ports/lang/lem/work/lem-2020-01-30/src'
gmake[1]: *** [Makefile:180: build-lem] Error 2
gmake[1]: *** Waiting for unfinished jobs....
+ ocamlfind ocamlopt -c -g -annot -package zarith -I ulib -o ulib/batUTF8.cmx ulib/batUTF8.ml
File "ulib/batUTF8.ml", line 209, characters 2-13:
Warning 3: deprecated: String.copy
+ ocamlfind ocamlopt -c -g -annot -package zarith -I ulib -o reporting_basic.cmx reporting_basic.ml
File "reporting_basic.ml", line 80, characters 12-25:
Warning 3: deprecated: String.create

@bauereiss
Copy link
Contributor

Are you trying to build with multiple concurrent jobs? This looks like two instances of the same ocamlbuild job end up running concurrently, which might explain the error.

@yurivict
Copy link
Author

That was it, parallel jobs were conflicting. Thanks!

Now it fails at a later point:

lem_wordAuxiliary.ml
\n\n\n
***************************************************
* Testing lem_basic_classes
***************************************************\n
Fatal error: cannot load shared library dllzarith
Reason: Shared object "dllzarith.so" not found, required by "ocamlrun"

bauereiss added a commit that referenced this issue Feb 11, 2020
@bauereiss
Copy link
Contributor

I've seen this too, and pushed a commit that fixes it for me.

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