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

Paths on Mac? #39

Open
jegi opened this issue Sep 3, 2019 · 8 comments
Open

Paths on Mac? #39

jegi opened this issue Sep 3, 2019 · 8 comments

Comments

@jegi
Copy link

jegi commented Sep 3, 2019

I was very impressed by your demo of HyperHaskell at ICFP, Heinrich! I have just tried installing it (Mac 10.14.5, GHC 8.4.3) using cabal. The install went smoothly, but on starting up the front end, the Imports and options -> Status box reports

Interpreter not running (Error: spawn /Users/jg/.cabal/bin/hyper-haskell-server ENOENT)

Indeed, that path won't find my server:

jg$ which hyper-haskell-server
/Users/jg/Library/Haskell/bin/hyper-haskell-server
jg$ ls ~/.cabal/
config logs where-is-my-stuff.txt config.platform packages

Did I do something wrong?

@HeinrichApfelmus
Copy link
Owner

HeinrichApfelmus commented Sep 8, 2019

Thanks! 😊

You did not do something wrong, it's just that there several ways of installing Cabal on macOS, and they seem to use different paths. In the HyperHaskell.app bundle (it's a folder), can you change this line in the file Contents/Resources/app/src/interpreter.js to use the path /Library/Haskell/bin/hyper-haskell-server instead? This is probably the easiest way to fix it for you.

Ideally, I would bundle a separate GHC with HyperHaskell, so that people can start right away. But that's not entirely trivial. #10

@jegi
Copy link
Author

jegi commented Sep 12, 2019

Thanks. That fixed that error message. But now the status box says: "Could not load imports: Interpreter not running (Error 0)". I suspect this may be a basic misunderstanding on my part... am I supposed to launch hyper-haskell-server as a daemon somehow? Just running hyper-haskell-server from a Terminal window yields an error ("lookupSymbol failed in relocateSection ... ___gmp_rands")

@HeinrichApfelmus
Copy link
Owner

HeinrichApfelmus commented Sep 12, 2019

am I supposed to launch hyper-haskell-server as a daemon somehow?

No, you're not supposed to launch this binary by yourself, the HyperHaskell app is supposed to do that automatically.

However, running in the Terminal should work, and the error message

Just running hyper-haskell-server from a Terminal window yields an error ("lookupSymbol failed in relocateSection ... ___gmp_rands")

indicates that something went wrong, perhaps while compiling or even linking the binary. Since hyper-haskell-server uses the GHC API (via the hint package), it is important that the supporting hyper package is compiled with the exact same GHC version as the binary itself.

(Running the hyper-haskell-server binary in the terminal should give a result similar to

$ hyper-haskell-server 
Setting phasers to stun... (port 8024) (ctrl-c to quit)
Waiting for Haskell expression

)

@jegi
Copy link
Author

jegi commented Sep 12, 2019

I installed hyper, hyper-haskell-server, and hyper-extra on the same day, using cabal as per the instructions at https://github.com/HeinrichApfelmus/hyper-haskell. So I'm pretty sure they all used the same GHC version (8.4.3). I didn't notice any compilation or installation errors, and ~/Library/Haskell/logs/build.log shows "install-outcome: InstallOK" for every package.

@HeinrichApfelmus
Copy link
Owner

That is very strange. Can you post the output that you get when running hyper-haskell-server in the Terminal.

@jegi
Copy link
Author

jegi commented Sep 13, 2019

$ hyper-haskell-server
Setting phasers to stun... (port 8024) (ctrl-c to quit)
hyper-haskell-server:
lookupSymbol failed in relocateSection (RELOC_GOT)
/Library/Frameworks/GHC.framework/Versions/8.4.3-x86_64/usr/lib/ghc-8.4.3/integer-gmp-1.0.2.0/HSinteger-gmp-1.0.2.0.o: unknown symbol `___gmp_rands'

@jegi
Copy link
Author

jegi commented Sep 13, 2019

Seems to be a known issue: https://gitlab.haskell.org/ghc/ghc/issues/15105

I have hidden the offending file HSinteger-gmp-1.0.2.0.o (by gzipping it). Now hyper-haskell-server and HyperHaskell work! I hope I haven't broken anything else.

@HeinrichApfelmus
Copy link
Owner

Great! Let me know if there is any other issue.

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

2 participants