haskell / haskell/cabal

Cabal 3.10.1.0 ignoring `-fdiagnostics-color` option

Open
#9,188 0 comments 0 reactions 0 assignees View on GitHub
cabal-install: cmd/build re: user experience type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**
There is no way to disable GHC diagnostic coloring.

**To Reproduce**
Steps to reproduce the behavior:
issue `cabal build --ghc-options=-fdiagnostics-color=never` and watch colored errors emerge.

**Expected behavior**
With above args, uncolored error output.

**System information**
- Operating system
OS X 13.4 (ARM)
- `cabal`, `ghc` versions
cabal 3.10.1.0, ghc 9.6.2

**Additional context**
If you run `cabal -v --ghc-options=-fdiagnostics-color=never` and retrieve the GHC command, you can (a) see that the option is NOT being added and (b) if you issue the GHC command yourself and add `-fdiagnostics-color=never`, the colorization goes away.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with cabal build --ghc-options=-fdiagnostics-color=never, then inspect the verbose GHC command generation and option-forwarding path. Done means the option appears in the generated GHC command and the resulting diagnostic output is uncolored.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.