haskell / haskell/cabal

nix-local-build is too tightly coupled to ConfigFlags, etc.

Open
#3,549 1 comment 0 reactions 0 assignees View on GitHub
cabal-install: v2-build system type: discussion
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

If I add a new flag to `ConfigFlags`, there are three places I need to update in cabal-install: `cabal-install/Distribution/Client/Config.hs`, `cabal-install/Distribution/Client/ProjectConfig/Legacy.hs` and `cabal-install/Distribution/Client/ProjectPlanning.hs`. This seems like too many. Two of these are making a Monoid instance; surely this instance could live in Cabal? Could the rest be done using the default flags? Surely that's better?

CC @dcoutts

Contributor guide

Open the contributing guide

Research direction

Start by comparing ConfigFlags handling in cabal-install/Distribution/Client/Config.hs, cabal-install/Distribution/Client/ProjectConfig/Legacy.hs, and cabal-install/Distribution/Client/ProjectPlanning.hs. Trace the Monoid instances and default-flag flow, then determine whether the coupling can be reduced without requiring three updates for each new ConfigFlags field. Done means the issue's proposed simplification is implemented and the affected configuration behavior remains consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, cli
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.