haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.61k stars 691 forks source link

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

Open ezyang opened 8 years ago

ezyang commented 8 years ago

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

dcoutts commented 8 years ago

My longer term plan was to use distinct config flag types (& corresponding cli/file parsers/printers) just for new-build & co, replacing the ones in cabal-install/Distribution/Client/{Setup,Config}.hs and not reusing any of these types from Cabal since the CLIs are now quite distinct.

Or to put it another way, I'd eliminate cabal-install/Distribution/Client/ProjectConfig/Legacy.hs and use parsers/printers directly for the types in cabal-install/Distribution/Client/ProjectPlanning/Types.hs, rather than re-using the existing parsers/printers and doing type conversions.