LoginSignup
2
2

More than 5 years have passed since last update.

ghc-modでcabal-helper-wrapperが見つからない問題の対応

Last updated at Posted at 2015-06-07

maoeさんのこの方法 がすごく気に入っていて cabal とか ghc-mod とかこの方法でばんばん放り込んでいたのだけど、ある日突然 Emacs でシンタックスチェックが効かなくなった。Emacsの ghc-mode は裏で ghc-modi コマンドを使っているのでこれを叩いてみれば原因を切り分けられる。

% ghc-modi
ghc-mod: Could not find $libexecdir/cabal-helper-wrapper

If you are a developer set the environment variable
`cabal_helper_libexecdir' to override $libexecdir[1]. The following will
work in the cabal-helper source tree:

    $ export cabal_helper_libexecdir=$PWD/dist/build/cabal-helper-wrapper

[1]: /private/tmp/cabal-install-1.22.4.0/.cabal-sandbox/libexec

If you don't know what I'm talking about something went wrong with your
installation. Please report this problem here:

    https://github.com/DanielG/cabal-helper/issues

cabal-helper-wrapper が見つからないのが原因っぽい。どうしてこうなるかは cabal-helpercabalファイルを見る とわかる。

  X-Install-Target:    $libexecdir

先ほどのmaoeさんの方法でさらにlibexecも指定してやると良さげ。

% cabal get cabal-helper
% cd cabal-helper-0.3.4.0
% cabal sandbox init
% cabal install --bindir ~/.cabal/bin --datadir ~/.cabal/share --libexecdir ~/.cabal/libexec

--libexecdir~/.cabal/bin を指定するのも考えたけど、理由があってこうしてるならやだなと思って避けておいた。ただし、このままだと libexec は sandbox 内を向いてしまうので、先ほど ghc-modi を実行した時のエラーメッセージを参考に以下を .zshenv に書いておいた。

export cabal_helper_libexecdir=$HOME/.cabal/libexec
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2