Cannot enable diagnostics colours without removing dist-newstyle.
- 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
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