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

HIE fails when run from within VSCode #483

Closed
marmistrz opened this issue Feb 28, 2018 · 13 comments
Closed

HIE fails when run from within VSCode #483

marmistrz opened this issue Feb 28, 2018 · 13 comments

Comments

@marmistrz
Copy link

marmistrz commented Feb 28, 2018

cross-reporting haskell/vscode-haskell#54

2018-02-28 11:25:30.079606543 [ThreadId 4] - Setting home directory:/home/marcin
2018-02-28 11:25:30.08072305 [ThreadId 4] - run entered for HIE Version 0.1.0.0, Git revision dd262b8283b3584d9d106bc842eae894826495ca (1205 commits) x86_64 ghc-8.2.2
2018-02-28 11:25:30.081598744 [ThreadId 4] - Current directory:/home/marcin
hie: Could not find $libexecdir/cabal-helper-wrapper

If you are a cabal-helper developer you can 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]: /home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/libexec/x86_64-linux-ghc-8.2.2/cabal-helper-0.8.0.2

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

I installed haskell-ide-engine-git from AUR (Arch Linux). I can't find cabal-helper-wrapper anywhere in my FS.

@alanz
Copy link
Collaborator

alanz commented Feb 28, 2018

Make sure you have cabal-helper installed, and perhaps cabal-install.

@marmistrz
Copy link
Author

It looks like the AUR package didn't pull cabal-helper as a dependency. I took it from the repos. The wrapper is now in

/usr/lib/x86_64-linux-ghc-8.2.2/cabal-helper-0.8.0.2/cabal-helper-wrapper

Still, after installing, hie seems to insist on using the build root location instead:

2018-02-28 16:44:26.355238933 [ThreadId 4] - Setting home directory:/home/marcin
2018-02-28 16:44:26.35687703 [ThreadId 4] - run entered for HIE Version 0.1.0.0, Git revision dd262b8283b3584d9d106bc842eae894826495ca (1205 commits) x86_64 ghc-8.2.2
2018-02-28 16:44:26.35786075 [ThreadId 4] - Current directory:/home/marcin
hie: Could not find $libexecdir/cabal-helper-wrapper

If you are a cabal-helper developer you can 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]: /home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/libexec/x86_64-linux-ghc-8.2.2/cabal-helper-0.8.0.2

@alanz
Copy link
Collaborator

alanz commented Feb 28, 2018

Then it is related to how AUR does things. Perhaps @DanielG can help, on https://github.com/DanielG/cabal-helper

@marmistrz
Copy link
Author

Well, AUR does nothing obviously weird: the package is just built and installed.

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=haskell-ide-engine-git

@alanz
Copy link
Collaborator

alanz commented Feb 28, 2018

Its not an install problem, its a runtime problem. ghc-mod uses cabal-helper, and between them there are some expectations about what can be found where, to get configured.

@marmistrz
Copy link
Author

It looks like setting the environment variable mentioned in the error message seems to work around the problem:

cabal_helper_libexecdir=/usr/lib/x86_64-linux-ghc-8.2.2/cabal-helper-0.8.0.2/

@marmistrz
Copy link
Author

marmistrz commented Mar 1, 2018

It looks like the resulting binary some paths hardcoded during configure/make, and it's done absolutely wrong

$ strings /usr/bin/hie | grep pacaur
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/bin
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/lib/x86_64-linux-ghc-8.2.2/haskell-ide-engine-0.1.0.0-1jxxdsETSU8AvhrJkZ6UGU-hie
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/lib/x86_64-linux-ghc-8.2.2
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/haskell-ide-engine-0.1.0.0
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/libexec/x86_64-linux-ghc-8.2.2/haskell-ide-engine-0.1.0.0
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/etc
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/lib/x86_64-linux-ghc-8.2.2/ghc-mod-core-5.9.0.0-GodznVjeigkJvVybP5ajf0
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/ghc-mod-core-5.9.0.0
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/libexec/x86_64-linux-ghc-8.2.2/ghc-mod-core-5.9.0.0
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/lib/x86_64-linux-ghc-8.2.2/cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/cabal-helper-0.8.0.2
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/libexec/x86_64-linux-ghc-8.2.2/cabal-helper-0.8.0.2

