haskell / haskell/cabal

Negated GHC flags don't cancel out in package hash

Open
#9,076 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

As a concrete example, I enable `ghc-options: -haddock` in my global config, and pass `--ghc-options=-no-haddock` when cross-compiling. As a result, much of my store has `cabal-hash.txt`s with `ghc-options: -haddock -no-haddock`, which is the same in principle as passing no GHC flags at all.

This has the potential to cause some cache misses.

Contributor guide

Open the contributing guide

Research direction

Start by tracing where cabal-hash.txt records ghc-options and how global configuration is combined with --ghc-options. Reproduce the -haddock/-no-haddock example, then verify that the resulting package hash matches the equivalent build with no GHC flags and cover the behavior with focused regression testing.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.