Skip to content

Fix cabal run's handling of -- under empty target#11786

Open
ulysses4ever wants to merge 1 commit intohaskell:masterfrom
ulysses4ever:copilot/fix-upstream-bug-10487
Open

Fix cabal run's handling of -- under empty target#11786
ulysses4ever wants to merge 1 commit intohaskell:masterfrom
ulysses4ever:copilot/fix-upstream-bug-10487

Conversation

@ulysses4ever
Copy link
Copy Markdown
Collaborator

@ulysses4ever ulysses4ever commented May 5, 2026

fix #10487, created with the help from AI (GitHub Copilot).


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

Comment thread cabal-install/src/Distribution/Client/CmdRun.hs Outdated
Comment thread cabal-install/src/Distribution/Client/CmdRun.hs Outdated
@ulysses4ever ulysses4ever force-pushed the copilot/fix-upstream-bug-10487 branch 3 times, most recently from e91bd54 to 02de5ac Compare May 6, 2026 14:05
@ulysses4ever ulysses4ever requested a review from philderbeast May 7, 2026 13:54
Comment thread cabal-testsuite/PackageTests/NewBuild/CmdRun/WarningRTS/cabal.test.hs Outdated
Comment thread Makefile Outdated
Comment thread cabal-install/src/Distribution/Client/CmdRun.hs Outdated
@ulysses4ever ulysses4ever added merge me Tell Mergify Bot to merge and removed attention: needs-review labels May 8, 2026
@mergify mergify Bot added the ready and waiting Mergify is waiting out the cooldown period label May 8, 2026
@ulysses4ever ulysses4ever force-pushed the copilot/fix-upstream-bug-10487 branch from 8190b02 to 3703431 Compare May 8, 2026 00:24
@ulysses4ever
Copy link
Copy Markdown
Collaborator Author

i removed the commit touching up the Makefile doctest setup since this issue has been attended to elsewhere

@ulysses4ever ulysses4ever force-pushed the copilot/fix-upstream-bug-10487 branch from 6a5f949 to cb107bb Compare May 8, 2026 00:27
@ulysses4ever
Copy link
Copy Markdown
Collaborator Author

Apparently some of the new tests were incorrect @philderbeast

@philderbeast
Copy link
Copy Markdown
Collaborator

Apparently some of the new tests were incorrect @philderbeast

The review comment substitution didn't work. It didn't delete lines 3 .. 16 (in what I'm seeing now with cb107bb) that I'd included in the selection for replacement.

I think you may also need a type annotation for the opts:

+ opts1, opts2, opts3 :: [String]
  opts1 = ["+RTS"]
  opts2 = ["+RTS", "--"]
  opts3 = ["--", "+RTS"]

You'll also need to run the test with --accept to generate cabal-testsuite/PackageTests/NewBuild/CmdRun/WarningRTS/cabal.no-target.out.

@ulysses4ever
Copy link
Copy Markdown
Collaborator Author

Thanks, will fix. Also: those opts make tests harder to read imo, so I plan to inline them.

@ulysses4ever ulysses4ever force-pushed the copilot/fix-upstream-bug-10487 branch from cb107bb to 2a04e8d Compare May 8, 2026 14:52
Before, the number of targets were considered to be 1 always
and worked mostly by accident for the empty target when no exe args were supplied.

Fixes haskell#10487

Agent-Logs-Url: https://github.com/ulysses4ever/cabal/sessions/b504e919-a7ba-422e-90d2-59528a8e5014

Co-authored-by: ulysses4ever <6832600+ulysses4ever@users.noreply.github.com>

Co-authored-by: Phil de Joux <philderbeast@gmail.com>

Co-authored-by: Phil de Joux <philderbeast@gmail.com>
@ulysses4ever ulysses4ever force-pushed the copilot/fix-upstream-bug-10487 branch from 2a04e8d to e775ba8 Compare May 8, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge me Tell Mergify Bot to merge ready and waiting Mergify is waiting out the cooldown period

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cabal run with empty target can't pass options to executable

4 participants