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 exec -- yesod devel #1018

Closed
legrostdg opened this issue Jun 23, 2015 · 10 comments
Closed

stack exec -- yesod devel #1018

legrostdg opened this issue Jun 23, 2015 · 10 comments

Comments

@legrostdg
Copy link

Not sure if the issue is in yesod-bin or in stack, but after building a yesod based project and installing yesod-bin with stack, I can't run "yesod devel":

$ stack exec -- yesod devel
Yesod devel server. Press ENTER to quit
Application can be accessed at:

http://127.0.0.1:3000
https://127.0.0.1:3443
If you wish to test https capabilities, you should set the following variable:
  export APPROOT=https://127.0.0.1:3443

cabal: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with
Cabal. Use the flag --package-db to specify a package database (it can be used
multiple times).
@snoyberg
Copy link
Member

It's a problem in Cabal, in that it won't recognize the GHC_PACKAGE_PATH environment variable, and yesod devel which uses cabal. The proper solution will be to move yesod devel off of cabal, which will hopefully be part of the current GSoC project to move over to ide-backend. In the meanwhile, unfortunately yesod devel is not compatible with stack, at least not directly as we'd like.

@legrostdg
Copy link
Author

Is there a workaround? I noticed the same problem with propellor https://propellor.branchable.com, which I guess won't be updated to ide-backend...

haskell/cabal#2270 may be a fix?

@snoyberg
Copy link
Member

It depends on what you mean by "workaround." You can use env to disable the GHC_PACKAGE_PATH environment variable (and we can provide a flag to exec to automate that). But in the case of yesod devel, that will mean you end up not having the packages in scope.

Another possibility would be to tweak yesod devel to parse GHC_PACKAGE_PATH, turn it into command line parameters for cabal, and unset the environment variable. Which presumably is what cabal should be doing anyway. propellor could do the same thing.

@legrostdg
Copy link
Author

closed by a7cccf2
Thanks!

@snoyberg
Copy link
Member

You're fast, the blog post isn't even out yet!

@geraldus
Copy link
Contributor

Oh, cool, thanks! Now I can use stack (:

@legrostdg
Copy link
Author

@snoyberg you are the fast one!

I just updated my yesod git clone by chance and noticed the latest commit :).

@tfiala
Copy link

tfiala commented Jul 20, 2015

I seem to be hitting this issue with 'stack exec -- yesod test':

stack exec -- yesod test
cabal: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with
Cabal. Use the flag --package-db to specify a package database (it can be used
multiple times).

I've got stack exec -- yesod devel working just fine. Is this likely another instance of the problem solved here for the devel command?

@snoyberg
Copy link
Member

I wouldn't bother using yesod test with stack, just use stack test.

@tfiala
Copy link

tfiala commented Jul 21, 2015

Ah, thanks! I am new to both Haskell and stack, and didn't even know 'stack test' was an option. I'm just getting started with the 2nd ed book and it pointed to stack. (And stack test did work :-) ).

danse added a commit to danse/yesod that referenced this issue Dec 11, 2015
danse added a commit to danse/yesod-scaffold that referenced this issue Dec 14, 2015
danse added a commit to danse/yesod-scaffold that referenced this issue Dec 14, 2015
danse added a commit to danse/yesod-scaffold that referenced this issue Dec 14, 2015
danse added a commit to danse/yesod-scaffold that referenced this issue Dec 14, 2015
danse added a commit to danse/yesod-scaffold that referenced this issue Dec 14, 2015
danse added a commit to danse/yesod-scaffold that referenced this issue Dec 14, 2015
snoyberg added a commit to yesodweb/yesod-scaffold that referenced this issue Dec 14, 2015
suggest a test command based on Stack, see yesodweb/yesod#1018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants