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

yesod + stack ghci issue #1154

Closed
kjameslubin opened this issue Oct 13, 2015 · 4 comments
Closed

yesod + stack ghci issue #1154

kjameslubin opened this issue Oct 13, 2015 · 4 comments

Comments

@kjameslubin
Copy link

Cross referenced from [https://github.com/yesodweb/yesod/issues/1077]. If one adds yesod-auth-oauth2 to a templated yesod project, stack ghci will fail. Hopefully this is easy enough to reproduce, if not I can write out a minimal example (my example has other stuff going on and is in a private repo).

Expected:

ghci to load full project.

Actual:

...
[ 1 of 24] Compiling Model            ( Model.hs, interpreted )
[ 2 of 24] Compiling Yesod.Auth.OAuth2 ( /home/kjameslubin/haskell/blockapps-portal/blockapps-portal/.stack-work/downloaded/291bbfd7ccdf620dc468888debb4fd9b8e311b3466426dee0c34f3693b39220f.git/Yesod/Auth/OAuth2.hs, interpreted )

/home/kjameslubin/haskell/blockapps-portal/blockapps-portal/.stack-work/downloaded/291bbfd7ccdf620dc468888debb4fd9b8e311b3466426dee0c34f3693b39220f.git/Yesod/Auth/OAuth2.hs:45:15:
    Not in scope: type constructor or class ‘Show’

/home/kjameslubin/haskell/blockapps-portal/blockapps-portal/.stack-work/downloaded/291bbfd7ccdf620dc468888debb4fd9b8e311b3466426dee0c34f3693b39220f.git/Yesod/Auth/OAuth2.hs:59:42:
    Not in scope: type constructor or class ‘IO’

Verbose traces are here: https://gist.github.com/kjameslubin/cb6a269d3633ff6fb587

@snoyberg
Copy link
Contributor

This seems to be the same as #847. Can you look at the comment #847 (comment) and see if that description fits your case at all?

@kjameslubin
Copy link
Author

I think the underlying cause may be the same, but the issue is slightly different.The yesod template itself works with stack ghci but stack ghci doesn't play well with local packages. Here's a minimal way to reproduce it on Ubuntu 14.04 for me. (Edit: the issue appears more similar to #1135)

stack new ghci-test yesod-sqlite && cd ghci-test
stack ghci

-- this works just fine, but then add a package to to stack.yaml so it looks like:

~/haskell/yesod-ghci/ghci-test> cat stack.yaml
# For more information, see: https://github.com/commercialhaskell/stack/blob/master/doc/yaml_configuration.md

# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
resolver: lts-3.4

# Local packages, usually specified by relative directory name
packages:
- '.'
- location:
    git: https://github.com/kjameslubin/yesod-auth-oauth2
    commit: bc50f17f46d34e8ef244ed9dca90cadba953d242

# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
extra-deps: []

# Override default flag values for local packages and extra-deps
flags:
  ghci-test:
    library-only: false
    dev: false

# Control whether we use the GHC we find on the path
# system-ghc: true

# Require a specific version of stack, using version ranges
# require-stack-version: -any # Default
# require-stack-version: >= 0.1.4.0

# Override the architecture used by stack, especially useful on Windows
# arch: i386
# arch: x86_64

# Extra directories used by stack for building
# extra-include-dirs: [/path/to/dir]
# extra-lib-dirs: [/path/to/dir]

then you get the error trace [https://gist.github.com/kjameslubin/8fced0d9dbf2335a2d5f].
stack install still works just fine with the additional package.

@snoyberg
Copy link
Contributor

Pinging @chrisdone

@mgsloan
Copy link
Contributor

mgsloan commented Nov 5, 2015

I've added warnings for circumstances like this #1270

@kjameslubin You probably want to add extra-dep to that git repo package. This way stack ghci won't try to load it.

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