Install ghcjs from the stack

I have GHC installed via the stack (so stack ghc -- --version shows GHC-7.10.3)

 $ stack install ghcjs Run from outside a project, using implicit global project config Using resolver: lts-5.2 from implicit global project config file: /home/john/.stack/global-project/stack.yaml The following target packages were not found: ghcjs 

Some resources offer ghcjs somewhat experimentally (albeit in subsequent steps).


Looking at http://docs.haskellstack.org/en/stable/ghcjs/ I was thinking maybe I could find stack.yaml and change it.

To use GHCJS with a stack> = 0.1.8, put the version of GHCJS in the compiler field stack.yaml ... then stack setup

 $ cat ~/.stack/global-project/stack.yaml # This is the implicit global project config file, which is only used when # 'stack' is run outside of a real project. Settings here do _not_ act as # defaults for all projects. To change stack default settings, edit # '/home/john/.stack/config.yaml' instead. # # For more information about stack configuration, see # http://docs.haskellstack.org/en/stable/yaml_configuration.html # flags: {} extra-package-dbs: [] packages: [] extra-deps: [] resolver: lts-5.2 

We are told to look at config.yaml , which looks equally empty. Is it even right, am I going to a dead end?

 $ cat ~/.stack/config.yaml # This file contains default non-project-specific settings for 'stack', used # in all projects. For more information about stack configuration, see # http://docs.haskellstack.org/en/stable/yaml_configuration.html # {} 

I just want to install ghcjs with a stack.

+5
source share
1 answer

Have a look at this page: http://docs.haskellstack.org/en/stable/ghcjs/

I would try:

  • Run a new stack project, for example. stack new js-test

  • Modify the stack.yaml file to add this stanza (taken from the above link):

     compiler: ghcjs-0.2.0.20160414_ghc-7.10.3 compiler-check: match-exact setup-info: ghcjs: source: ghcjs-0.2.0.20160414_ghc-7.10.3: url: https://s3.amazonaws.com/ghcjs/ghcjs-0.2.0.20160414_ghc-7.10.3.tar.gz sha1: 6d6f307503be9e94e0c96ef1308c7cf224d06be3 
  • Change resolver: to lts-5.12 - this corresponds to the above stanza.

  • Run stack setup to install the compiler.

Step 4 will take some time.

+9
source

All Articles