ocaml-flambda / flambda-backend

The Flambda backend project for OCaml
103 stars 73 forks source link

Permission issues during build #1025

Open Gbury opened 1 year ago

Gbury commented 1 year ago

From time to time (and particularly when switching branches), I get the following errors when trying to build (it also comes up from time to time in the CI build if I remember correctly) :

$ make
/home/guigui/build/ocaml/dune-flambda-backend/dune.exe build --root=. --workspace=duneconf/boot.ws  \
  ocaml/main_native.exe \
  boot_ocamlopt.exe \
  ocaml/tools/ocamlmklib.exe \
  ocaml/tools/ocamldep.exe \
          tools/flambda_backend_objinfo.exe
Done: 0/0 (jobs: 0)Bytecode target = default/external/owee/libcompiler_owee_stubs.a, native target = default/external/owee/libcompiler_owee_stubs_native.a
Bytecode target = default/ocaml/otherlibs/unix/libunix_stubs.a, native target = default/ocaml/otherlibs/unix/libunix_stubs_native.a
/home/guigui/build/ocaml/dune-flambda-backend/dune.exe build --root=. --workspace=duneconf/runtime_stdlib.ws --only-package=ocaml_runtime_stdlib @install
Done: 0/0 (jobs: 0)Bytecode target = runtime_stdlib/ocaml/otherlibs/unix/libunix_stubs.a, native target = runtime_stdlib/ocaml/otherlibs/unix/libunix_stubs_native.a
Bytecode target = runtime_stdlib/ocaml/otherlibs/systhreads/native/libthreadsnat_stubs.a, native target = runtime_stdlib/ocaml/otherlibs/systhreads/native/libthreadsnat_stubs_native.a
Bytecode target = runtime_stdlib/ocaml/otherlibs/systhreads/byte/libthreads_stubs.a, native target = runtime_stdlib/ocaml/otherlibs/systhreads/byte/libthreads_stubs_native.a
Bytecode target = runtime_stdlib/ocaml/otherlibs/str/libstr_stubs.a, native target = runtime_stdlib/ocaml/otherlibs/str/libstr_stubs_native.a
Bytecode target = runtime_stdlib/ocaml/ocamltest/libocamltest_core_and_plugin_stubs.a, native target = runtime_stdlib/ocaml/ocamltest/libocamltest_core_and_plugin_stubs_native.a
Bytecode target = runtime_stdlib/external/owee/libcompiler_owee_stubs.a, native target = runtime_stdlib/external/owee/libcompiler_owee_stubs_native.a
        make ocaml/runtime/libasmrun.a,ocaml/runtime/libasmrun_pic.a,ocaml/runtime/libasmrun_shared.so,ocaml/runtime/libasmrund.a,ocaml/runtime/libasmruni.a,ocaml/runtime/prims.o [runtime_stdlib] (exit 2)
(cd _build/runtime_stdlib/ocaml/runtime && /usr/bin/make -sj8 COMPUTE_DEPS=false libasmrun.a libasmrund.a libasmruni.a libasmrun_pic.a libasmrun_shared.so prims.o)
/bin/sh: line 10: prims.c: Permission denied
make[1]: *** [Makefile:226: prims.c] Error 1
make[1]: *** Waiting for unfinished jobs....
        make ocaml/runtime/libcamlrun.a,ocaml/runtime/libcamlrun_pic.a,ocaml/runtime/libcamlrun_shared.so,ocaml/runtime/libcamlrund.a,ocaml/runtime/libcamlruni.a [runtime_stdlib] (exit 2)
(cd _build/runtime_stdlib/ocaml/runtime && /usr/bin/make -sj8 COMPUTE_DEPS=false libcamlrun.a libcamlrund.a libcamlruni.a libcamlrun_pic.a libcamlrun_shared.so)
/bin/sh: line 1: build_config.h: Permission denied
make[1]: *** [Makefile:265: build_config.h] Error 1
make: *** [ocaml/Makefile.common-jst:66: runtime-stdlib] Error 1

Usually, a simple rf -rf _build is enough to make things work again but it's a bit annoying. Either that should be fixed, or we could have a make clean that would remove enough things to make the build work again without having to reconfigure.

poechsel commented 1 year ago

1085 will fix this