Skip to content

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

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

Merged
merged 1 commit into from
Apr 17, 2022

Conversation

mpilgrem
Copy link
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