Skip to content

stack ghci weird behaviour with ghc installed via ghcformacosx #385

@jhedev

Description

@jhedev

I'm on OS X 10.9.5 and ghc-7.8.4 is installed using ghcformacosx.

I have the following problem:

$ which ghc
/Applications/ghc-7.8.4.app/Contents/bin/ghc
$ ghc --interactive
GHCi, version 7.8.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
λ>
$ stack -v ghci
...
2015-06-23 18:52:01.203545: [debug] Run process: /Applications/ghc-7.8.4.app/Contents/bin/ghc --interactive @(stack-0.1.0.0:Stack.Exec src/Stack/Exec.hs:41:5)
GHCi, version 7.8.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... <command line>: can't load .so/.DLL for: libHSghc-prim-0.3.1.0.dylib (dlopen(libHSghc-prim-0.3.1.0.dylib, 9): image not found)
$ /Applications/ghc-7.8.4.app/Contents/bin/ghc --interactive
GHCi, version 7.8.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
λ>

As you can see I can run the ghc manually and it works as expected but running it via stack I get the error.
If I remove ghc from the $PATH and run stack setup first to download and install ghc, everything works fine:

$ which ghc
ghc not found
$ stack -v ghci
...
2015-06-23 19:00:14.401176: [debug] Run process: /Users/joel/.stack/programs/x86_64-osx/ghc-7.8.4/bin/ghc --interactive @(stack-0.1.0.0:Stack.Exec src/Stack/Exec.hs:41:5)
GHCi, version 7.8.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
λ>

I'm not sure if this is a bug or something specific to my environment.

EDIT: stack version is:

$ stack --version
Version 0.1.0.0, Git revision c2e5af39679439921570552e3e722f6819f4f4bf

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions