Cleanup obsolete stack stuff (compiler, libraries, etc.)

Hi folks! I want to perform some cleanup deleting obsolete compilers located in ~/.stack folder. I know stack places them into ~/.stack/programs/<platform>/ directory, however I think there are also should be something else related, e.g. docs and libs, and especially packages that was built when I used old LTS snapshots. What is the best way to perform such cleanup?

2017-02-04 19:19 GMT+01:00 Geraldus
I want to perform some cleanup deleting obsolete compilers located in ~/.stack folder. I know stack places them into ~/.stack/programs/< platform>/ directory, however I think there are also should be something else related, e.g. docs and libs, and especially packages that was built when I used old LTS snapshots. [...]
It's good to hear that I'm not alone with such an obvious(?) undocumented use case... :-) I often want to say something like "Nuke away everything related to nightly-X-Y-Z" (garbage-collecting away any GHC on the way, too) or "Nuke GHC X.Y and all related snapshots". The last time I looked at stack's documentation, I couldn't figure out how to do that, so from time to time I completely remove ~/.stack, but that can't be the recommended way to do this. ~/.stack gets *huge* after some time, so some easy administrative interface for it would be nice.

On Mon, Feb 6, 2017 at 10:00 AM, Sven Panne
2017-02-04 19:19 GMT+01:00 Geraldus
: I want to perform some cleanup deleting obsolete compilers located in ~/.stack folder. I know stack places them into ~/.stack/programs/<platfo rm>/ directory, however I think there are also should be something else related, e.g. docs and libs, and especially packages that was built when I used old LTS snapshots. [...]
It's good to hear that I'm not alone with such an obvious(?) undocumented use case... :-) I often want to say something like "Nuke away everything related to nightly-X-Y-Z" (garbage-collecting away any GHC on the way, too) or "Nuke GHC X.Y and all related snapshots". The last time I looked at stack's documentation, I couldn't figure out how to do that, so from time to time I completely remove ~/.stack, but that can't be the recommended way to do this. ~/.stack gets *huge* after some time, so some easy administrative interface for it would be nice.
Personally, I have always just wiped out the entire ~/.stack directory when it gets too big, I just don't have the patience to individually deal with each snapshot directory. If you just want to get rid of the compiled libraries, you can nuke ~/.stack/snapshots instead, but personally I've found it convenient to get rid of my install GHCs occasionally because I usually don't need them all anymore (e.g. I don't need GHC 7.10.2 or 7.8.4 for any code I've been working on in the past few months). Could there be a nice `gc` command to more intelligently delete stuff that hasn't been used recently? Probably, but I don't think the demand has been very high for it: people seem to either not care about disk space much, or don't mind the occasionally tactical nuke. (FWIW: I would also periodically nuke my ~/.cabal and ~/.ghc directories in the past.) Michael

Yeah, I've get used to wipes too, and `stack` made it easy to deal with
consequences. But I think some builtin cleanup algorithm would be really
helpful.
пн, 6 февр. 2017 г. в 13:25, Michael Snoyman
On Mon, Feb 6, 2017 at 10:00 AM, Sven Panne
wrote: 2017-02-04 19:19 GMT+01:00 Geraldus
: I want to perform some cleanup deleting obsolete compilers located in ~/.stack folder. I know stack places them into ~/.stack/programs/<platform>/ directory, however I think there are also should be something else related, e.g. docs and libs, and especially packages that was built when I used old LTS snapshots. [...]
It's good to hear that I'm not alone with such an obvious(?) undocumented use case... :-) I often want to say something like "Nuke away everything related to nightly-X-Y-Z" (garbage-collecting away any GHC on the way, too) or "Nuke GHC X.Y and all related snapshots". The last time I looked at stack's documentation, I couldn't figure out how to do that, so from time to time I completely remove ~/.stack, but that can't be the recommended way to do this. ~/.stack gets *huge* after some time, so some easy administrative interface for it would be nice.
Personally, I have always just wiped out the entire ~/.stack directory when it gets too big, I just don't have the patience to individually deal with each snapshot directory. If you just want to get rid of the compiled libraries, you can nuke ~/.stack/snapshots instead, but personally I've found it convenient to get rid of my install GHCs occasionally because I usually don't need them all anymore (e.g. I don't need GHC 7.10.2 or 7.8.4 for any code I've been working on in the past few months).
Could there be a nice `gc` command to more intelligently delete stuff that hasn't been used recently? Probably, but I don't think the demand has been very high for it: people seem to either not care about disk space much, or don't mind the occasionally tactical nuke.
(FWIW: I would also periodically nuke my ~/.cabal and ~/.ghc directories in the past.)
Michael _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
participants (3)
-
Geraldus
-
Michael Snoyman
-
Sven Panne