You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The problem here is with custom Setup.hs scripts that might want to do something for clean. A solution would be to be able to ask the Setup.hs to clean anything custom and let the calling tool (ie cabal-install) recursively delete the dist directory. On windows and nfs it's not easy for a program to delete itself and the directory it is running from.
On the other hand, this kind of cooperation does not work well with custom build systems. See CustomBuildInterface.
Isn't a simple solution to never let Setup delete it's own exe? Worse case if using the setup script clean leaves an exe, if cabal was used it can remove the exe left behind.
If it's a big deal to not leave anything at all the hackish way around it would be to inject some shellscript into a running program like explorer and have it delete the exe.
We're cleaning up the bug tracker to make it useful again and are thus closing bugs that haven't seen any activity in a long time. Please re-open (or file a new bug) if the problem reappears.
This bug (which also falls under the scope of issue #1863) still happens to me on Windows with cabal-install-1.20.0.3 and Cabal-1.20.0.2. Having a cabal project with a Custom build-type will yield the following error when cabal clean is run:
[1 of 1] Compiling Main ( dist\setup\setup.hs, dist\setup\Main.o )
Linking .\dist\setup\setup.exe ...
cleaning...
Error while removing dist/: DeleteFile "dist\\setup\\setup.exe": permission denied (Access is denied.)
(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.
The text was updated successfully, but these errors were encountered: