在 Mac 上使用 ghcup 和 cabal 进行 ghc 编译时遇到问题(在路径中找不到已安装的软件包)
我在编译我的 Hakyll 站点时遇到问题(我知道它可以编译;问题是 ghc 找不到我通过 cabal 安装的模块(并且最近通过 ghcup 干净地安装了这两个模块)。我使用的是新的 M1我猜测 MacBook Pro 是导致此问题的原因。
ghc --make site.hs
上的错误:无法找到模块“Hakyll”
,同样的情况。 Pandoc 和其他模块。
更多信息:
我通过 ghcup 安装了 ghc 和 cabal,可以在 /Users/isaac/.ghcup/bin/ghc
和 /Users/isaac/ 中找到。 Hakyll 模块位于
~/.cabal/packages/hackage.haskell.org
中。
Pandoc和 -v 给我以下内容:
isaac@machine notes % ghc -v
Glasgow Haskell Compiler, Version 8.10.7, stage 2 booted by GHC version 8.10.3
*** initializing package database:
Using binary package database: /Users/isaac/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/package.conf.d/package.cache
package flags []
loading package database /Users/isaac/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/package.conf.d
wired-in package ghc-prim mapped to ghc-prim-0.6.1
wired-in package integer-wired-in mapped to integer-gmp-1.0.3.0
wired-in package base mapped to base-4.14.3.0
wired-in package rts mapped to rts
wired-in package template-haskell mapped to template-haskell-2.16.0.0
wired-in package ghc mapped to ghc-8.10.7
!!! initializing package database: finished in 9.01 milliseconds, allocated 8.229 megabytes
*** Deleting temp files:
Deleting:
*** Deleting temp dirs:
Deleting:
ghc: no input files
Usage: For basic information, try the `--help' option.```
I'm having trouble compiling my Hakyll site (I know it compiles; the issues is ghc can't find modules that I've installed via cabal (and both of these cleanly installed recently via ghcup). I'm on a new M1 MacBook Pro which I'm guessing is contributing to this problem.
The error upon ghc --make site.hs
: Could not find module ‘Hakyll’
and the same for Pandoc and other modules.
More info:
I've installed ghc and cabal via ghcup, which are found at /Users/isaac/.ghcup/bin/ghc
and /Users/isaac/.ghcup/bin/cabal
. The Pandoc and Hakyll modules are found in ~/.cabal/packages/hackage.haskell.org
.
ghc -v
gives me the following:
isaac@machine notes % ghc -v
Glasgow Haskell Compiler, Version 8.10.7, stage 2 booted by GHC version 8.10.3
*** initializing package database:
Using binary package database: /Users/isaac/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/package.conf.d/package.cache
package flags []
loading package database /Users/isaac/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/package.conf.d
wired-in package ghc-prim mapped to ghc-prim-0.6.1
wired-in package integer-wired-in mapped to integer-gmp-1.0.3.0
wired-in package base mapped to base-4.14.3.0
wired-in package rts mapped to rts
wired-in package template-haskell mapped to template-haskell-2.16.0.0
wired-in package ghc mapped to ghc-8.10.7
!!! initializing package database: finished in 9.01 milliseconds, allocated 8.229 megabytes
*** Deleting temp files:
Deleting:
*** Deleting temp dirs:
Deleting:
ghc: no input files
Usage: For basic information, try the `--help' option.```
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论