Make stack clean be more thorough by default#4385
Make stack clean be more thorough by default#4385snoyberg merged 11 commits intocommercialhaskell:masterfrom
Conversation
dbaynard
left a comment
There was a problem hiding this comment.
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.
| ### `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.
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.
| 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' |
| 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.
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.
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.
I'm not sure how stack actually behaves, mind.
There was a problem hiding this comment.
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 <vanceism7@gmail.com>
Co-Authored-By: vanceism7 <vanceism7@gmail.com>
|
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 cleanandstack 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.