使用ghc 7.8cabal 1.18.1.3cabal-install 1.18.0.2时,我无法编译简单的hello world或使用cabal install安装软件包。

从命令提示符处执行cabal install stm(或任何其他软件包)时,Windows显示“ghc.exe已停止工作”窗口,输出为:

Reading available packages...
Choosing modular solver.
Resolving dependencies...
Ready to install stm-2.4.2
Extracting
Waiting for install task to finish...
C:\Users\%USER%\AppData\Roaming\cabal\packages\hackage.haskell.org\stm\2.4.2\stm-2.4.2.tar.gz
to C:\Users\%USER%\AppData\Local\Temp\stm-2.4.2-6556...
Updating stm.cabal with the latest revision from the index.
Configuring stm-2.4.2...
creating C:\Users\%USER%\AppData\Local\Temp\stm-2.4.2-6556\stm-2.4.2\dist\setup
creating C:\Users\%USER%\AppData\Local\Temp\stm-2.4.2-6556\stm-2.4.2\dist
creating C:\Users\%USER%\AppData\Local\Temp\stm-2.4.2-6556\stm-2.4.2\dist\setup
"c:\ghc-7.8.0\bin\ghc.exe" "--make" "-odir" "C:\Users\%USER%\AppData\Local\Temp\stm-2.4.2-6556\stm-2.4.2\dist\setup" "-hidir" "C:\Users\%USER%\AppData\Local\Temp\stm-2.4.2-6556\stm-2.4.2\dist\setup" "-i" "-iC:\Users\%USER%\AppData\Local\Temp\stm-2.4.2-6556\stm-2.4.2" "-package-id" "Cabal-1.18.1.3-ac8664a5c71d605f2a4a8e21170969e0" "C:\Users\%USER%\AppData\Local\Temp\stm-2.4.2-6556\stm-2.4.2\dist\setup\setup.hs" "-o" "C:\Users\%USER%\AppData\Local\Temp\stm-2.4.2-6556\stm-2.4.2\dist\setup\setup.exe"
Failed to install stm-2.4.2
Last 10 lines of the build log ( C:\Users\%USER%\AppData\Roaming\cabal\logs\stm-2.4.2.log ):
World file is already up to date.
cabal.exe: Error: some packages failed to install:
stm-2.4.2 failed during the configure step. The exception was:
user error

我通过以下步骤安装(?)GHC 7.8cabal-install
  • 下载了GHC 7.8 RC2(http://www.haskell.org/ghc/dist/7.8.1-rc2/ghc-7.8.0.20140228-i386-unknown-mingw32.tar.bz2)
  • 将tar的内容提取到$ GHC $文件夹
  • 将$ GHC $ \ bin和$ GHC $ \ mingw \ bing文件夹添加到PATH。
  • 下载预建的cabal-install(
    http://www.haskell.org/cabal/release/cabal-install-1.18.0.2/cabal.exe)
  • 将cabal.exe复制到$ GHC $ \ bin,因此它位于
  • 路径中
  • 运行cabal update
  • 运行cabal install stm(或任何其他软件包)

  • 在执行所有这些操作之前,我卸载了以前的Haskell平台,从%USER%\AppData\Roaming删除了cabal和ghc文件夹,并从Program Files文件夹中删除了其他haskell的东西。

    我不确定GHC是否需要任何其他安装步骤

    我需要GHC 7.8,因为我想试用GHCJS。

    PS :

    我还向我的env变量添加了LANG=C,以便编译不会引发UTF-8编码错误。
    cabal --version 显示:
    cabal-install version 1.18.0.2
    using version 1.18.1 of the Cabal library
    

    除了cabal库显示为1.18.1而不是1.18.1.3,这似乎还可以,但是我不确定这是一个错误。
    ghc-pkg list显示:
    c:/ghc-7.8.0\lib\package.conf.d:
    Cabal-1.18.1.3
    Win32-2.3.0.1
    array-0.5.0.0
    base-4.7.0.0
    bin-package-db-0.0.0.0
    binary-0.7.1.0
    rts-1.0
    bytestring-0.10.4.0
    containers-0.5.4.0
    deepseq-1.3.0.2
    directory-1.2.0.2
    filepath-1.3.0.2
    (ghc-7.8.0.20140228)
    ghc-prim-0.3.1.0
    (haskell2010-1.1.1.1)
    (haskell98-2.0.0.3)
    hoopl-3.10.0.0
    hpc-0.6.0.1
    integer-gmp-0.5.1.0
    old-locale-1.0.0.6
    old-time-1.1.0.2
    pretty-1.1.1.1
    process-1.2.0.0
    template-haskell-2.9.0.0
    time-1.4.1
    transformers-0.3.0.0
    

    **编辑**:尝试通过进入其文件夹并运行ghc手动编译stm,将生成相同的错误窗口并给出输出:

    编辑2 :实际上,我什至无法使用ghc helloworld.hs编译一个简单的hello世界:

    main = putStrLn“您好,世界!”

    使用“-v3”进行编译将提供以下(非参考性)输出:
    Glasgow Haskell Compiler, Version 7.8.0.20140228, stage 2 booted by GHC version 7.6.3
    Using binary package database: C:\ghc-7.8.0\lib\package.conf.d\package.cache
    wired-in package ghc-prim mapped to ghc-prim-0.3.1.0-ce20d91f79b43ede95508e8cfd2188b0
    wired-in package integer-gmp mapped to integer-gmp-0.5.1.0-67cd00feecdc491a633c46b0f7652b46
    wired-in package base mapped to base-4.7.0.0-d4a0afe8e5c5f0dff2237b1231b56978
    wired-in package rts mapped to builtin_rts
    wired-in package template-haskell mapped to template-haskell-2.9.0.0-f798cb95c80f3e3751ec33b413381b57
    wired-in package dph-seq not found.
    wired-in package dph-par not found.
    Hsc static flags:
    wired-in package ghc-prim mapped to ghc-prim-0.3.1.0-ce20d91f79b43ede95508e8cfd2188b0
    wired-in package integer-gmp mapped to integer-gmp-0.5.1.0-67cd00feecdc491a633c46b0f7652b46
    wired-in package base mapped to base-4.7.0.0-d4a0afe8e5c5f0dff2237b1231b56978
    wired-in package rts mapped to builtin_rts
    wired-in package template-haskell mapped to template-haskell-2.9.0.0-f798cb95c80f3e3751ec33b413381b57
    wired-in package dph-seq not found.
    wired-in package dph-par not found.
    *** Chasing dependencies:
    Chasing modules from: *asd.hs
    Stable obj: []
    Stable BCO: []
    Ready for upsweep
      [NONREC
          ModSummary {
             ms_hs_date = 2014-03-10 04:11:51 UTC
             ms_mod = main:Main,
             ms_textual_imps = [import (implicit) Prelude]
             ms_srcimps = []
          }]
    *** Deleting temp files:
    Deleting:
    compile: input file asd.hs
    Created temporary directory: C:\Users\facuq\AppData\Local\Temp\ghc6824_1
    *** Checking old interface for main:Main:
    [1 of 1] Compiling Main             ( asd.hs, asd.o )
    *** Parser:
    *** Renamer/typechecker:
    *** Desugar:
    Result size of Desugar (after optimization)
      = {terms: 7, types: 5, coercions: 0}
    *** Simplifier:
    Result size of Simplifier = {terms: 7, types: 5, coercions: 0}
    *** Tidy Core:
    Result size of Tidy Core = {terms: 7, types: 5, coercions: 0}
    *** CorePrep:
    Result size of CorePrep = {terms: 9, types: 6, coercions: 0}
    *** Stg2Stg:
    *** CodeOutput:
    *** New CodeGen:
    *** CPSZ:
    *** CPSZ:
    

    最佳答案

    实际上,这是GHC中的错误;它已在GHC邮件列表中得到确认,两个人可以复制它(ghc's bug manager thread)。

    07-24 09:44
    查看更多