Skip to content

cabal clean: Error while removing dist/: dist/setup: removeDirectory: unsatisified constraints (Directory not empty) #296

Closed
@bos

Description

@bos

(Imported from Trac #303, reported by @simonmar on 2008-06-23)

cabal clean has a problem on Windows and Unix with NFS that causes it to fail when using a custom Setup.hs. The problem is that we compile Setup.hs to dist/setup/setup, and then invoke dist/setup/setup clean which is supposed to remove the whole of the dist tree, including the running binary. This causes problems on Windows where running binaries can't be deleted, and also on NFS where deleting the running binary leaves a .nfs file behind, preventing the parent directory from being deleted.

> cabal clean -v
Creating dist/setup (and its parents)
dist/setup/setup clean --verbose=2 --distpref=dist
cleaning...
Error while removing dist/: dist/setup: removeDirectory: unsatisified constraints (Directory not empty)
> ls -lr dist
total 36
-rw-rw-r-- 1 simonmar GHC 13069 2008-06-23 11:34 setup-config
drwxrwxr-x 2 simonmar GHC  4096 2008-06-23 11:34 setup/
drwxrwxr-x 4 simonmar GHC  4096 2008-06-23 11:32 build/
~/darcs/ghc-paths > ls -lra dist
total 52
-rw-rw-r-- 1 simonmar GHC 13069 2008-06-23 11:34 setup-config
drwxrwxr-x 2 simonmar GHC  4096 2008-06-23 11:34 setup/
drwxrwxr-x 4 simonmar GHC  4096 2008-06-23 11:32 build/
drwxrwxr-x 4 simonmar GHC  4096 2008-06-23 11:32 ../
drwxrwxr-x 4 simonmar GHC  4096 2008-06-23 11:34 ./
~/darcs/ghc-paths > ls -lRa dist
dist:
total 52
drwxrwxr-x 4 simonmar GHC  4096 2008-06-23 11:34 ./
drwxrwxr-x 4 simonmar GHC  4096 2008-06-23 11:32 ../
drwxrwxr-x 4 simonmar GHC  4096 2008-06-23 11:32 build/
drwxrwxr-x 2 simonmar GHC  4096 2008-06-23 11:34 setup/
-rw-rw-r-- 1 simonmar GHC 13069 2008-06-23 11:34 setup-config
dist/build:
total 52
drwxrwxr-x 4 simonmar GHC 4096 2008-06-23 11:32 ./
drwxrwxr-x 4 simonmar GHC 4096 2008-06-23 11:34 ../
drwxrwxr-x 2 simonmar GHC 4096 2008-06-23 11:32 autogen/
drwxrwxr-x 2 simonmar GHC 4096 2008-06-23 11:32 GHC/
-rw-rw-r-- 1 simonmar GHC 3657 2008-06-23 11:32 HSghc-paths-0.1.o
-rw-rw-r-- 1 simonmar GHC 4404 2008-06-23 11:32 libHSghc-paths-0.1.a
dist/build/autogen:
total 24
drwxrwxr-x 2 simonmar GHC 4096 2008-06-23 11:32 ./
drwxrwxr-x 4 simonmar GHC 4096 2008-06-23 11:32 ../
-rw------- 1 simonmar GHC  990 2008-06-23 11:32 Paths_ghc_paths.hs
dist/build/GHC:
total 32
drwxrwxr-x 2 simonmar GHC 4096 2008-06-23 11:32 ./
drwxrwxr-x 4 simonmar GHC 4096 2008-06-23 11:32 ../
-rw-rw-r-- 1 simonmar GHC  895 2008-06-23 11:32 Paths.hi
-rw-rw-r-- 1 simonmar GHC 3824 2008-06-23 11:32 Paths.o
dist/setup:
total 16
drwxrwxr-x 2 simonmar GHC 4096 2008-06-23 11:34 ./
drwxrwxr-x 4 simonmar GHC 4096 2008-06-23 11:34 ../

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions