<html><head></head><body><div><div><div><div>If this solves a particular use-case and doesn't involve a ton of code, I'd gladly accept a port and hide it behind a flag in cabal-install</div></div><div><div style="display: none; border: 0px; width: 0px; height: 0px; overflow: hidden; visibility: hidden;"><img src="https://r.superhuman.com/WJtod-GZlwXZfGtFipXHn5s3wfBupmOCSovWuAtfWr4-rOO3mOhfqfYsZ-w6RcE6HKTYSyCkewnp6LuQJ-wZKqULLST-967maptnZuOoIpsI7K-ctu5wI9WqJy9DqA913u6dbzOkkl7yhkCmpJK4mlDlHcd-X_E_JcJBHvzGFxd1U2oNch9bKVlIx4Y.gif" alt=" " width="1" height="0" style="display: none; border: 0px; width: 0px; height: 0px; overflow: hidden; visibility: hidden;"/><!--                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                --></div><br/><div class="gmail_signature"></div></div><br/><div><div class="gmail_quote">On Fri, Sep 24, 2021 at 11:53 AM, amindfv--- <span dir="ltr"><<a href="mailto:haskell-cafe@haskell.org" target="_blank">haskell-cafe@haskell.org</a>></span> wrote:<br/><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote sh-color-black sh-color" style="null" id="null"><p class="sh-color-black sh-color">This seems like a useful tool, but the naming might be confusing: "cabal-install" generally means "cabal install" but "cabal-clean" and "cabal clean" have similar goals but behave differently.
</p><p class="sh-color-black sh-color">
Tom
</p><p class="sh-color-black sh-color">
On Fri, Sep 24, 2021 at 07:09:49PM +0200, Andreas Abel wrote:
</p><blockquote class="sh-color-black sh-color"><p class="sh-color-black sh-color">
=== Wondering where your disk space goes with too many Haskell projects
compiled with too many GHC versions? ===
</p><p class="sh-color-black sh-color">
<a target="_blank" rel="noopener noreferrer" href="https://hackage.haskell.org/package/cabal-clean">https:/<wbr/>/<wbr/>hackage.<wbr/>haskell.<wbr/>org/<wbr/>package/<wbr/>cabal-clean</a>
<br/>
<a target="_blank" rel="noopener noreferrer" href="https://github.com/andreasabel/cabal-clean">https:/<wbr/>/<wbr/>github.<wbr/>com/<wbr/>andreasabel/<wbr/>cabal-clean</a>
</p><p class="sh-color-black sh-color">
`cabal-clean` is a small executable that removes outdated cabal build
artifacts from `dist-newstyle`.
</p><p class="sh-color-black sh-color">
A build tree is considered outdated if there is one with either
</p><p class="sh-color-black sh-color">
- a newer version of the package you are building, or
<br/>
- a newer minor version of the GHC compiler.
</p><p class="sh-color-black sh-color">
In contrast to `cabal clean`, the tool `cabal-clean` retains the latest
build trees for each GHC major version.  Thus, it is geared towards
multi-GHC development.
</p><p class="sh-color-black sh-color">
Example: (self-applied to cabal-clean's build directory)
</p><p class="sh-color-black sh-color">
---     3.7M    ghc-8.8.4 /cabal-clean-0.1.20210815
<br/>
---     3.5M    ghc-8.10.6/cabal-clean-0.1.20210815
<br/>
---     3.7M    ghc-9.0.1 /cabal-clean-0.1.20210815
<br/>
---     3.5M    ghc-8.10.6/cabal-clean-0.1.20210924
<br/>
+++     3.6M    ghc-8.10.7/cabal-clean-0.1.20210924
<br/>
+++     3.7M    ghc-9.0.1 /cabal-clean-0.1.20210924
</p><p class="sh-color-black sh-color">
The directories prefixed with --- will be deleted, the ones with +++
retained.
</p><p class="sh-color-black sh-color">
Disclaimers:
</p><p class="sh-color-black sh-color">
1. cabal-clean does not check whether deletion will cause dangling
references like broken symlinks etc.  (Could happen if you created a symlink
to an executable that resides in one of the deleted build directories.)
</p><p class="sh-color-black sh-color">
2. cabal-clean does not read nor utilize information from the .cabal file.
</p><p class="sh-color-black sh-color">
3. Calls `du` ("disk usage"), so, might not work on Windows.
</p><p class="sh-color-black sh-color">
Enjoy,
<br/>
Andreas
<br/>
_______________________________________________
<br/>
Haskell-Cafe mailing list
<br/>
To (un)subscribe, modify options or view archives go to:
<a target="_blank" rel="noopener noreferrer" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http:/<wbr/>/<wbr/>mail.<wbr/>haskell.<wbr/>org/<wbr/>cgi-bin/<wbr/>mailman/<wbr/>listinfo/<wbr/>haskell-cafe</a>
Only members subscribed via the mailman list are allowed to post.
</p></blockquote><p class="sh-color-black sh-color">
_______________________________________________
<br/>
Haskell-Cafe mailing list
<br/>
To (un)subscribe, modify options or view archives go to:
<a target="_blank" rel="noopener noreferrer" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http:/<wbr/>/<wbr/>mail.<wbr/>haskell.<wbr/>org/<wbr/>cgi-bin/<wbr/>mailman/<wbr/>listinfo/<wbr/>haskell-cafe</a>
Only members subscribed via the mailman list are allowed to post.</p></div></div></blockquote></div></div><br/></div></div></body></html>