本文介绍了从堆栈安装ghcjs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过堆栈安装了GHC(这样 stack ghc - --version 显示GHC-7.10.3)

  $ stack install ghcjs 

使用隐式全局项目config
从项目外部运行使用resolver:lts-5.2从隐式全局项目配置文件:/home/john/.stack/global-project/stack.yaml
未找到以下目标软件包:ghcjs

有些资源建议 ghcjs 有点实验性(尽管在更进一步的阶段)。




查看我想也许我可以找到 stack.yaml 并更改
$ b



  $ cat 〜/ .stack / global-project / stack.yaml 
#这是隐式全局项目的配置文件,仅当
#'stack'在真实项目之外运行时才会使用。这里的设置不适用于所有项目的
#默认值。要更改堆栈的默认设置,请改为编辑
#'/home/john/.stack/config.yaml'。

#有关堆栈配置的更多信息,请参阅
#http://docs.haskellstack.org/en/stable/yaml_configuration.html

flags :{}
extra-package-dbs:[]
packages:[]
extra-deps:[]
resolver:lts-5.2

我们被告知看看 config.yaml ,它看起来同样空白。这是对的吗,我会走上死路?

  $ cat〜/ .stack / config.yaml 
#此文件包含默认的非项目特定设置'stack',在所有项目中使用
#。有关堆栈配置的更多信息,请参阅
#http://docs.haskellstack.org/en/stable/yaml_configuration.html

{}

我只想在堆栈中安装 ghcjs

解决方案

查看本页:



我会尝试:


  1. 开始一个新的堆栈项目,例如 stack new js-test


  2. 通过添加此节来修改stack.yaml文件上面提到的链接):

     编译器:ghcjs-0.2.0.20160414_ghc-7.10.3 
    编译器检查:匹配-exact
    setup-info:
    ghcjs:
    来源:
    ghcjs-0.2.0.20160414_ghc-7.10.3:
    网址:https://s3.amazonaws .com / ghcjs / ghcjs-0.2.0.20160414_ghc-7.10.3.tar.gz
    sha1:6d6f307503be9e94e0c96ef1308c7cf224d06be3


  3. 解析器:更改为lts-5.12 - 与上面的节匹配。


  4. 运行 stack setup 以安装编译器。




第4步需要一段时间。


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.

$ 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.

解决方案

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.

这篇关于从堆栈安装ghcjs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 05:31