Skip to content

fix(Cabal): Accept boolean values for debug-info and optimization levels - #12202

Merged
mergify[bot] merged 5 commits into
haskell:masterfrom
zlonast:zlonast/boolean-debug-info
Nov 7, 2026
Merged

mergify[bot] merged 5 commits into
haskell:masterfrom
zlonast:zlonast/boolean-debug-info

Conversation

@zlonast

@zlonast zlonast commented Aug 2, 2026 •

Copy link
Copy Markdown
Collaborator

fix: #12140

debug-info: False ​​are treated as NoDebugInfo, and debug-info: True ​​are treated as NormalDebugInfo


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

@zlonast
zlonast requested a review from philderbeast August 21, 2026 12:47
Comment thread changelog.d/12202.md Resolved

@philderbeast philderbeast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're parsing booleans for debug-info in the project, would that also apply to the command line? If not, is error the best message?

$ cabal build --help
...
--enable-debug-info[=n]        Emit debug info (n is 0--3, default is 0)
--disable-debug-info           Don't emit debug info
$ cabal run cabal-install:exe:cabal -- build all --dry-run \
   --enable-debug-info=True
...
Can't parse debug info level True

HasCallStack backtrace:
  error, called at src/Distribution/Simple/Compiler.hs:383:8 in
  Cabal-3.19.0.0-inplace:Distribution.Simple.Compiler

$ cabal-3.18.1.0 build all --dry-run --enable-debug-info=True
Can't parse debug info level True
CallStack (from HasCallStack):
  error, called at src/Distribution/Simple/Compiler.hs:392:8 in
  Cabal-3.18.1.0-inplace:Distribution.Simple.Compiler

@zlonast

zlonast commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

@philderbeast Thanks for such a detailed review, yes, I think this approach should be applied to the command line as well.

@zlonast
zlonast force-pushed the zlonast/boolean-debug-info branch from d922696 to cb58f67 Compare August 22, 2026 06:16
@zlonast zlonast changed the title fix(Cabal): Fix parsing of boolean values to debug-info fix(Cabal): Accept boolean values for debug-info and optimization levels Aug 22, 2026
@zlonast
zlonast requested a review from philderbeast August 22, 2026 06:50
@zlonast zlonast added re: flag Concerning user-defined flags in cabal files re: options Concerning command-line options labels Aug 23, 2026
@zlonast
zlonast force-pushed the zlonast/boolean-debug-info branch from cb58f67 to c1e1882 Compare October 14, 2026 15:05

@Mikolaj Mikolaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

@zlonast zlonast added merge me Tell Mergify Bot to merge and removed attention: needs-review labels Nov 5, 2026
@mergify mergify Bot added ready and waiting Mergify is waiting out the cooldown period merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days queued labels Nov 5, 2026
@mergify

mergify Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into master as 8ded4e7 at 04:30 UTC

1 h 58 min in the queue, 1 h 47 min of it CI.

So far

12 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = Doctest Cabal
    • check-neutral = Doctest Cabal
    • check-skipped = Doctest Cabal
  • any of · required by GitHub branch protection:
    • check-success = Meta checks
    • check-neutral = Meta checks
    • check-skipped = Meta checks
  • any of · required by GitHub branch protection:
    • check-success = docs/readthedocs.org:cabal
    • check-neutral = docs/readthedocs.org:cabal
    • check-skipped = docs/readthedocs.org:cabal
  • any of · required by GitHub branch protection:
    • check-success = Validate post job
    • check-neutral = Validate post job
    • check-skipped = Validate post job
  • any of · required by GitHub branch protection:
    • check-success = fourmolu
    • check-neutral = fourmolu
    • check-skipped = fourmolu
  • any of · required by GitHub branch protection:
    • check-success = hlint
    • check-neutral = hlint
    • check-skipped = hlint
  • any of · required by GitHub branch protection:
    • check-success = Bootstrap post job
    • check-neutral = Bootstrap post job
    • check-skipped = Bootstrap post job
  • any of · required by GitHub branch protection:
    • check-success = whitespace
    • check-neutral = whitespace
    • check-skipped = whitespace
  • any of · required by GitHub branch protection:
    • check-success = Check sdist post job
    • check-neutral = Check sdist post job
    • check-skipped = Check sdist post job
  • any of · required by GitHub branch protection:
    • check-success = Changelogs
    • check-neutral = Changelogs
    • check-skipped = Changelogs

Times in UTC · dashboard · how the merge queue works

@mergify
mergify Bot merged commit 8ded4e7 into haskell:master Nov 7, 2026
91 of 93 checks passed
@mergify mergify Bot removed the queued label Nov 7, 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 re: flag Concerning user-defined flags in cabal files re: options Concerning command-line options ready and waiting Mergify is waiting out the cooldown period

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parsec project parser can't parse debug-info boolean

4 participants