Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

emacs hangs with "initializing" when opening haskell file for first time #923

Closed
thkoch2001 opened this issue Dec 26, 2017 · 11 comments
Closed

Comments

@thkoch2001
Copy link

I evaluated (setq ghc-debug t). After load a haskell file and interrupting with CTRL-g the GHC Debug buffer says:

% ghc-mod root
/home/thk/git/hspgtest
% boot
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]: /usr/lib/x86_64-linux-ghc-8.0.2/cabal-helper-0.7.3.0

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
ghc-mod: thread blocked indefinitely in an MVar operation
% check /home/thk/git/hspgtest/src/Main.hs
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]: /usr/lib/x86_64-linux-ghc-8.0.2/cabal-helper-0.7.3.0

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
ghc-mod: thread blocked indefinitely in an MVar operation

ghc-mod and ghc-mod-el are debian version 5.8.0.0-1.

@DanielG
Copy link
Owner

DanielG commented Dec 27, 2017

How did you install ghc-mod? Looks like a distribution installation since the paths point to /usr/lib but I can't say for certain.

@thkoch2001
Copy link
Author

It is the Debian packet ghc-mod together with ghc-mod-el, version 5.8.0.0-1.

@DanielG
Copy link
Owner

DanielG commented Dec 29, 2017

This appears to be a Debian packaging specific issue, I've submitted a patch to fix this there: https://anonscm.debian.org/cgit/pkg-haskell/DHG_packages.git/commit/?id=6e863e89f74cca1087bad96869efe5f4e7155c4f. You can subscribe to the corresponding debian bug (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878112) to be notified when the fixed version is uploaded.

@thkoch2001
Copy link
Author

Thank you Daniel. However, even after updating to cabal-helper 0.7.3.0-3, which includes the linked patch, I still have the exact same output from ghc-debug.

@thkoch2001
Copy link
Author

thkoch2001 commented Dec 30, 2017

I've done export cabal_helper_libexecdir=/usr/lib now before starting emacs and it works. So I have a workaround.

@DanielG
Copy link
Owner

DanielG commented May 31, 2018

Fixed in Debian in haskell-cabal-helper 0.7.3.0-3

@DanielG DanielG closed this as completed May 31, 2018
@skalyan91
Copy link

This is still an issue in Ubuntu 18.04. Adding (shell-command "export cabal_helper_libexecdir=/usr/lib") to the Emacs init file makes it go away, though.

@DanielG
Copy link
Owner

DanielG commented Jul 1, 2018

@skalyan91 I suggest you contact the Ubuntu package maintainer and link them to the patch which fixes this. https://bugs.launchpad.net/ubuntu/+source/cabal-helper/+filebug

Scratch that, looks to me like they pulled in the relevant cabal-helper version already: Ubuntu changelog. Are you sure you have cabal-helper version 0.7.3.0-3 installed?

@salva
Copy link

salva commented Nov 12, 2018

Running Ubuntu 18.04.1 here. Emacs is still hanging at the "Initializing" stage.

$ zcat /usr/share/doc/cabal-helper/changelog.Debian.gz |head
haskell-cabal-helper (0.7.3.0-3) unstable; urgency=medium

  [ Ilias Tsitsimpis ]
  * Change Priority to optional. Since Debian Policy version 4.0.1,
    priority extra has been deprecated.
  * Use the HTTPS form of the copyright-format URL
  * Modify d/watch and Source field in d/copyright to use HTTPS

  [ Daniel Gröber ]
  * Add patch to disable $libexec hacks.  closes: #878112.

Under the hood, ghc-mod is looking for cabal-helper-wrapper in the wrong place, at /usr/lib/x86_64-linux-ghc-8.0.2/cabal-helper-0.7.3.0/cabal-helper-wrapper when actually, it is located at /usr/lib/cabal-helper-wrapper.

@DanielG
Copy link
Owner

DanielG commented Nov 12, 2018

@salva I just did a fresh 18.04 install and cabal-helper itself works just fine (in GHCi). Indeed ghc-mod itself does fail like you describe. Looks like the binary package never got rebuilt after cabal-helper was updated. This is certainly an issue for the Ubuntu package maintainers, please report it: https://launchpad.net/ubuntu/+source/ghc-mod/+bugs.

@salva
Copy link

salva commented Nov 13, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants