Incremental builds
To lower cycle times and improve dx.
Ideas have come up to implement incremental builds for Nix via a snapshot build input taken from outputs = [ "incremental" ] which had been specifically crafted to forward language specific build artifacts in ways that the build toolchain furthermore can detect them as cached.
An incremental build has effectively two significant inputs: src & snapshot artifacts.
This pattern can be expected to significantly speed up subsequent builds in a feature branch. Hence, CI cycle time.
References:
- https://discourse.nixos.org/t/nixpkgs-support-for-incremental-haskell-builds/24115/6
- https://github.com/NixOS/nixpkgs/pull/167670
- https://github.com/NixOS/nixpkgs/pull/204020
- https://github.com/NixOS/nix/pull/7362
- motivation: https://www.haskellforall.com/2022/12/nixpkgs-support-for-incremental-haskell.html
- https://felixspringer.xyz/homepage/blog/incrementalHaskellBuildsWithNix
Seems a little out of scope to modify the build process of the caller in CI. Perhaps this would be a better issue for Standard proper?
I wondered. It looks like the only way to preserve purity is a CI action to gitops build references back into the source repo.
See: https://discourse.nixos.org/t/nixpkgs-support-for-incremental-haskell-builds/24115/11?u=blaggacao
@angerman Are there maybe already plans to ready haskell.nix for the incremental build approach? Or will there be?