the system-wide paths are not in the executable anywhere:

$ strings /usr/bin/hie | grep share/
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/haskell-ide-engine-0.1.0.0
/home/marcin/.stack/snapshots/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/hoogle-5.0.16
/home/marcin/.stack/snapshots/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/warp-3.2.17
/home/marcin/.stack/snapshots/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/js-jquery-3.2.1
/home/marcin/.stack/snapshots/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/js-flot-0.8.3
/usr/local/share/certs/
/home/marcin/.stack/snapshots/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/hlint-2.1
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/ghc-mod-core-5.9.0.0
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/cabal-helper-0.8.0.2
/home/marcin/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.2.2/share/doc/ghc-8.2.2/html/libraries/base-4.10.1.0
/home/marcin/.stack/snapshots/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/ekg-0.4.0.14
/home/marcin/.stack/snapshots/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/snap-server-1.0.3.3
/home/marcin/.stack/snapshots/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/Cabal-2.0.1.1

or

$ strings /usr/bin/hie | grep cabal-helper
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs
cabal-helper-wrapper
https://github.com/DanielG/cabal-helper/issues
If you are a cabal-helper developer you can set the environment variable
work in the cabal-helper source tree:
cabal-helper.cabal
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:Distribution.Helper.LibexecNotFoundError
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:Distribution.Helper.SomeLocalBuildInfo
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:Distribution.Helper.QueryEnv
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:Distribution.Helper.Programs
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ProduceBuildOutput
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.NoBuildOutput
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChPkgGlobal
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChPkgUser
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChPkgSpecific
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChSetupEntrypoint
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChLibEntrypoint
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChExeEntrypoint
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChSetupHsName
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChLibName
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChSubLibName
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChFLibName
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChExeName
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChTestName
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChBenchName
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChResponseCompList
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChResponseEntrypoints
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChResponseNeedsBuild
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChResponseList
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChResponsePkgDbs
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChResponseLbi
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChResponseVersion
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChResponseLicenses
cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs:CabalHelper.Shared.InterfaceTypes.ChResponseFlags
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/lib/x86_64-linux-ghc-8.2.2/cabal-helper-0.8.0.2-ITEOSbhm2le15tRSF89fFs
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/share/x86_64-linux-ghc-8.2.2/cabal-helper-0.8.0.2
/home/marcin/.cache/pacaur/haskell-ide-engine-git/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6-nopie/nightly-2018-02-26/8.2.2/libexec/x86_64-linux-ghc-8.2.2/cabal-helper-0.8.0.2

@marmistrz
Copy link
Author

marmistrz commented Mar 23, 2018

This seems closely related to #400

@samuelpilz
Copy link
Contributor

This is still an issue. I experience it with the atom plugin. My issue is that I do not have cabal-helper-wrapper installed. The Readme does not mention that this is required.

Is it required to separatly install cabal-helper? Why is it not contained within the hie build?

@DanielG
Copy link
Collaborator

DanielG commented Aug 5, 2018

Looks to me like this is in fact an AUR problem. They use stack build/stack install which is just not going to work because it does exactly this sort of path hardcoding without a way to override it. I assume everything worked for the PKGBUILD author because they still had the .stack-work stuff lying around when testing it.

@samuelpilz
Copy link
Contributor

@DanielG I installed hie directly via git.

git clone --recursive ...
make build-all

I assume it worked because the cabal-helper-wrapper is found somewhere

@samuelpilz
Copy link
Contributor

samuelpilz commented Aug 6, 2018

It works for me now: I copied the cabal-helper-wrapper executable that is build as well when doing make build-all into my local bin folder and pointed cabal_helper_libexecdir to that dir.

Not sure if all that was necessary, but it works now 🎉

@thomashoneyman
Copy link

I've run into the same issue, but on MacOS also using git clone --recursive ... make build-all.

@alanz alanz added this to the prehistory milestone Feb 2, 2019
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

5 participants