-
Notifications
You must be signed in to change notification settings - Fork 701
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
cabal new-run foo should default to exe:foo (same for test and bench) #4676
Comments
@fgaz, can you take a look at this? I think that old-run doesn't have this problem. |
Yup, old cabal works. |
The problem is that the target resolution happens before any new-run code. The If no explicit targets are specified, that function doesn't get called at all because, up in the call stack, If we want to fix this we probably want to pass the action directly to Or maybe we should pass a filtering function like we do in |
My suggestion is to add another parameter, but don't try very hard to make it general. Like it could just be |
Does the same issue occur for |
Yes. All |
@ezyang as per #4602 (comment), this probably needs a general solution now |
If I have a project
foo.cabal
that defines both a library and an executable namedfoo
, which is a common situation, then currentlycomplains that it does not know whether I want to run
foo
the library or foo the executable, and makes me writeI see how this behavior makes sense for
cabal new-build
etc, but I do not even know what it means tocabal new-run
a library. And even if that makes sense, I believe the ambiguity should just be resolved to the executable by default.The text was updated successfully, but these errors were encountered: