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

new-run not running the executable #4477

Closed
dagit opened this issue Apr 29, 2017 · 4 comments
Closed

new-run not running the executable #4477

dagit opened this issue Apr 29, 2017 · 4 comments

Comments

@dagit
Copy link
Collaborator

dagit commented Apr 29, 2017

I'm testing with the 2.0 branch. My package built successfully and has one executable section. The new-run command correctly checks if things are up to date and rebuilds them, but it is not running the executable. I added printouts in main that I never see and the program should block on a getContents but it doesn't do that either. I've tried adding exe:mypkg to the new-run command and it doesn't change the behavior.

@dmwit

ezyang added a commit to ezyang/cabal that referenced this issue Apr 30, 2017
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
@ezyang ezyang added this to the Default nix-local-build (3.0) milestone Apr 30, 2017
@ezyang
Copy link
Contributor

ezyang commented Apr 30, 2017

Looking at CmdRun.hs it looks like it's just not implemented. CC @dcoutts. I think this should be easy to fix. No it's not see below.

@ezyang
Copy link
Contributor

ezyang commented Apr 30, 2017

No, it's not so easy to fix. From @dcoutts:

Ok, so the runProjectPreBuildPhase should return the resolved targets selected. That'd be most direct. I'm doing some refactoring in ProjectOrchestration so I can do this.

runProjectPreBuildPhase still does not return the resolved targets selected, so it needs to be refactored to do so. Duncan did a bunch of refactoring (the latest commit of which was 1022c14) but this change still does not seem to be done.

@fgaz fgaz self-assigned this Jun 14, 2017
fgaz added a commit to fgaz/cabal that referenced this issue Jul 4, 2017
@fgaz fgaz mentioned this issue Jul 4, 2017
fgaz added a commit that referenced this issue Jul 16, 2017
Completed the 'new-run' command (#4477). The functionality is the
same of the old 'run' command but using nix-style builds.
Additionally, it can run executables across packages in a project.
@m-renaud
Copy link
Collaborator

This isn't working for me using cabal-install 2.0.0.1.

Versions:

$ cabal --version
cabal-install version 2.0.0.1
compiled using version 2.0.1.1 of the Cabal library

Steps to reproduce:

Create new executable project, cabal run x works as expected, cabal new-run only builds, does not run executable.

$ cabal init -p x --is-executable -n -m
$ cabal run x
...
[1 of 1] Compiling Main             ( Main.hs, dist/build/x/x-tmp/Main.o )
...
Running x...
Hello, Haskell!

$ cabal new-run x
...
[1 of 1] Compiling Main             ( Main.hs, /home/mrenaud/tmp/cabal/dist-newstyle/build/x86_64-linux/ghc-8.2.2/x-0.1.0.0/c/x/build/x/x-tmp/Main.o )
Linking /home/mrenaud/tmp/cabal/dist-newstyle/build/x86_64-linux/ghc-8.2.2/x-0.1.0.0/c/x/build/x/x ...

Let me know if there's any other information you need, thanks!

@hvr
Copy link
Member

hvr commented Jan 30, 2018

@m-renaud see #5074

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

5 participants