git.iko.soy/typeable/cabal2nix
on master help sign in
finalizeGenericPackageDescription: don't rely on defaultComponentRequestedSpec

A record update on defaultComponentRequestedSpec is no safer than just constructing an instance of the type directly, because there is a mysterious second constructor, OneComponentRequestedSpec, that our record update won't match if defaultComponentRequestedSpec turns out to be such a thing for some reason. Curiously enough, we have helper functions that can query the state of the ComponentRequestedSpec type, but we cannot easily manipulate it.

commit00e5cd2725182963d1c7b838a1063018fcf3e319 authorPeter Simons <simons@cryp.to> dateThu 28 Jun 2018, 14:14 (8 years ago) parent7ccbd66
1 file changed+1−1
src/Distribution/Nixpkgs/Haskell/FromCabal.hs+1−1
src/Distribution/Nixpkgs/Haskell/FromCabal.hs+1−1
@@ -53,7 +53,7 @@ finalizeGenericPackageDescription haskellResolver arch compiler flags constraint
5353 finalize resolver = finalizePD flags requestedComponents resolver arch compiler constraints genDesc
5454
5555 requestedComponents :: ComponentRequestedSpec
56− requestedComponents = defaultComponentRequestedSpec
56+ requestedComponents = ComponentRequestedSpec
5757 { testsRequested = True
5858 , benchmarksRequested = True
5959 }