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
For both stack.exe version 2.7.5 and the current version (built at commit 403068f), as follows (on Windows 11 - but I do not think this is a Windows-specific problem, having found a solution):
❯ stack new cleanTest
Downloading template "new-template" to create project "cleanTest" in cleanTest\ ...
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- cleanTest\
Selecting the best among 21 snapshots...
* Matches https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/3.yaml
Selected resolver: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/3.yaml
Initialising configuration using resolver: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/3.yaml
Total number of user packages considered: 1
Writing configuration to file: cleanTest\stack.yaml
All done.
C:\sr\templates\new-template.hsfiles: 6.06 KiB downloaded...
❯ cd cleanTest
❯ stack build
Building all executables for `cleanTest' once. After a successful build of all of them, only specified executables will be rebuilt.
cleanTest> configure (lib + exe)
Configuring cleanTest-0.1.0.0...
cleanTest> build (lib + exe)
Preprocessing library for cleanTest-0.1.0.0..
Building library for cleanTest-0.1.0.0..
[1 of 2] Compiling Lib
[2 of 2] Compiling Paths_cleanTest
Preprocessing executable 'cleanTest-exe' for cleanTest-0.1.0.0..
Building executable 'cleanTest-exe' for cleanTest-0.1.0.0..
[1 of 2] Compiling Main
[2 of 2] Compiling Paths_cleanTest
Linking .stack-work\dist\d53b6a14\build\cleanTest-exe\cleanTest-exe.exe ...
cleanTest> copy/register
Installing library in C:\Users\mikep\Documents\Code\Haskell\cleanTest\.stack-work\install\0fa84ff7\lib\x86_64-windows-ghc-9.0.2\cleanTest-0.1.0.0-GqaAHpw8uizcrM5mrfOeA
Installing executable cleanTest-exe in C:\Users\mikep\Documents\Code\Haskell\cleanTest\.stack-work\install\0fa84ff7\bin
Registering library for cleanTest-0.1.0.0..
❯ stack clean --full
Exception while recursively deleting C:\Users\mikep\Documents\Code\Haskell\cleanTest\.stack-work\
C:\Users\mikep\Documents\Code\Haskell\cleanTest\.stack-work\stack.sqlite3: removeDirectoryRecursive:removeContentsRecursive:removePathRecursive:DeleteFile "\\\\?\\C:\\Users\\mikep\\Documents\\Code\\Haskell\\cleanTest\\.stack-work\\stack.sqlite3": permission denied (The process cannot access the file because it is being used by another process.)
Perhaps you do not have permission to delete these files or they are in use?
Exception while recursively deleting C:\Users\mikep\Documents\Code\Haskell\cleanTest\.stack-work\
C:\Users\mikep\Documents\Code\Haskell\cleanTest\.stack-work\stack.sqlite3: removeDirectoryRecursive:removeContentsRecursive:removePathRecursive:DeleteFile "\\\\?\\C:\\Users\\mikep\\Documents\\Code\\Haskell\\cleanTest\\.stack-work\\stack.sqlite3": permission denied (The process cannot access the file because it is being used by another process.)
Perhaps you do not have permission to delete these files or they are in use?
--verbose also includes the following log:
2022-04-15 14:20:57.998144: [debug] Need to delete: ["C:\\Users\\mikep\\Documents\\Code\\Haskell\\cleanTest\\.stack-work\\","C:\\Users\\mikep\\Documents\\Code\\Haskell\\cleanTest\\.stack-work\\"]
which explains why the error message appears twice - the same folder is being listed twice for deletion.
There is no problem in deleting .stack-work in Explorer, so it may be stack clean --full is using the very file it seeks to delete.
The text was updated successfully, but these errors were encountered:
…full` are not in use
The existing:
~~~
cleanCmd = withConfig NoReexec . withBuildConfig . clean
~~~
wraps `clean` in `withBuildConfig`, but that ends in `initProjectStorage projectStorageFile` and, so, uses one of the very files (`projectStorageFile`) that `stack clean -full` will attempt (and fail) to delete.
This pull request moves the `withBuildConfig` to wrap only the function that yields the list of files to be deleted (`dirsToDelete cleanOpts`), so that `projectStorageFile` is not in use when the file comes to be deleted.
For both
stack.exe
version 2.7.5 and the current version (built at commit 403068f), as follows (on Windows 11 - but I do not think this is a Windows-specific problem, having found a solution):--verbose
also includes the following log:which explains why the error message appears twice - the same folder is being listed twice for deletion.
There is no problem in deleting
.stack-work
in Explorer, so it may bestack clean --full
is using the very file it seeks to delete.The text was updated successfully, but these errors were encountered: