haskellPackages.mkDerivation: New intermediates output#227985
haskellPackages.mkDerivation: New intermediates output#227985cdepillabout merged 7 commits intoNixOS:haskell-updatesfrom
intermediates output#227985Conversation
There was a problem hiding this comment.
Can we do btter than this? This test would succeed as well if the intermediates were just ignored.
There was a problem hiding this comment.
Hm. We could add a check to the buildPhase to make sure that find dist/build | wc -l is positive, or something? I'm open to suggestions here.
The nice thing about incremental builds in general is that they degrade gracefully — the build works just as well without the intermediates, it's just slower.
In any case, this test does confirm that the code to copy the intermediate artifacts doesn't break the build.
There was a problem hiding this comment.
The nice thing about incremental builds in general is that they degrade gracefully
Yeah, I was thinking about this as well, and this is the same conclusion I came to. I couldn't think of a good way to test that the intermediates were actually being used (without doing something hacky/brittle), but this does test at least that the intermediate artifacts don't break the build.
There was a problem hiding this comment.
New arguments should also be documented in the nixpkgs manual.
There was a problem hiding this comment.
I wonder if we can find a better dir for this (under share?) that includes pname and version so there are no collisions if enableSeparateIntermediatesOutput is false and it is installed by accident.
There was a problem hiding this comment.
Good idea. I updated this to install intermediates to share/haskell/${ghc.version}/${pname}-${version}/dist. I think it might be better to key them under ${pname} rather than ${pname}-${version}, though — we wouldn't want to have an incremental build cache miss just because a version number incremented. Let me know what you think.
cdepillabout
left a comment
There was a problem hiding this comment.
This LGTM.
Sorry to take so long with this. Could you fix the merge conflicts? Then lets merge in.
This adds a new `intermediates` output that can be used to accelerate a Haskell build by importing build products exported from a prior similar build. The motivation for this is explained by the following post: https://www.haskellforall.com/2022/12/nixpkgs-support-for-incremental-haskell.html
Co-authored-by: sternenseemann <sternenseemann@systemli.org>
c6e5e85 to
ec2938b
Compare
|
Fixed merge conflicts. |
|
Thanks! Looking forward to see if anyone uses this in any interesting ways. |
|
Please remember to make to rebase the branch to have conforming commit messages next time! |
This adds a new
intermediatesoutput that can be used to accelerate a Haskell build by importing build products exported from a prior similar build.The motivation for this is explained by the following post:
https://www.haskellforall.com/2022/12/nixpkgs-support-for-incremental-haskell.html
This is a subset of the changes from #204020 that I believe are safe to merge while waiting for NixOS/nix#7362 to be reviewed. I've incorporated outstanding feedback from the last PR into this one.
I structured this to be a hash-preserving changes for Haskell packages that don't use the feature, so this won't trigger unnecessary rebuilds or breakage.
This is a redo of #213817 since that inadvertently subscribed too many people to the pull request discussion.
Description of changes
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes