git.iko.soy/typeable/nixpkgs
on master help sign in
haskell generic builder: `setupHaskellDepends` should be `nativeBuildInputs

This is because they are just for Setup.hs, so they are just used at build time and completely isolated from the normal components' dependencies. This was previous implemented in 8a8f0408cd9b7fdda1095718107c800057658c44, but reverted in e69c7f56419589c0d3296e81f47032fa813cca4b because it broken setup-depends non-cross in haskell shell environments (custom Setup.hs in cross shell environments has never worked). This version adds a special native exception to avoid that breakage.

commite1b9419dec7fa09a4d08482ed8156b4bba90bd51 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateMon 21 May 2018, 14:44 (9 years ago) parent513cd3d
1 file changed+6−2
pkgs/development/haskell-modules/generic-builder.nix+6−2
pkgs/development/haskell-modules/generic-builder.nix+6−2
@@ -169,18 +169,22 @@ let
169169 optionals doCheck testPkgconfigDepends ++ optionals doBenchmark benchmarkPkgconfigDepends;
170170
171171 nativeBuildInputs = [ ghc nativeGhc removeReferencesTo ] ++ optional (allPkgconfigDepends != []) pkgconfig ++
172+ setupHaskellDepends ++
172173 buildTools ++ libraryToolDepends ++ executableToolDepends;
173174 propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends;
174− otherBuildInputs = setupHaskellDepends ++ extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++
175+ otherBuildInputs = extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++
175176 allPkgconfigDepends ++
176177 optionals doCheck (testDepends ++ testHaskellDepends ++ testSystemDepends ++ testToolDepends) ++
177178 optionals doBenchmark (benchmarkDepends ++ benchmarkHaskellDepends ++ benchmarkSystemDepends ++ benchmarkToolDepends);
179+
178180 allBuildInputs = propagatedBuildInputs ++ otherBuildInputs;
179181
180182 haskellBuildInputs = stdenv.lib.filter isHaskellPkg allBuildInputs;
181183 systemBuildInputs = stdenv.lib.filter isSystemPkg allBuildInputs;
182184
183− ghcEnv = ghc.withPackages (p: haskellBuildInputs);
185+ # When not cross compiling, also include Setup.hs dependencies.
186+ ghcEnv = ghc.withPackages (p:
187+ haskellBuildInputs ++ stdenv.lib.optional (!isCross) setupHaskellDepends);
184188
185189 setupCommand = "./Setup";
186190