在nixos上运行'stack setup'后'configure:error:无法确定当前目录'

时间:2017-07-13 01:58:52

标签: haskell-stack nixos

我尝试在nixos上运行stack setup并收到以下错误。

$ stack setup
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.                
Running /home/matthew/.stack/programs/x86_64-linux/ghc-8.0.2.temp/ghc-8.0.2/configure --prefix=/home/matthew/.stack/programs/x86_64-linux/ghc-8.0.2/ in directory /home/matthew/.stack/programs/x86_64-linux/ghc-8.0.2.temp/ghc-8.0.2/ exited with ExitFailure 1

checking for path to top of build tree...
/home/matthew/.stack/programs/x86_64-linux/ghc-8.0.2.temp/ghc-8.0.2/configure: utils/ghc-pwd/dist-install/build/tmp/ghc-pwd-bindist: /bin/bash: bad interpreter: No such file or directory
configure: error: cannot determine current directory


Error: Error encountered while configuring GHC with
         /home/matthew/.stack/programs/x86_64-linux/ghc-8.0.2.temp/ghc-8.0.2/configure --prefix=/home/matthew/.stack/programs/x86_64-linux/ghc-8.0.2/
         run in /home/matthew/.stack/programs/x86_64-linux/ghc-8.0.2.temp/ghc-8.0.2/

The following directories may now contain files, but won't be used by stack:
  - /home/matthew/.stack/programs/x86_64-linux/ghc-8.0.2.temp/
  - /home/matthew/.stack/programs/x86_64-linux/ghc-8.0.2/

Configuring GHC ...

似乎该错误是由于nixos没有传统的/bin/bash位置(bash位于/run/current-system/sw/bin/bash而非我的nixos设置)。

引发了类似的错误here - 这个问题显然是通过更新堆栈来解决的,但我已经有了堆栈的最新版本,所以我的问题必须是不同的。

我应该运行$ ln -s /run/current-system/sw/bin/bash /bin/bash,在bash路径堆栈中创建一个符号链接似乎是期望的吗?或者是否有某种方式可以通知堆栈我的系统的bash位置?

除了找到一个可以简单解决的解决方案之外,我还想知道是否有一个特定的解决方案与nixos的不变性,可再现性等哲学相一致。

0 个答案:

没有答案