-
Notifications
You must be signed in to change notification settings - Fork 711
fix list-bin to only choose the selected component #7791
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good bar comments!
This will need a changelog entry and at least a regression test. Since the logic to test is in listBinAction
and not in select*
, it will have to be a package test
The CI failures seem random, so probably everything is fine. |
@larskuhtz: great, so with a changelog and some minimal test we could merge. Let us know if you need any help with those. |
@larskuhtz: ping? |
May I ask what's preventing merge of this PR? |
Sorry, for not getting back earlier. I am not familiar with writing tests for cabal commands. I can give it a try, but if someone else wants to do it that would be welcome, too. |
No volunteers, it seems. ;) Please ask questions on Matrix/IRC or here. We'll try to help. I guess a couple of cases (that would fail previously, but work now), with automatically recorded outcomes, in |
@larskuhtz if you can create a simple cabal project that replicates the failure I can add it as a test for you |
@bacchanalia: yay, thank you! |
Just ran into this bug myself, here's a reduced example that should be suitable for a test case:
|
ping @bacchanalia |
@larskuhtz I've rebased your pr and added the test case @robx posted. Could you give me permissions to push it to your branch? Or would you prefer I sent you a PR? |
@bacchanalia you now have write access to https://github.com/hackage-package-forks/cabal Thanks a lot for moving this PR forward! |
9c1b988
to
a788216
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Splendid teamwork.
Could we have a minimal changelog file, too? |
I added a changelog file. Is this good to merge? |
@Mergifyio rebase |
❌ Pull request can't be updated with latest base branch changesMergify needs the author permission to update the base branch of the pull request. |
@bacchanalia: looks good, but could you rebase once last time? |
4fe5854
to
50d05bc
Compare
rebased |
Guys, great work! Any idea when it will become a release? I.e, efficient version would include this fix? |
@mouse07410: hi! I bet it will be in cabal 3.8. No release date yet. |
This PR resolves #7679. Currently, at least under certain circumstances,
list-bin
selects all executable components (including tests and benchmarks) from a package that matches the target selector. This PR fixes this by only selecting the component that match the component name that matches the target selector.Current behavior:
> cabal list-bin cabal-testsuite:exe:cabal-tests cabal: No or multiple targets given
Behavior with this PR:
NOTE: during the final selection only the component names but not the component kind are matched. If a package contains two components of different kind, but with the same name (not sure if that is possible), the wrong component might be selected.
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!