Haskell 如何在没有堆栈的情况下运行shake
我从以下位置创建了推荐的Haskell 如何在没有堆栈的情况下运行shake,haskell,cabal-install,shake-build-system,cabal-new,Haskell,Cabal Install,Shake Build System,Cabal New,我从以下位置创建了推荐的build.sh文件: #/垃圾箱/垃圾箱 mkdir-p_-shake ghc—make Shakefile.hs-v-rtsopts-threaded-with rtsopts=-I0-outputdir=\u shake-o\u shake/build&&u shake/build“$@” 但运行该脚本会出现以下错误: [1 of 1] Compiling Main ( Shakefile.hs, _shake/Main.o ) Shak
build.sh
文件:
#/垃圾箱/垃圾箱
mkdir-p_-shake
ghc—make Shakefile.hs-v-rtsopts-threaded-with rtsopts=-I0-outputdir=\u shake-o\u shake/build&&u shake/build“$@”
但运行该脚本会出现以下错误:
[1 of 1] Compiling Main ( Shakefile.hs, _shake/Main.o )
Shakefile.hs:1:1: error:
Could not find module ‘Development.Shake’
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
1 | import Development.Shake
| ^^^^^^^^^^^^^^^^^^^^^^^^
Shakefile.hs:2:1: error:
Could not find module ‘Development.Shake.Command’
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
2 | import Development.Shake.Command
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Shakefile.hs:3:1: error:
Could not find module ‘Development.Shake.FilePath’
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
3 | import Development.Shake.FilePath
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Shakefile.hs:4:1: error:
Could not find module ‘Development.Shake.Util’
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
4 | import Development.Shake.Util
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
我确实安装了cabalv2 shake--installpath=bin,但之后仍然出现相同的错误。我也尝试了bin/shake
,但得到了相同的错误
我尝试将-package shake
添加到build.sh
中的ghc
命令中,但出现以下错误:
<command line>: cannot satisfy -package shake
(use -v for more information)
Glasgow Haskell Compiler, Version 8.8.4, stage 2 booted by GHC version 8.8.3
Using binary package database: /Users/avh4/.ghcup/ghc/8.8.4/lib/ghc-8.8.4/package.conf.d/package.cache
package flags [-package shake{package shake True ([])}]
loading package database /Users/avh4/.ghcup/ghc/8.8.4/lib/ghc-8.8.4/package.conf.d
<command line>: cannot satisfy -package shake
(use -v for more information)
使用Shake而不使用的正确方法是什么(最好只使用安装了
ghcup
和/或cabal install v2命令的ghc 8.8)?我发现我需要在cabal new install
中使用--lib
标志,否则只安装Shake二进制文件
运行cabal new install--lib shake
后,原来的build.sh
脚本以及-package shake
添加到ghc
参数中的现在可以工作了!而且runhaskell-package shake Shakefile.hs现在也可以工作了