Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current vscode-hie-wrapper fails on macOS, probably due to GUI $PATH not being set like shell $PATH #105

Closed
paul-snively opened this issue Aug 15, 2018 · 8 comments

Comments

@paul-snively
Copy link

paul-snively commented Aug 15, 2018

I'm working with fp-course, and have HIE checked out and built from source as of yesterday. When I try to use HIE with this project, I get the popup:

Mismatching GHC versions: Project is 8.2.2, HIE is 8.4.3 You may want to use hie-wrapper. Check the README for more information

This is probably because, having built HIE from source on the master branch with stack, everything is in ~/.local/bin, which is in my shell's $PATH thanks to a file, /etc/paths.d/local, containing /Users/psnively/.local/bin. But unfortunately, the mechanism used to build the $PATH for the shell isn't used by the launcher system for GUI applications, so I'm betting the $PATH is not appropriate for the machinery used by the extension to launch hie-wrapper, so it's effectively not being used.

If there's anything I can add to help track this down, please let me know.

Thanks!

Update: I should add that, in my shell:

cd ~/projects/fp-course
hie-wrapper

works perfectly:

⇒  hie-wrapper
2018-08-15 09:45:34.315087 [ThreadId 4] - run entered for hie-wrapper(hie-wrapper) Version 0.2.2.0, Git revision f73e4698fabf44667f6bf3165d9fac8d091d2437 (1640 commits) x86_64 ghc-8.4.3
2018-08-15 09:45:34.316433 [ThreadId 4] - Current directory:/Users/psnively/projects/fp-course
2018-08-15 09:45:34.317184 [ThreadId 4] - Using plain GHC version
2018-08-15 09:45:34.374561 [ThreadId 4] - Project GHC version:8.2.2
2018-08-15 09:45:34.374969 [ThreadId 4] - hie exe candidates :("hie-8.2.2","hie-8.2")
2018-08-15 09:45:34.376758 [ThreadId 4] - found hie exe at:/Users/psnively/.local/bin/hie-8.2.2
2018-08-15 09:45:34.37723 [ThreadId 4] - args:[]
2018-08-15 09:45:34.377459 [ThreadId 4] - launching ....



2018-08-15 09:45:34.392279 [ThreadId 4] - Using plain GHC version
2018-08-15 09:45:34.451885 [ThreadId 4] - Run entered for HIE(hie-8.2.2) Version 0.2.2.0, Git revision f73e4698fabf44667f6bf3165d9fac8d091d2437 (1640 commits) x86_64 ghc-8.2.2
2018-08-15 09:45:34.453088 [ThreadId 4] - Current directory:/Users/psnively/projects/fp-course
@Rhywun
Copy link

Rhywun commented Aug 15, 2018

I have the same issue with latest HIE. Also on Mac (10.13.6).

Additionally, I see messages like this:

cannot satisfy -package-id Chart-1.8.3-H06ahxc2L6nqL80IisGH8: 
    Chart-1.8.3-H06ahxc2L6nqL80IisGH8 is unusable due to missing dependencies

Repeated for all dependencies.

Same code base was working fine under previous HIE.

@paul-snively
Copy link
Author

Same code base was working fine under previous HIE.

The transition from hie-wrapper.sh to hie-wrapper (binary) is almost certainly the culprit: the former would have its $PATH set by launching a shell; the latter doesn't (on macOS).

@Rhywun
Copy link

Rhywun commented Aug 15, 2018

Just figured out a workaround by adding this to VSCode's user settings:

"languageServerHaskell.useCustomHieWrapper": true,
"languageServerHaskell.useCustomHieWrapperPath": "~/.local/bin/hie-wrapper",

Seems to work.

@AlexeyRaga
Copy link
Contributor

AlexeyRaga commented Aug 15, 2018 via email

@nponeccop
Copy link

Apparently haskell/haskell-ide-engine#748 is the same issue

@pascalpoizat
Copy link

Not sure if it is related by in the VSC user parameters,

    "languageServerHaskell.useHieWrapper": true,

is underlined and it says "Unknown configuration setting".

@newhoggy
Copy link

I did this, which might be better than copying:

ln -s ~/.local/bin/hie-wrapper ~/.local/bin/hie

@jneira
Copy link
Member

jneira commented Jan 9, 2020

It seems the use of hie-wrapper is stable and afaik it is working without have to do any workaround .
@paul-snively @Rhywun @pascalpoizat new could you try with latest extension and hie versions?
Feel free to reopen if you continue experiencing it

@jneira jneira closed this as completed Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants