安装 GHC 后 Haskell 堆栈本地安装失败

问题描述 投票:0回答:1

我正在尝试在本地安装

stack
(我使用的是大学帐户,无法进行系统范围的安装)。我正在遵循手动安装说明。我使用的是 Red Hat 系统。

这是堆栈的输出:

$ ln -s /data/local/ .local
$ ln -s /data/stack/ .stack
$ mv path/to/stack ~/.local/bin/
$ stack install

Writing the configuration file for the implicit global project to:
/data/stack/global-project/stack.yaml. Note: You can change the snapshot via the resolver field
there.
Using the latest snapshot lts-22.6.
Preparing to install GHC (tinfo6-libc6-pre232) to an isolated location. This will not interfere with
any system-level installation.
Preparing to download ghc-tinfo6-libc6-pre232-9.6.3 ...
ghc-tinfo6-libc6-pre232-9.6.3: download has begun
ghc-tinfo6-libc6-pre232-9.6.3:   93.91 MiB / 192.42 MiB ( 48.80%) downloaded...
ghc-tinfo6-libc6-pre232-9.6.3:  192.42 MiB / 192.42 MiB (100.00%) downloaded...
Downloaded ghc-tinfo6-libc6-pre232-9.6.3.
Unpacking GHC into /data/stack/programs/x86_64-linux/ghc-tinfo6-libc6-pre232-9.6.3.temp/ ...
Configuring GHC ...
/data/stack/programs/x86_64-linux/ghc-tinfo6-libc6-pre232-9.6.3.temp/ghc-9.6.3-x86_64-unknown-linux/configure: line 6576: FP_PROG_LD_BUILD_ID: command not found
ar: conftest.a: No such file or directory
Installing GHC ...
Installed GHC.

Error: [S-8506]
       Stack failed to parse the target(s).
       
       While parsing, Stack encountered the error:
       
           The specified targets matched no packages. Perhaps you need to run stack init?
       
       Stack expects a target to be a package name (e.g. my-package), a package identifier (e.g.
       my-package-0.1.2.3), a package component (e.g. my-package:test:my-test-suite), or, failing
       that, a relative path to a directory that is a local package directory or a parent directory
       of one or more local package directories.

我该如何克服这个问题?我的最终目标是能够使用此安装来访问最新的 GHC 并安装可供任何项目使用的软件包。

请注意,我使用的是

/data
目录,因为我的帐户有配额,并且
stack
的安装量大得令人难以置信。我打算在清除所有不必要的垃圾后将其移至我的主目录,因为
/data
是一个临时目录。除了上面的错误之外,我是否还得重写一堆文件来引用
~/.stack
~/.local
而不是
/data/stack
/data/local

haskell haskell-stack
1个回答
0
投票

我会使用 ghcup 来安装 Haskell、Stack 和 Cabal。你能安装ghcup吗?我不确定这是否是系统范围的安装。

© www.soinside.com 2019 - 2024. All rights reserved.