我正在尝试在启用了 docker 集成的堆栈项目中使用 intero-mode。因此它的 stack.yml 包含:
docker:
enable: true
image: my-project/build:lts-11.9
即使,当我打开项目中的任何 .hs 文件时,intero-mode 也会尝试安装 intero 可执行文件并失败。在消息缓冲区中,它报告:
Installed successfully! Starting Intero in a moment ...
Booting up intero ...
Problem with Intero!
Reading Haskell configuration failed with exit code 1 and output:
get-cabal-configuration.hs: /home/jesuspc/.nix-profile/bin/hpack: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
我得到了 intero-mode 的错误屏幕:
...
The process ended. Here is the reason that Emacs gives us:
exited abnormally with code 1
For troubleshooting purposes, here are the arguments used to launch intero:
stack ghci --with-ghc /home/jesuspc/.stack/compiler-tools/x86_64-linux-dke094d5208e8a802cb369cecdad3049ae/ghc-8.2.2/bin/intero "--docker-run-args=--interactive=true --tty=false" --no-build --no-load --ghci-options -ignore-dot-ghci my-project
...
当我运行该行时,我得到:
Did not find executable at specified path: /home/jesuspc/.stack/compiler-tools/x86_64-linux-dke094d5208e8a802cb369cecdad3049ae/ghc-8.2.2/bin/intero
这可能与nix有关,因为我发现通过运行代替:
stack ghci --with-ghc /home/jesuspc/.stack/compiler-tools/x86_64-linux-nix/ghc-8.2.2/bin/intero "--docker-run-args=--interactive=true --tty=false" --no-build --no-load --ghci-options -ignore-dot-ghci my-project
我得到一个不同的错误:
/home/jesuspc/.stack/compiler-tools/x86_64-linux-nix/ghc-8.2.2/bin/intero: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
我相信可能会抛出这个错误,因为我的项目使用了外部库并且找不到它们,但这只是一个猜测。
intero-mode 是否知道 stack-docker 集成?它似乎试图在我的本地机器中使用 intero 可执行文件,而不是使用所有必需库都存在的 docker 上下文。我该如何解决?