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

MacOS: "Error: 1" using stack back-end #23

Open
conklech opened this issue Aug 6, 2018 · 2 comments
Open

MacOS: "Error: 1" using stack back-end #23

conklech opened this issue Aug 6, 2018 · 2 comments

Comments

@conklech
Copy link

conklech commented Aug 6, 2018

Steps to reproduce:

  • download the Mac binary release 0.2.1.0
  • install the backend with stack (stack install hyper hyper-haskell-server) - global resolver is lts-11.15, and stack is in ~/.local/bin/
  • open frontend; set interpreter back-end to stack; set location of stack executable in preferences
  • reload imports

Result:

Status: Could not load imports:
Interpreter not running (Error: 1)

Related observations:

If the stack path is set to the folder containing stack (rather than the full path) the error message is unhelpful:
image

It's not clear when changes to the stack path preference are actually applied; I could change which error I got by changing the interpreter back-end to cabal, reloading, and then changing back to stack.

@HeinrichApfelmus
Copy link
Owner

I had a similar problem. It seems to me that stack needs to have the path to its own binary in the PATH variable. I could fix my own issue by changing

https://github.com/HeinrichApfelmus/hyper-haskell/blob/master/app/src/interpreter.js#L52

to read

env['PATH']  = process.env['PATH'] + ':/usr/local/bin' // pick up path from external environment if possible

My reasoning was that this path is standard enough and it doesn't hurt to include it.

In your case, this trick doesn't work, because your stack binary is not in a standard location. A temporary fix would be simply add your nonstandard path by hand. You can mess around with the HyperHaskell.app bundle if you like, I think the JavaScript source code is included.

The proper fix would be to extract the path from the preferences

You make a good point that it's not clear when the preferences are applied.

@2mol
Copy link

2mol commented Oct 24, 2018

I have stack in ~/.local/bin/ too. I think it's pretty standard, so it wouldn't hurt to hardcode it in as well. Is it not possible to call which stack from within JS? Wouldn't process.env['PATH'] pick it up anyway, since the fact that stack is called means that it already is in the user's PATH?

Edit: stack is actually weird, in that it copies itself to both ~/.local/bin/ and /usr/local/bin/ in some (or all?) cases.

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

No branches or pull requests

3 participants