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

ocamlbuild -clean says directory is not empty #7009

Closed
vicuna opened this issue Oct 7, 2015 · 9 comments
Closed

ocamlbuild -clean says directory is not empty #7009

vicuna opened this issue Oct 7, 2015 · 9 comments

Comments

@vicuna
Copy link

vicuna commented Oct 7, 2015

Original bug ID: 7009
Reporter: william
Status: resolved (set by @damiendoligez on 2017-02-24T10:45:45Z)
Resolution: suspended
Priority: normal
Severity: minor
OS: Linux
Target version: later
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Monitored by: @glondu

Bug description

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.

Additional information

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.

@vicuna
Copy link
Author

vicuna commented Oct 7, 2015

Comment author: @gasche

But is the _build directory actually empty? If it isn't, there may be a bug, but if this is really an NFS issue I don't see what we could do ocaml-side.

@vicuna
Copy link
Author

vicuna commented Oct 7, 2015

Comment author: william

yes, the directory is empty !
By the way, "ocamlbuild -clean" should remove the directory, empty or not. It actually empties it, but fails to remove it.

@vicuna
Copy link
Author

vicuna commented Oct 8, 2015

Comment author: william

I made some more tests.

the problems appears with version 4.02.3 (compared to 4.02.1), but only on debian 8 jessie platform through SSH

staying on local debian 7 wheezy platform, no matter 4.02.1 or 4.02.3, it works

@vicuna
Copy link
Author

vicuna commented Oct 8, 2015

Comment author: william

even more funny,
if I run "ocamlbuild -clean" while there is no _build directory, the command actually creates it and then complain !

@vicuna
Copy link
Author

vicuna commented Oct 9, 2015

Comment author: daweil

The bug is a REGRESSION and so, it would be nice if it is fixed in next Ocaml release.

On windows, the message is

ocamlbuild -clean
rm -Rf 'D:\home\dev\xxx\essai_build'
rm: impossible de supprimer « ...\essai\_build/_log »: Device or resource busy
Failure:
Error during command `rm -Rf '...\essai_build''.
Exit code 1.
.

@vicuna
Copy link
Author

vicuna commented Oct 9, 2015

Comment author: @gasche

When you mean "on windows", are you still in a NFS-mounted system, or is this reproducible under any Windows filesystem? Does the Windows run also ends up with an empty _build, or is _log still present?

The windows error message is more informative, it looks like some file description still open is blocking deletion. We should investigate (bisect?) what change created the issue. If this is reproducible enough on your end, would you be able to bisect from the git repository?

From the root ocaml repository on trunk, gisect bisect start 4.02.3 4.02.1 -- ocamlbuild should traverse only the changes affecting the ocamlbuild/ subdirectory. (The problem might be due to an OCaml change outside ocamlbuild affecting ocamlbuild, but it seems reasonable to assume that is not the case, and there is much less to bisect this way.)

@vicuna
Copy link
Author

vicuna commented Oct 18, 2015

Comment author: daweil

On windows, we're using the mingw port, i.e. native 32 bit code build on cygwin with the i686-mingw32-w64 cross-compiler (cf http://protz.github.io/ocaml-installer/).
The file system is NTFS.

The error message indicates the ocamlbuild is writing on the _build/_log file et trying to remove the -build directory in the same time.

@vicuna
Copy link
Author

vicuna commented Nov 24, 2015

Comment author: @xavierleroy

I suspect SVN commit r15973, which was trying to fix #6652.

Index: main.ml

--- main.ml (revision 15972)
+++ main.ml (revision 15973)
@@ -25,7 +25,6 @@
exception Exit_silently

let clean () =

  • Log.finish ();
    Shell.rm_rf !Options.build_dir;
    if !Options.make_links then begin
    let entry =
    @@ -34,6 +33,7 @@
    in
    Slurp.force (Resource.clean_up_links entry)
    end;
  • Log.finish ();
    raise Exit_silently
    ;;

@vicuna
Copy link
Author

vicuna commented Feb 24, 2017

Comment author: @damiendoligez

ocamlbuild is now a separate project that lives on GitHub.
PR transferred to ocaml/ocamlbuild#146

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

No branches or pull requests

1 participant