3

Shake マニュアルの「実行」セクションから推奨build.shファイルを作成しました。

#!/bin/sh
mkdir -p _shake
ghc --make Shakefile.hs -v -rtsopts -threaded -with-rtsopts=-I0 -outputdir=_shake -o _shake/build && _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
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

しましたcabal v2-install shake --installpath=binが、その後も同じエラーが発生します。私も試しbin/shakeましたが、同じエラーが発生します。

-package shakeghcコマンドに追加しようとしましたが、次のbuild.shエラーが発生します。

<command line>: cannot satisfy -package shake
    (use -v for more information)

提案どおりに追加する-vと、次のエラーが発生します。

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)

Haskell スタックなしでShakeを使用する正しい方法は何ghcupですか?

4

1 に答える 1