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

Unable to run yesod devel with stack #1028

Closed
reneklacan opened this issue Jul 2, 2015 · 24 comments
Closed

Unable to run yesod devel with stack #1028

reneklacan opened this issue Jul 2, 2015 · 24 comments

Comments

@reneklacan
Copy link

Hi,

Sorry for asking such a basic question, I was googling and found this commercialhaskell/stack#153 for example but wasn't able to solve my problem anyway.

I have fresh install of stack and eveything is working great except yesod devel

First thing I tried to run stack exec yesod -- devel but I got

yesod: cabal: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

I tried stack install yesod to install it globally and do yesod devel but got same error.

So I installed cabal by running stack install cabal-install

Then when I tried to run yesod devel I got

Resolving dependencies...
Configuring cars-0.0.0...
cabal: At least the following dependencies are missing:
aeson >=0.6 && <0.9,
classy-prelude >=0.10.2,
... (list of all packages)

Even tried to run cabal install --enable-tests . --max-backjumps=-1 --reorder-goals but it didn't change anything...

I am running out of ideas so can you give me any hint how to solve it because workflow "stack build" and "stack exec some_yesod_app" after every change is killing me.

Thanks

Rene

@snoyberg
Copy link
Member

snoyberg commented Jul 2, 2015

Can you try the instructions at
http://www.yesodweb.com/blog/2015/06/stack-support-yesod-devel ?

On Thu, Jul 2, 2015, 1:23 PM René Klačan notifications@github.com wrote:

Hi,

Sorry for asking such a basic question, I was googling and found this
commercialhaskell/stack#153
commercialhaskell/stack#153 for example but
wasn't able to solve my problem anyway.

I have fresh install of stack and eveything is working great except yesod
devel

First thing I tried to run stack exec yesod -- devel but I got

yesod: cabal: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

I tried stack install yesod to install it globally and do yesod devel but
got same error.

So I installed cabal by running stack install cabal-install

Then when I tried to run yesod devel I got

Resolving dependencies...
Configuring cars-0.0.0...
cabal: At least the following dependencies are missing:
aeson >=0.6 && <0.9,
classy-prelude >=0.10.2,
... (list of all packages)

Even tried to run cabal install --enable-tests . --max-backjumps=-1
--reorder-goals but it didn't change anything...

I am running out of ideas so can you give me any hint how to solve it
because workflow "stack build" and "stack exec some_yesod_app" after every
change is killing me.

Thanks

Rene


Reply to this email directly or view it on GitHub
#1028.

@reneklacan
Copy link
Author

Thanks for blazingly fast answer, going to try it immediately

@reneklacan
Copy link
Author

After running stack exec yesod devel I got error:

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).

My env:

➜ stack --version
Version 0.1.1.0, Git revision 91fe70306f51eb3d68667a0d6e09a7d7ebbeb2b6

➜ cabal --version
cabal-install version 1.18.1.0
using version 1.18.1.5 of the Cabal library

➜ cat ~/.stack/global/stack.yaml
flags: {}
packages: []
extra-deps:
- hfsevents-0.1.5
resolver: lts-2.16

@snoyberg
Copy link
Member

snoyberg commented Jul 2, 2015

This is a feature in the newest yesod-bin. Did you install the newest version as per the blog post (stack build yesod-bin-1.4.11)? What's the output of stack exec -- yesod --version?

@reneklacan
Copy link
Author

You are right. Sorry, Thank you very much. You are my hero! Have a nice evening!

@snoyberg
Copy link
Member

snoyberg commented Jul 2, 2015

Afternoon actually, I'm in California as of yesterday ;)

On Thu, Jul 2, 2015 at 2:12 PM René Klačan notifications@github.com wrote:

Closed #1028 #1028.


Reply to this email directly or view it on GitHub
#1028 (comment).

@reneklacan
Copy link
Author

Have a nice afternoon then :D

@bitemyapp
Copy link
Contributor

I'm getting this error, but I have version 1.4.17.1 in my snapshot. Any idea what might be doing on?

Also weirdly, this isn't working:

$ stack exec -- yesod --version
Invalid option `--version'

@MaxGabriel
Copy link
Member

Needs to be yesod version

Max@maximilians-mbp ~/D/i/i/Heyzap> yesod version
yesod-bin version: 1.4.17.1

@bitemyapp
Copy link
Contributor

@MaxGabriel well, same issue remains.

@snoyberg
Copy link
Member

Just to confirm the report, you're saying you get the exact same createProcess error message reported above?

yesod: cabal: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

@mrkkrp
Copy link
Contributor

mrkkrp commented Jul 5, 2016

I'm running into the same issue now. @bitemyapp, how did you resolve this?

@mrkkrp
Copy link
Contributor

mrkkrp commented Jul 15, 2016

For others: you need to install cabal, these days I use stack and forgot about Cabal.

@RobertFischer
Copy link

I am getting this in a brand new yesod-simple project.

robert@rcf-dell:~/wkdir/blogging$ ./script/server 
++ dirname ./script/server
+ HEREDIR=./script
+ cd ./script/..
+ stack build yesod-bin
+ export APPROOT=https://localhost:3443
+ APPROOT=https://localhost:3443
+ stack exec -- yesod devel
Yesod devel server. Type 'quit' to quit
Application can be accessed at:

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

yesod: cabal: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
robert@rcf-dell:~/wkdir/blogging$ stack exec yesod version
yesod-bin version: 1.4.18.7

If I visit localhost:3000, it just keeps saying that my application hasn't been built and refreshing.

@snoyberg
Copy link
Member

Looks like @mrkkrp's comment applies (need to install cabal). However, if you modify your stack.yaml to include:

extra-deps:
- yesod-bin-1.5.1

Then stack build yesod-bin and stack exec -- yesod devel will use the newer devel server that does not depend on cabal, and overall works more reliably. See: http://www.yesodweb.com/blog/2016/11/new-yesod-devel-server

@RobertFischer
Copy link

@snoyberg -- I very much appreciate the quick response. Loving Yesod overall, BTW. After years of being stuck in Java/JS in a web world dominated by Ruby, Yesod is a breath of fresh air.

For the record, I also had to add these to my extra-deps list in stack.yaml:

- say-0.1.0.0
- typed-process-0.1.0.0

(But the error message was very helpful in pointing that out.)

If you want to replicate the original problem, the following commands (taken from history) do it reliably:

 2182  mkdir ~/tmp
 2183  cd ~/tmp/
 2185  stack new demo yesod-simple
 2187  cd ./demo/
 2189  stack setup
 2190  stack install yesod-bin
 2193  stack exec -- yesod devel

@snoyberg
Copy link
Member

snoyberg commented Jan 17, 2017 via email

@tdimiduk
Copy link

I'm getting this error with yesod-bin-1.5.1 (lts-8.0), fresh scaffolded yesod-sqlite.

$ stack exec -- yesod version
yesod-bin version: 1.5.1

$ stack exec -- yesod devel
Yesod devel server. Enter 'quit' or hit Ctrl-C to quit.
Application can be accessed at:

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

yesod: stack: startProcess: runInteractiveProcess: exec: does not exist (No such file or directory)


I have also installed yesod-bin through nix (I am running NixOS), and that version will run, but gives me the application hasn't been built page

$ yesod version
yesod-bin version: 1.5.1

@vandenoever
Copy link

I have the same issues as @tdimiduk.

$ stack exec -- yesod version
yesod-bin version: 1.5.2.2
$ stack --nix exec -- yesod devel
Yesod devel server. Enter 'quit' or hit Ctrl-C to quit.
Application can be accessed at:

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

yesod: stack: startProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

So stack does not find stack. strace shows that stack looks for stack in many places but not in the PATH directories.

@vandenoever
Copy link

Here's a line from strace that shows the problem. There are about 20 of these lines where stack looks for stack in different places:

[pid 24492] execve("/nix/store/5cpnwwnasypdi7p0av6qbaf52y99gmdz-xz-5.2.2-bin/bin/stack", ["stack", "build", "--fast", "--file-watch", "my-project:lib", "--exec", "/home/oever/.stack/snapshots/x86"..., "--flag", "my-project:dev", "--flag", "my-project:library-only"], [/* 52 vars */]) = -1 ENOENT (No such file or directory)

@vandenoever
Copy link

Here is a workaround:

cp $(type -P stack) .stack-work/install/x86_64-linux-nix/lts-8.8/8.0.2/bin/

Now stack exec -- yesod devel runs fine with the workaround.

@tdimiduk
Copy link

tdimiduk commented Apr 5, 2017 via email

@mmzx
Copy link

mmzx commented Feb 12, 2018

After suggestion from @vandenoever, yesod devel works.
Some details: ./.stack-work/install/x86_64-linux-nix/lts-10.5/8.2.2/bin/ .

@adparker
Copy link

adparker commented Apr 5, 2019

Just FYI, I ran into this problem too, as posted by @vandenoever, and their solution fixed it: copying stack to .stack-work/.... I'm on yesod version 1.6.0.3.

Should we reopen this issue, as I'm sure others are still running into it?

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

10 participants