Skip to content

new-run not running the executable #4477

Closed

Description

@dagit

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

Activity

  1. added
    cabal-install: v2-build system
    on Apr 30, 2017
  2. added a commit that references this issue on Apr 30, 2017
  3. ezyang commented on Apr 30, 2017

    @ezyang
    Contributor

    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.

  4. added a commit that references this issue on Apr 30, 2017
  5. ezyang commented on Apr 30, 2017

    @ezyang
    Contributor

    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.

  6. self-assigned this
    on Jun 14, 2017
  7. added a commit that references this issue on Jul 4, 2017
    b27fb01
  8. added a commit that references this issue on Jul 16, 2017
  9. m-renaud commented on Jan 30, 2018

    @m-renaud
    Contributor

    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!

  10. hvr commented on Jan 30, 2018

    @hvr
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cabal-install: v2-build system

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions