Unrecognized Cabal flag error is printed to stdout
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 64/100
Research direction
Reproduce the issue with a custom Setup.hs and the shown cabal file, then run cabal repl src/MyLib.hs --keep-temp-files while capturing stdout and stderr separately. Trace the cabal repl handling of the unrecognized option and add or update coverage so the error is emitted on stderr while the command's failure remains reported correctly.
Written by the indexing model from the issue text.
Description
Describe the bug
When a flag to a Setup.hs is not recognized, then the error message is printed to stdout.
This is not what I would have expected.
To Reproduce
$ mkdir a-with-custom
$ cd a-with-custom
$ cabal init --lib --minimal -n
Then modify the cabal file:
cabal-version: 3.0
name: a-with-custom
version: 0.1.0.0
build-type: Custom
custom-setup
setup-depends:
Cabal <3.16,
base
library
exposed-modules: MyLib
build-depends: base
hs-source-dirs: src
default-language: Haskell2010
Then run cabal repl src/MyLib.hs --keep-temp-files:
Warning: this is a debug build of cabal-install with assertions enabled.
Resolving dependencies...
Build profile: -w ghc-9.10.3 -O1
In order, the following will be built (use -v for more details):
- a-with-custom-0.1.0.0 (interactive) (first run)
unrecognized 'repl' option `--keep-temp-files'
Error: [Cabal-7125]
repl failed for a-with-custom-0.1.0.0.
HasCallStack backtrace:
collectBacktraces, called at libraries/ghc-internal/src/GHC/Internal/Exception.hs:169:13 in ghc-internal:GHC.Internal.Exception
toExceptionWithBacktrace, called at libraries/ghc-internal/src/GHC/Internal/IO.hs:260:11 in ghc-internal:GHC.Internal.IO
throwIO, called at libraries/ghc-internal/src/GHC/Internal/Control/Exception/Base.hs:195:43 in ghc-internal:GHC.Internal.Control.Exception.Base
The error unrecognized 'repl' option `--keep-temp-files' is printed to stdout.
Expected behavior
The error message unrecognized 'repl' option --keep-temp-files'` should be printed to stderr, imo.
System information
- Operating system
cabal3.16.1.0and cabal HEAD 4907eec7b275aa0e1a31333fc745b3cc9f023f4f
- Dominant language
- Haskell
- Stars
- 1.8k
- Forks
- 766
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 27
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from haskell/cabal
-
needs triage type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
haskell/cabal#12568 · 1 comment ·
Maintainers usually reply within 3 days
-
needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
haskell/cabal#12525 · 3 comments · 1 reaction ·
Maintainers usually reply within 3 days
-
Required version of `cabal-install` to build CabalPossibly taken @philderbeast claimed this 24 days ago. Opendocumentation type: discussion
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
haskell/cabal#12477 · 2 comments · 1 assignee ·
Maintainers usually reply within 3 days
-
Document which are our LTS releasesPossibly taken @KeuqS claimed this 41 days ago. Opendocumentation type: discussion
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
haskell/cabal#12373 · 2 comments ·
Maintainers usually reply within 3 days
Similar issues
-
bug desktop
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
simplex-chat/simplex-chat#8291 ·
Maintainers usually reply within 1 day
-
[BUG]: C# programs with top-level statements fail to compilePossibly taken @AsyncNigam claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
compiler-explorer/compiler-explorer#9625 · 1 comment ·
Maintainers usually reply within 1 day
-
reflex-0.10Open
Difficulty 1/5 Under an hour Newbie friendliness 62/100
commercialhaskell/stackage#8180 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenZeppelin/canton-contracts#140 ·
Maintainers usually reply within 1 day
-
takeInterval yields nothing, dropInterval drops nothingPossibly taken @GuillaumedeVolpiano claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
composewell/streamly#3271 ·