简体   繁体   English

在 Osx 10.15.3 上安装 ghc-mod 失败(已尝试使用 lts-8.24)

[英]Install the ghc-mod fails on Osx 10.15.3(already try with lts-8.24)

I am new to haskell and want to deploy haskell on vs code.我是haskell 的新手,想在vs 代码上部署haskell。 When I try to install ghc-mod by using "stack install ghc-mod --resolver lts-8.24".当我尝试使用“stack install ghc-mod --resolver lts-8.24”安装 ghc-mod 时。 The action fails.动作失败。 If anyone could help me, it would be so appreciated!如果有人可以帮助我,将不胜感激! The erro log is as follow:错误日志如下:

happy           >      warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
happy           >
happy           > /Users/a2/.stack/programs/x86_64-osx/ghc-8.0.2/lib/ghc-8.0.2/include/rts/storage/ClosureMacros.h:503:56: error:
happy           >      note: expanded from macro 'ZERO_SLOP_FOR_SANITY_CHECK'
happy           > #define ZERO_SLOP_FOR_SANITY_CHECK (defined(DEBUG) && !defined(THREADED_RTS))
happy           >                                                        ^
happy           > 9 warnings generated.
happy           > clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
happy           > copy/register
happy           > Installing executable(s) in
happy           > /Users/a2/.stack/snapshots/x86_64-osx/e87c8df95ec9518f8408232a2e3513d766cdb2d97a442d1257a73460a8d14994/8.0.2/bin

--  While building package profunctors-5.2 using:
      /Users/a2/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 build --ghc-options ""
    Process exited with code: ExitFailure 1

If you just want to get haskell working on vscode, then I found ghcide to work very well.如果你只是想让 haskell 在 vscode 上工作,那么我发现 ghcide 工作得很好。

https://github.com/digital-asset/ghcide https://github.com/digital-asset/ghcide

Check it out to a local directory, and modify the stack.yaml that comes with it so that it has the same resolver as the project that you want to work with.将其检出到本地目录,并修改随附的 stack.yaml,使其与您要使用的项目具有相同的解析器。

eg change this line:例如改变这一行:

resolver: nightly-2019-09-21解析器:nightly-2019-09-21

to:到:

resolver: lts-14.12解析器:lts-14.12

Then install it using: (make a note of where it puts the executable)然后使用:(记下它放置可执行文件的位置)

stack install堆栈安装

Finally, open vscode and add the ghcide extension and point it to your ghcide executable in the configuration.最后,打开 vscode 并添加 ghcide 扩展并将其指向配置中的 ghcide 可执行文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM