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 with external local dep. doesn't work (can't find Show/Eq) #1363

Closed
silky opened this issue Nov 18, 2015 · 2 comments
Closed

stack ghci with external local dep. doesn't work (can't find Show/Eq) #1363

silky opened this issue Nov 18, 2015 · 2 comments

Comments

@silky
Copy link
Contributor

silky commented Nov 18, 2015

i'm trying to load ghci through stack, but i'm getting an error where it can't find the Show and Eq classes in an external library that i'm including as a dep.

the library is sendgrid-haskell: https://github.com/bitemyapp/sendgrid-haskell. i cloned this library locally, deleted the bounds from the cabal file and am using the following stack.yaml

resolver: lts-3.13
packages:
- '.'
extra-deps: []
flags: {}
extra-package-dbs: []

my stack version is

02:39 PM noon ∈ thing>stack --version
Version 0.1.6.0, Git revision e22271f5ce9afa2cb5be3bad9cafa392c623f85c (2313 commits) x86_64

to reproduce the error

i create a new project from a yesod template

stack new thing yesod-hello-world

i add a package dep to a local library, sendgrid-haskell so my packages section of stack.yaml looks like:

packages:
- '.'
- /home/noon/dev/ext/sendgrid-haskell

(nothing else in that file changed; resolver is lts-3.13)

i type stack ghci and it fails

⚡ 02:35 PM noon ∈ thing>stack ghci
persistent-sqlite-2.2: download
persistent-sqlite-2.2: configure
persistent-sqlite-2.2: build
persistent-sqlite-2.2: install
Using main module: Package `thing' component exe:thing with main-is file: /home/noon/tmp/ss/thing/main.hs
Configuring GHCi with the following packages: sendgrid-haskell, thing
GHCi, version 7.10.2: http://www.haskell.org/ghc/  :? for help
[1 of 4] Compiling Email.SendGrid.Types ( /home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs, interpreted )

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:9:61:
    Not in scope: type constructor or class ‘Eq’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:9:65:
    Not in scope: type constructor or class ‘Show’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:10:61:
    Not in scope: type constructor or class ‘Eq’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:10:65:
    Not in scope: type constructor or class ‘Show’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:12:67:
    Not in scope: type constructor or class ‘Eq’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:12:71:
    Not in scope: type constructor or class ‘Show’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:15:66:
    Not in scope: type constructor or class ‘Eq’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:15:70:
    Not in scope: type constructor or class ‘Show’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:17:67:
    Not in scope: type constructor or class ‘Eq’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:17:71:
    Not in scope: type constructor or class ‘Show’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:18:67:
    Not in scope: type constructor or class ‘Eq’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:18:71:
    Not in scope: type constructor or class ‘Show’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:20:69:
    Not in scope: type constructor or class ‘Eq’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:20:73:
    Not in scope: type constructor or class ‘Show’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:21:69:
    Not in scope: type constructor or class ‘Eq’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:21:73:
    Not in scope: type constructor or class ‘Show’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:22:69:
    Not in scope: type constructor or class ‘Eq’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:22:73:
    Not in scope: type constructor or class ‘Show’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:23:93:
    Not in scope: type constructor or class ‘Eq’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:23:97:
    Not in scope: type constructor or class ‘Show’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:28:28:
    Not in scope: type constructor or class ‘Eq’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:28:32:
    Not in scope: type constructor or class ‘Show’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:39:15:
    Not in scope: type constructor or class ‘Eq’

/home/noon/dev/ext/sendgrid-haskell/src/Email/SendGrid/Types.hs:39:19:
    Not in scope: type constructor or class ‘Show’
Failed, modules loaded: none.
ϟ> 

note that this problem only occurs if using a yesod project; from a simple new project, (and from the sendgrid-haskell project itself) everything works.

thoughts?

@mgsloan
Copy link
Contributor

mgsloan commented Nov 18, 2015

Note that stack ghci tries to load both projects together. If you only specify one, it should work.

This is due to the yesod project specifying -XNoImplicitPrelude. Ideally we'd be able to properly load multiple packages into ghci, but that needs ghc support.

The best we can do is noisily tell the user about this issue, which I've already done (but it's not in a released version of stack yet): #1270

So, I'm closing this as already-fixed. Please re-open if I'm wrong.

@silky
Copy link
Contributor Author

silky commented Nov 18, 2015

perfect; thanks, this makes sense, and indeed i can confirm that running it like

stack ghci thing

gets me essentially what i wanted! thanks!

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