Skip to content

Fix #5714, so files to be deleted by stack clean --full are not in use#5715

Merged
mpilgrem merged 1 commit intocommercialhaskell:masterfrom
mpilgrem:fix5714
Apr 17, 2022
Merged

Fix #5714, so files to be deleted by stack clean --full are not in use#5715
mpilgrem merged 1 commit intocommercialhaskell:masterfrom
mpilgrem:fix5714

Conversation

@mpilgrem
Copy link
Copy Markdown
Member

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.

  • Any changes that could be relevant to users have been recorded in the ChangeLog.md
  • The documentation has been updated, if necessary.

Please also shortly describe how you tested your change. Bonus points for added tests! Tested by building stack and using stack clean --full.

…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.
@mpilgrem mpilgrem merged commit 87b529a into commercialhaskell:master Apr 17, 2022
@mpilgrem mpilgrem deleted the fix5714 branch April 17, 2022 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant