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

stack ghci does not include extra-lib-dirs from yaml configuration #1656

Closed
luigy opened this issue Jan 14, 2016 · 9 comments
Closed

stack ghci does not include extra-lib-dirs from yaml configuration #1656

luigy opened this issue Jan 14, 2016 · 9 comments

Comments

@luigy
Copy link
Contributor

luigy commented Jan 14, 2016

and also probably applies to extra-include-dirs
assuming that the library and headers exists at the locations listed in the yaml configuration

Expected:

> stack ghci
...
Configuring GHCi with the following packages: leveldb-haskell
GHCi, version 7.10.3: http://www.haskell.org/ghc/  :? for help
...
Ok, modules loaded: Database.LevelDB, Database.LevelDB.Base, Database.LevelDB.C, Database.LevelDB.Internal, Database.LevelDB.Iterator, Database.LevelDB.MonadResource, Database.LevelDB.Streaming, Database.LevelDB.Types, Data.Stream.Monadic.
*Data.Stream.Monadic Data.Stream.Monadic Database.LevelDB Database.LevelDB.Base Database.LevelDB.C Database.LevelDB.Internal Database.LevelDB.Iterator Database.LevelDB.MonadResource Database.LevelDB.Streaming Database.LevelDB.Types>

Actual:

> stack ghci
...
Configuring GHCi with the following packages: leveldb-haskell
GHCi, version 7.10.3: http://www.haskell.org/ghc/  :? for help
<command line>: user specified .o/.so/.DLL could not be loaded (dlopen(libleveldb.dylib, 5): image not found)
Whilst trying to load:  (dynamic) leveldb
Additional directories searched: (none)

stack.yaml

# /Users/luigy/code/haskell/stack-issues/leveldb-haskell-0.6.3/stack.yaml
resolver: lts-4.1
packages:
- '.'

extra-include-dirs:
  - /Users/luigy/code/haskell/stack-issues/leveldb-haskell-0.6.3/leveldb/include
extra-lib-dirs:
  - /Users/luigy/code/haskell/stack-issues/leveldb-haskell-0.6.3/leveldb
> stack --version
Version 1.0.1, Git revision 19f00be8bcb6e891f7f627ce3e1164eaa7be19b1 (dirty) (3073 commits) x86_64
@luigy
Copy link
Contributor Author

luigy commented Jan 14, 2016

Adding the dirs from yaml configuration to BuildInfo should be enough. I think cabal-install overwrites what gets passed through the cli, but I'm not sure as to whether we would want to do the same or just union it with what might be there

@mgsloan
Copy link
Contributor

mgsloan commented Jan 15, 2016

We could plumb this info through, and continue invoking GHCi the way we have been. I'd certainly accept a PR that does that, and might write one myself at some point.

However, I think the "correct" way to resolve this stuff is to start pulling this info from the info stored by cabal configure - see #1364 and #970

@mgsloan
Copy link
Contributor

mgsloan commented Jan 28, 2016

A GHC bug which is potentially related: https://ghc.haskell.org/trac/ghc/ticket/11042 Looks like the fix made it into GHC 8

@crockeea
Copy link

crockeea commented May 5, 2016

Not sure if this is related, but "stack ghci" also ignores extra-lib-dirs that are modified in a Setup.hs script (though it includes extra-lib-dirs that are written directly in the cabal file).

@mgsloan
Copy link
Contributor

mgsloan commented May 5, 2016

@crockeea Yeah, that's tracked by #970

mgsloan added a commit that referenced this issue May 15, 2016
+ Refactor unwieldy many-arg function
@mgsloan
Copy link
Contributor

mgsloan commented May 15, 2016

Fixed! Tested on https://github.com/expipiplus1/simple-shared , and what didn't work before works now!

@mgsloan mgsloan closed this as completed May 15, 2016
@dtaskoff
Copy link

dtaskoff commented Apr 7, 2017

@mgsloan, ghci now respects the --extra-lib-dirs, but those still can't be set from Setup.hs (in preConf or preRepl). That wouldn't be a problem if relative paths could be used in --extra-lib-dirs, but since they couldn't, they must be set manually using the hooks. Any plans on fixing that too?

@mgsloan
Copy link
Contributor

mgsloan commented Apr 8, 2017

@leohaskell Relative paths can be used now - #2830 - though this isn't yet in a released version of stack

Using Setup.hs info in ghci is tricky - see #970 and #2139

@dtaskoff
Copy link

dtaskoff commented Apr 8, 2017

@mgsloan, great! Thank you for your efforts!

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

4 participants