Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent stack from downloading GHC for every new project?

How to prevent stack from downloading GHC for every new project?

Every time I create a new project using stack and then build or exec the codes, stack will install a new GHC for me. This is not only boring for waiting such a long time for a huge image to be downloaded (behind the GFW, xKib/s), but also a space disaster for my pity 128G SSD Macbook Pro. How can I fix this?

$ stack exec blah
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
ghc-8.4.4:   15.98 KiB / 220.05 MiB (  0.01%) downloaded...^C
like image 464
cmal Avatar asked Nov 20 '18 03:11

cmal


People also ask

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.

How do I know if stack is installed?

You can also find the server details using following steps: http: <hostname:portn0>\index. html -> click on system information-> login with admin rights -> you can get all details about the installed server.

Where does stack install packages?

Stack installs the Stackage libraries in ~/. stack and any project libraries or extra dependencies in a . stack-work directory within each project's directory.

What does stack Ghci do?

stack ghci allows you to load components and files of your project into ghci . It uses the same TARGET syntax as stack build , and can also take options like --test , --bench , and --flag . Similarly to stack build , the default is to load up ghci with all libraries and executables in the project.


1 Answers

Just find $HOME/.stack.yaml and add:

# Turn on system GHC
system-ghc: true

and run the same command again.

like image 54
cmal Avatar answered Sep 20 '22 16:09

cmal