Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove old build plans installed by Haskell stack?

How can I remove old build plans (GHC compiler and packages) installed by the stack tool?

like image 283
Kwang Yul Seo Avatar asked Aug 30 '16 12:08

Kwang Yul Seo


People also ask

Where are Haskell packages stored?

By default stack installs packages to ~/. cabal and ~/. ghc in your home directory.

Where is Haskell stack installed?

Stack-built files generally go in either the Stack root directory (default: ~/. stack on Unix-like operating systems, or, %LOCALAPPDATA%\Programs\stack on Windows) or ./. stack-work directories local to each project. The Stack root directory holds packages belonging to snapshots and any Stack-installed versions of GHC.

Should I use cabal or stack?

AFAIU stack is handy to quickly work on an existing project. If you start something from scratch, you will certainly have to use cabal.

Where does stack install GHC?

You can find these sandboxed GHC installations in the ghc-* directories in the stack path --programs directory. If you would like Stack to use your system GHC installation, use the --system-ghc flag or run stack config set system-ghc --global true to make Stack check your PATH for a suitable GHC by default.


1 Answers

I would poke around ~/.stack and delete whatever files you don't want anymore:

  • compiled libraries for a resolver in ~/.stack/snapshots/...
  • compiler toolchains in ~/.stack/programs/...
  • build plan yaml files in ~/.stack/build-plan/...
like image 112
ErikR Avatar answered Oct 04 '22 16:10

ErikR