feat(Cabal, cabal-install): Display -O and -g as numeric levels instead of booleans - #11937
feat(Cabal, cabal-install): Display -O and -g as numeric levels instead of booleans#11937zlonast wants to merge 4 commits into
Conversation
f9af0be to
0eeaea7
Compare
0eeaea7 to
c08916a
Compare
7b61363 to
f7abbb6
Compare
|
@ffaf1 notices this seems to change the behaviour of cabal (namely, it's output). If so, a different PR template should be used, which asks for a different set of tasks. Would it be possible to add a test that prints the |
011259e to
5d8b49f
Compare
83a898c to
14c4a11
Compare
|
It seems it needs a rebase now. |
14c4a11 to
7552c00
Compare
Mikolaj
left a comment
There was a problem hiding this comment.
I don't pretend to have read the whole newest diff, but it seems solid overall. Thank you.
|
|
||
| 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 `1`, while `False` renders as `0`. | ||
| - For the `-g` (debug info) flag, `True` or an unspecified value now renders `2`, while `False` renders as `0`. |
There was a problem hiding this comment.
On this branch (and not on the master branch), there seems to be two conflicting -g options:
$ cabal run cabal-install:exe:cabal -- build --help
...
Usage: cabal build [TARGETS] [FLAGS]
...
Flags for build:
...
-g, --ghc compile with GHC
...
-g n or -gn, --enable-debug-info=n
Emit debug info (n is 0--3, default is 0)
...
Is -g treated differently than -g n or -gn?
There was a problem hiding this comment.
If the -g option is re-associated with debug info then this pull request fixes #2056.
There was a problem hiding this comment.
I think we can simply redefine the flag, and few people will notice, since it doesn't appear in libraries or executables.
Those who do notice will now use the full flag. As I understand it, these are the people who manually enter flags in the console.
Currently, this is mostly LLM, which makes this change even more valuable for them.
7552c00 to
538ea9e
Compare
538ea9e to
9ac9012
Compare
|
|
||
| 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 `1`, while `False` renders as `0`. | ||
| - For the `-g` (debug info) flag, `True` or an unspecified value now renders `2`, while `False` renders as `0`. |
There was a problem hiding this comment.
Can you please mention that the short -g flag was previously associated with --ghc?
There was a problem hiding this comment.
Updated the changelog
9ac9012 to
e1f64e1
Compare
e1f64e1 to
faa6838
Compare
This PR improves the handling of the
debug-infoandoptimizationfield to ensure consistency between its configuration and CLI representations.Changes
NoDebugInfovalue as0instead ofFalsein~/.config/cabal/config.DebugInfoLevelbetweenpkgHashDebugInfoand theParsecinstance. This resolves potential inconsistencies when processing manually generated configuration files.debug-infofield. The parser now properly handles both boolean and integer inputs.Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR: