ocaml / ocamlbuild

The legacy OCamlbuild build manager
Other
121 stars 81 forks source link

MPR#7009: ocamlbuild -clean says directory is not empty #146

Open damiendoligez opened 7 years ago

damiendoligez commented 7 years ago

PR transferred from https://caml.inria.fr/mantis/view.php?id=7009

the command "ocamlbuild -clean" do not work. Here is the output :

+ rm -Rf /home/william/project/_build
rm: impossible de supprimer « /home/william/project/_build »: Le dossier n'est pas vide
Command exited with code 1.
Failure:
  Error during command "rm -Rf /home/william/project/_build": My_std.Exit_with_code(10).
Compilation unsuccessful after building 0 targets (0 cached) in 00:00:00.

This error appeared with ocamlbuild 4.02.3, but it is working with 4.02.1.

Also, I am not expert on the system I am using, but it could be related to NFS, and I am connecting through SSH to another computer in a local network.

habdulkafi commented 7 years ago

I came across this bug while working on BashOnWindows, Ubuntu 16.04. I looked at the strace output and noticed it was opening a log file in the _build directory before attempting to delete the directory (with the log file still open). A workaround I found was running ocamlbuild -no-log -clean instead.

gasche commented 7 years ago

@habdulkafi, could you try to test with ocamlbuild version 0.9.3 or later? This should have been fixed by #103 which was part of that release. (See ocamlbuild -version for version information.)

habdulkafi commented 7 years ago

when I run ocamlbuild -version, I get ocamlbuild 4.02.3

gasche commented 7 years ago

Indeed, that corresponds to versions that were bundled with the OCaml distribution until 4.02.x, which are older than the 0.9.x versions. You need OCaml 4.03.0 or later to try ocamlbuild versions 0.9.x or after.