Skip to content

Allow case insensitive bools and move to numeric render#11828

Open
zlonast wants to merge 1 commit into
haskell:masterfrom
zlonast:zlonast/allow-case-insensitive
Open

Allow case insensitive bools and move to numeric render#11828
zlonast wants to merge 1 commit into
haskell:masterfrom
zlonast:zlonast/allow-case-insensitive

Conversation

@zlonast
Copy link
Copy Markdown
Collaborator

@zlonast zlonast commented May 15, 2026

The .cabal file parser now accepts boolean values in a case‑insensitive manner (true, True, TRUE, false, etc.) without emitting a warning.
Previously only True and False were treated as “standard”, and other capitalisations triggered a parse warning. That warning was introduced in 2008 as a backwards‑compatibility shim to prevent Hackage uploads that would break very old Cabal versions. Since all supported Cabal releases can now handle case‑insensitive booleans, the warning has been removed as unnecessary.

Additionally, the rendering of certain boolean‑like flags has been changed to use numeric levels:

  • For the -O (optimisation) flag, True or an unspecified value now renders as -O1, while False renders as -O0.
  • For the -g (debug info) flag, True or an unspecified value now renders -g2, while False renders as -g0.
    This makes the displayed compiler flags more consistent with their internal semantics (e.g. optimisation level 1 is the default).

origin commit in 2008: e92d6573#r185301031

research done by @jappeace: https://github.com/haskell/cabal/pull/11716/changes#r3243914138

Template B: This PR does not modify behaviour or interface

E.g. the PR only touches documentation or tests, does refactorings, etc.

Include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

Co-authored-by: Jappie Klooster <jappieklooster@hotmail.com>
@zlonast zlonast force-pushed the zlonast/allow-case-insensitive branch from 4e15a9c to c846c51 Compare May 15, 2026 10:25
@zlonast
Copy link
Copy Markdown
Collaborator Author

zlonast commented May 15, 2026

@philderbeast You often make pull requests like this, I'm interested in your opinion on this matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant