You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
'new-run' seems to not work when there's both an exe and a lib in a package #4608
Create a package with both a library and an executable in it.
Try to build and run it with a command like cabal new-run exe-name -- arg1 arg2.
This will fail with an error message similar to the following:
$ cabal new-run consumers-example -- args
Up to date
[...]/dist-newstyle/build/x86_64-linux/ghc-8.0.2/consumers-2.0.1/build/consumers-example/consumers-example: rawSystem: runInteractiveProcess: exec: does not exist (No such file or directory)
The problem is that the exe is actually under ./dist-newstyle/build/x86_64-linux/ghc-8.0.2/consumers-2.0.1/c/consumers-example/build/consumers-example/consumers-example (note the /c/consumers-example bit) in this configuration, so new-run predictably fails to find it.
I'm surprised this bug could have happened. Could it be extractMatchingElaboratedConfiguredPackages is not returning the elaborated component for the executable, but the library instead? I don't see any obvious bugs in the code.
Activity
ezyang commentedon Jul 19, 2017
I'm surprised this bug could have happened. Could it be
extractMatchingElaboratedConfiguredPackagesis not returning the elaborated component for the executable, but the library instead? I don't see any obvious bugs in the code.fgaz commentedon Jul 19, 2017
#4607 also fixes this. I'll add a test.
EDIT: added with 999d0f2
Add test for #4608: new-run on exe+library
Merge pull request #4607 from fgaz/new-run/reduce-duplication
int-index commentedon Aug 28, 2017
I've just encountered this issue. The upstream version of
cabalworks, but the one on Hackage doesn't. Maybe it's time for a release?fgaz commentedon Aug 28, 2017
@int-index
This seems to be part of https://github.com/haskell/cabal/milestone/45, due by the end of september
moll commentedon Dec 14, 2017
Is it me is
cabal new-runentirely out of its depths now with Cabal v2.0.1? With both a singleexecutableand an exe and lib together, I'm getting:A plain
cabal new-runreturns:cabal new-buildand a manual invocation of the exe indist-newstylework fine.moll commentedon Dec 14, 2017
Unless I'm mistaken with the 3 and 4 digit version numbers...
cabal --versionis returning v2.0.0.1, not v2.0.1 as https://github.com/haskell/cabal/milestone/45 lists...23Skidoo commentedon Dec 15, 2017
new-rundidn't make it into 2.0, try with HEAD or 2.2, which will be out next month.