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
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.
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.
Stack installs the Stackage libraries in ~/. stack and any project libraries or extra dependencies in a . stack-work directory within each project's directory.
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.
Just find $HOME/.stack.yaml
and add:
# Turn on system GHC
system-ghc: true
and run the same command again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With