Skip to content

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

Merged
mergify[bot] merged 1 commit into
haskell:masterfrom
ulysses4ever:copilot/fix-upstream-bug-10487
May 10, 2026
Merged

Fix cabal run's handling of -- under empty target#11786
mergify[bot] merged 1 commit into
haskell: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
@mergify mergify Bot added merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days queued labels May 10, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 10, 2026

Merge Queue Status

This pull request spent 1 hour 52 minutes 2 seconds in the queue, including 1 hour 41 minutes 28 seconds running CI.

Required conditions to merge
  • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Doctest Cabal
    • check-neutral = Doctest Cabal
    • check-skipped = Doctest Cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Meta checks
    • check-neutral = Meta checks
    • check-skipped = Meta checks
  • any of [🛡 GitHub branch protection]:
    • check-success = docs/readthedocs.org:cabal
    • check-neutral = docs/readthedocs.org:cabal
    • check-skipped = docs/readthedocs.org:cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Validate post job
    • check-neutral = Validate post job
    • check-skipped = Validate post job
  • any of [🛡 GitHub branch protection]:
    • check-success = fourmolu
    • check-neutral = fourmolu
    • check-skipped = fourmolu
  • any of [🛡 GitHub branch protection]:
    • check-success = hlint
    • check-neutral = hlint
    • check-skipped = hlint
  • any of [🛡 GitHub branch protection]:
    • check-success = Bootstrap post job
    • check-neutral = Bootstrap post job
    • check-skipped = Bootstrap post job
  • any of [🛡 GitHub branch protection]:
    • check-success = whitespace
    • check-neutral = whitespace
    • check-skipped = whitespace
  • any of [🛡 GitHub branch protection]:
    • check-success = Check sdist post job
    • check-neutral = Check sdist post job
    • check-skipped = Check sdist post job
  • any of [🛡 GitHub branch protection]:
    • check-success = Changelogs
    • check-neutral = Changelogs
    • check-skipped = Changelogs

mergify Bot added a commit that referenced this pull request May 10, 2026
@mergify mergify Bot merged commit e7aaad8 into haskell:master May 10, 2026
137 checks passed
@mergify mergify Bot removed the queued label May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days 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