haskell / haskell/cabal

Cannot enable diagnostics colours without removing dist-newstyle.

Open
#6,177 1 comment 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

### Description of the problem:

I wanted to have distnostics colours enabled. I figured I should pass the corresponding flag to `ghc`. However, I have discovered that it has no effect unless I first entirely remove the `dist-newstyle` directory.

### Try it yourself:

1. Create a project with a compilation error.

2. Run `cabal new-build`. The output will be monochrome, as expected.

3. Run `cabal --ghc-options=-fdiagnostics-color=always new-build`. The output will be monochrome, contrary to expectations.

4. Run `rm -rf dist-newstyle`. This will reset the state of the build system.

5. Run `cabal --ghc-options=-fdiagnostics-color=always new-build`. The output will be colourful, as expected.

6. Run `cabal new-build`. The output will be colourful, contrary to expectations.

### System informataion:
- Operating system: Arch Linux / nix
- Cabal 3.1.0.0 is freshly built from the `master` branch, commit `83b27d925`, build environment is instantiated via `nix-shell --packages cabal-install ghc zlib pkg-config`.

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior in a small failing Cabal project using the listed new-build commands, then search the repository for dist-newstyle and ghc-options handling. Done means diagnostics-color settings take effect without deleting dist-newstyle, and a later cabal new-build does not unexpectedly retain a prior invocation's color setting.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.