-
Notifications
You must be signed in to change notification settings - Fork 842
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
Make stack clean be more thorough by default #4385
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I like the approach you've taken.
In my comment on the issue I asked whether my example description was accurate, but never received an answer. I shall ask again, now that you have submitted this PR.
Specifically, I'll get another person to review this.
doc/GUIDE.md
Outdated
### `stack purge` | ||
`stack purge` Deletes the local stack working directory, including extra-deps, git dependencies and the compiler output. | ||
It does not delete any snapshot packages, compilers or installed programs. -- This essentially | ||
reverts your project to a completely fresh state, as if it had never been built. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This last bit could be more precise. It isn't obvious what a 'completely fresh state' is. I'd have to study that part of the code to offer something that could be written here instead.
I suspect the list I wrote in my comment on the issue may not be comprehensive, so I'll get somebody else to check.
@@ -54,12 +55,17 @@ dirsToDelete cleanOpts = do | |||
-- | Options for @stack clean@. | |||
data CleanOpts | |||
= CleanShallow [PackageName] | |||
-- ^ Delete the "dist directories" as defined in 'Stack.Constants.distRelativeDir' | |||
-- ^ Delete the "dist directories" as defined in 'Stack.Constants.Config.distRelativeDir' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😀
src/Stack/Options/CleanParser.hs
Outdated
@@ -19,4 +19,6 @@ cleanOptsParser = CleanShallow <$> packages <|> doFullClean | |||
flag' | |||
CleanFull | |||
(long "full" <> | |||
help "Delete all work directories (.stack-work by default) in the project") | |||
help "Delete the local stack working directory (.stack-work by default).") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah — this is a subtle change in meaning (probably my fault). It is possible for a project to have multiple .stack-work directories. The old description indicates all are deleted; this implies only one is deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my bad, I wasn't aware that you could have multiple .stack-work directories. Ill fix that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how stack actually behaves, mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok, perhaps I'll wait until this is reviewed further before I run off changing things haha
Also to fix #2278 the documentation changes would need merging to |
It would be good to get an integration test, for this, too, but don't worry too much about it, @vanceism7, if you don't have a chance — it should be fairly straightforward. |
Also I have a directory tree diff listing what has been deleted by each of these commands, which I still need to check. It's in progress! Thanks for bearing with me 👍 |
Oh no problem, thanks for taking the time to address this issue @dbaynard. Id be happy to put the integration test in, but I'll be a bit busy for the next week or so. If there's no rush, I'll try to get to that soon, otherwise, I'm fine if someone else finishes that up too. Thanks! |
Hey just posting an update, I'm back and finished with my prior obligations so I'll work on getting those integration tests in |
We've had various issues with |
Co-Authored-By: vanceism7 <[email protected]>
Co-Authored-By: vanceism7 <[email protected]>
I've rebased, and fixed a conflict (I thought there might be more). Given this doesn't actually affect the operation of clean (just the interface) if it passes CI & integration tests are ok then I'll merge this ASAP. |
- The integration test ensures the correct directories are present, then deleted, for a project with only one package, not in a subdirectory.
Note: the integration test fails. The behaviour of |
Oh ok np, I'll fix that integration test as soon as I can |
@vanceism7 To be clear, it's not failing because of your changes! There's an issue with |
Make stack clean be more thorough by default (supersedes #4385)
Fixes #3863 and potentially fixes #2278
Please include the following checklist in your PR:
I tested out
stack clean
andstack purge
. It seems like theyre doing what they should be. Also added a small spot in the guide.md explaining the commands a little more indepth.