-
Notifications
You must be signed in to change notification settings - Fork 250
Reduce the number of derivations #1605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
b4a36e9
9b06216
ad6a27a
1069180
d7004ee
08bb11b
c94ed63
417a7da
afb52d9
1aa5e2b
16e23cb
11fe87c
12ecc24
51737c7
82cda52
af62a32
14f7a4b
362b982
07c4426
c744c1e
0c6f255
557bebc
acb0eb0
d17dcbf
872cb27
db3ca22
ba5bc4e
46846bf
42d08a6
e894bc2
9499917
5f32a61
eb6e1c2
0dedd34
eccd186
bbcc46f
1d7f07d
a17863c
2611a66
0acd595
8a0d0d1
eec5710
204296f
a39ad04
0e3417a
9621d93
09fec30
b5f42a5
8021d30
489111a
db5eff6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ let | |
finalConfigureFlags = lib.concatStringsSep " " ( | ||
[ "--prefix=${componentDrv}" | ||
"${haskellLib.componentTarget componentId}" | ||
"$(cat ${docsConfigFiles}/configure-flags)" | ||
"$(cat $configFiles/configure-flags)" | ||
] | ||
++ commonConfigureFlags | ||
++ lib.optional doHaddock' " --docdir=${docdir "$doc"}"); | ||
|
@@ -66,7 +66,7 @@ let | |
configFiles = docsConfigFiles; | ||
|
||
# The directory containing the haddock documentation. | ||
haddockDir = if doHaddock' then "${docdir drv.doc}/html" else null; | ||
haddockDir = lib.const (if doHaddock' then "${docdir drv.doc}/html" else null); | ||
}; | ||
|
||
# `out` contains the `package.conf.d` files used for building the | ||
|
@@ -75,16 +75,22 @@ let | |
outputs = ["out"] | ||
++ lib.optional doHaddock' "doc"; | ||
|
||
propagatedBuildInputs = builtins.concatLists pkgconfig; | ||
propagatedBuildInputs = | ||
builtins.concatLists pkgconfig | ||
++ configFiles.libDeps; | ||
|
||
buildInputs = component.libs | ||
++ map (d: d.components.library.haddock or d) component.depends; | ||
buildInputs = component.libs; | ||
|
||
nativeBuildInputs = | ||
[ shellWrappers buildPackages.removeReferencesTo ] | ||
[ ghc buildPackages.removeReferencesTo ] | ||
++ componentDrv.executableToolDepends; | ||
|
||
configurePhase = '' | ||
configFiles=$(mktemp -d) | ||
${docsConfigFiles.script} | ||
wrappedGhc=$(mktemp -d) | ||
${shellWrappers.script} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now we're composing all these shell scripts together, maybe we should actually call them and pass the locations to write to as arguments rather than (effectively) sourcing them and passing arguments through variables? Not sure, just seems a little more explicit. |
||
PATH=$wrappedGhc/bin:$PATH | ||
runHook preConfigure | ||
echo Configure flags: | ||
printf "%q " ${finalConfigureFlags} | ||
|
@@ -145,7 +151,7 @@ let | |
# working hyper links. | ||
pkg=$(basename "$i") | ||
sed -e "s|haddock-interfaces:.*|haddock-interfaces: $docdir/html/${componentId.cname}.haddock|" -e "s|haddock-html:.*|haddock-html: $docdir/html/|" "$i" > "$pkg" | ||
${ghc.targetPrefix}ghc-pkg -v0 --package-db ${docsConfigFiles}/${configFiles.packageCfgDir} -f $out/package.conf.d register "$pkg" | ||
${ghc.targetPrefix}ghc-pkg -v0 --package-db $configFiles/${configFiles.packageCfgDir} -f $out/package.conf.d register "$pkg" | ||
done | ||
|
||
ln -s ${componentDrv}/exactDep $out/exactDep | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,15 +41,17 @@ let | |
|
||
setup = if package.buildType == "Simple" | ||
then ghc.defaultSetupFor package.identifier.name | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not that it makes much difference, but it sort of feels like I'd expect the setup exectuable to be associated with a cabal derivation rather than a GHC derivation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would allow the project to select a newer or older version of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that good or bad? I think probably good? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes good. I'll try to set this up. I think we might need to keep the version of default setup built with Cabal from GHC on the ghc derivation (probably makes sense to have it there and for booting I think it might be necessary). |
||
else setup-builder { | ||
else setup-builder ({ | ||
component = components.setup // { | ||
depends = config.setup-depends ++ components.setup.depends ++ package.setup-depends; | ||
extraSrcFiles = components.setup.extraSrcFiles ++ [ "Setup.hs" "Setup.lhs" ]; | ||
pkgconfig = if components ? library then components.library.pkgconfig or [] else []; | ||
}; | ||
inherit package name src flags revision patches defaultSetupSrc; | ||
inherit (pkg) preUnpack postUnpack; | ||
}; | ||
} // lib.optionalAttrs (package.buildType != "Custom") { | ||
nonReinstallablePkgs = ["base" "Cabal"]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. comment? |
||
}); | ||
|
||
buildComp = allComponent: componentId: component: comp-builder { | ||
inherit allComponent componentId component package name src flags setup cabalFile cabal-generator patches revision | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should just throw an error if it's before then? Otherwise it's probably surprising to people that this might pull in a whole extra nixpkgs?