-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
enable split-output builds for all haskellPackages #27196
Conversation
Woohoo! : -) |
@peti can we merge this to haskell updates and start testing? |
I think it would be beneficial to also split I think it only works with ghc 8.0+, so it should be conditionally enabled. |
I suggest we take this in stages, splitting data will help already, I fear the dynlib/lib split will cause another set of issues :) |
Pushed in 5e62090696a0e3408c89dd3a694b8fa02de35ac0. Test builds will run at http://hydra.nixos.org/jobset/nixpkgs/haskell-updates. |
Beat me by 12 hours. I've also been working on this - see #27209. Happy to try to work together to get this working! |
looking into this one
|
ghcjs has references to we will need to either fix ghcjs, or make the doc output optional |
About 200 failures, most due to dependencies. Most common cause for failures is 2)
|
@@ -323,6 +328,11 @@ stdenv.mkDerivation ({ | |||
done | |||
''} | |||
|
|||
for x in $doc/share/doc/html/src/*.html; do |
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.
Missing mkdir -p $doc
Another thing to check is if |
I pushed the updated version to |
@peti you seem to be the maintainer of https://nix-cache.s3.amazonaws.com/log/aclka6bq595zkcar1w8hbzwm2j5lk29h-hopenssl-2.2.1.drv - any tips how to fix that one? |
The hopenssl errors have been there before; that is an issue with the new version requiring Cabal 1.24.x or later; it's not related to the changes made in this PR. |
There are two leftover packages failing related to this change: (1) ghcjs: for this @cleverca22 suggests we just disable doc splitting as ghcjs created a reference cycle (bug in the code) (2) git-annex fails with
|
@peti (2) needs to be fixed in cabal2nix https://github.com/NixOS/cabal2nix/blob/6e90100bb68fcab84d862826622c72f3dc83a020/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs#L164 as it overrides |
@domenkozar, |
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.
We need a reasonably straight-forward way to disable multiple outputs for a given build, i.e. becaus the build uses a strange build system that's not capable of distinguishing binary, data, and doc installations paths.
Agreed :) |
6949b55
to
2bbe993
Compare
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.
I don't think that this change will do the trick. It assumes that we always have a $doc output, but at least in the case of git-annex
this is not the case: there is neither doc nor data, so really need to disable split outputs completely.
hxt-unicode = hasNoDataOutput super.hxt-unicode; | ||
primitive = hasNoDataOutput super.primitive; | ||
regex-base = hasNoDataOutput super.regex-base; | ||
logict = hasNoDataOutput super.logict; |
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.
Can't we infer this automatically somehow?
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.
you would have to read the contents of the cabal file, and potentially the Setup.hs
if they have modified it
the only other option (which i have temporarily turned back on to skip ahead), is to just make an empty data output always
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.
Oh, so perhaps cabal2nix
could generate it automatically? (most packages don't use a custom Setup.hs)
This branch is in a confusing state. :-) |
@peti if I understand correctly we just need to fix ghcjs (according to your fork and hydra). Then this branch can be closed. |
@@ -53,6 +53,8 @@ | |||
, coreSetup ? false # Use only core packages to build Setup.hs. | |||
, useCpphs ? false | |||
, hardeningDisable ? lib.optional (ghc.isHaLVM or false) "all" | |||
, hasDataDir ? true |
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.
10933 out of 11949 Haskell packages have hasDataDir = false
since they don't install any data files. Therefore, false
should be the default -- not true
-- so that we omit this attribute in 91% of all Haskell Nix expressions.
0d862e9f09a5fc4bf8414fa405df22f0d7c6984e adds that attribute to the package set for all expressions -- regardless of whether it's true or false -- so that we can switch the default in the generic builder easily.
@@ -53,6 +53,8 @@ | |||
, coreSetup ? false # Use only core packages to build Setup.hs. | |||
, useCpphs ? false | |||
, hardeningDisable ? lib.optional (ghc.isHaLVM or false) "all" | |||
, hasDataDir ? true | |||
, hasDocDir ? true |
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.
What exactly makes a Haskell build have a doc dir? Am I correct in assuming that this equivalent to doHaddock || extra-doc-files /= []
?
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.
if it installs anything into the directory specified by --docdir
@@ -24,15 +24,15 @@ self: super: { | |||
cabal-install = super.cabal-install.overrideScope (self: super: { Cabal = self.Cabal_1_24_2_0; }); | |||
|
|||
# Link statically to avoid runtime dependency on GHC. | |||
jailbreak-cabal = (disableSharedExecutables super.jailbreak-cabal).override { Cabal = self.Cabal_1_20_0_4; }; | |||
jailbreak-cabal = hasNoDataOutput ((disableSharedExecutables super.jailbreak-cabal).override { Cabal = self.Cabal_1_20_0_4; }); |
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.
I believe that those hasNoDataOutput
overrides can be safely removed now.
Yes, |
6b593ff
to
964510c
Compare
Hi, can I do something to help push this forward? Is |
@peti & @cleverca22: I think there is some miscommunication going on here. a) |
964510c
to
9062565
Compare
9062565
to
a39cad9
Compare
ghcjs is failing inside a dep with |
Merged to |
@peti Can/should this be backported? |
I would prefer to leave this out of release-17.03 since it's a pretty intrusive change with a high risk of breaking user environments or builds. It might be too much for a "stable release branch". |
@peti I agree, but that means you won't be able to update cabal2nix there since it now passes the extra flag to packages. |
We can simply add appropriate dummy arguments to the generic builder
function that have no effect. That way, cabal2nix-2.4-generated
expressions would still work in release-17.03.
|
Yeah I'd prefer not backporting this. :) |
for the packages i have tested, data and doc do not have the 1gig chunk of ghc in their closure
Motivation for this change
without this change, any haskell library that references its datadir will cause all programs using it to depend on ghc (over 1gig) at runtime
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)