install ghcjs from stack

非 Y 不嫁゛ 提交于 2019-12-10 14:19:25

问题


I have GHC installed through stack ( so that 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's config file: /home/john/.stack/global-project/stack.yaml
The following target packages were not found: ghcjs

Some resources suggest ghcjs is somewhat experimental (though in the further stages).


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

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

$ cat ~/.stack/global-project/stack.yaml
# This is the implicit global project's 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's default settings, edit
# '/home/john/.stack/config.yaml' instead.
#
# For more information about stack's 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 blank. Is this even right, am I going up 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's configuration, see
# http://docs.haskellstack.org/en/stable/yaml_configuration.html
#
{}

I just want to install ghcjs with stack.


回答1:


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

I would try:

  1. Start a new stack project, e.g. stack new js-test

  2. Modify the stack.yaml file by adding this stanza (taken from the above mentioned 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
    
  3. Change the resolver: to lts-5.12 - this matches the above stanza.

  4. Run stack setup to get the compiler installed.

Step 4 will take a while.



来源:https://stackoverflow.com/questions/37254692/install-ghcjs-from-stack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!