5 ms·
Guix's graft system is a hack specifically made to get security updates out ASAP. They should really only be seen as a last resort because it circumvents the pr
by slabity 3y ago
Guix's graft system is a hack specifically made to get security updates out ASAP. They should really only be seen as a last resort because it circumvents the primary benefit of using Guix as a functional build system (pure, reproducible builds). I'm not sure if Nix has a similar system.
IMHO I'd prefer to see compile-time caches like ccache or sccache be better integrated into Nix while still providing the guarantees that a functional build system provides. That alone would save massive amounts of compute power when rebuilding packages, as you'd essentially only need to recompile the files that change in a package. Not only on continuous build systems like Nix's Hydra, but also when just rebuilding packages locally. This won't solve the storage cost issue, but would definitely alleviate compute costs.
- xyzzy_plugh 3y agoI've been curious but haven't seen any compile-time cache, even with an unsafe build. What's the state of the art for this today?
- slabity 3y agoIt's possible to bring something like `ccache` into your system's Nix sandbox. However, that change in the sandbox means all your packages have different hashes and you lose the ability to pull from upstream caches. The result would be rebuilding every single package when trying to update your system. Not a fun time. The preferred way to do this is to override `stdenv` with `ccacheStdenv` on the individual packages that would actually benefit from the compile-time caching. Such as for large packages that you already have overrides for, or for nightly packages that get updated extremely frequently and don't have the chance to be cached upstream (such as firefox-nightly). The NixOS Wiki has a pretty good article on this: https://nixos.wiki/wiki/CCache https://nixos.wiki/wiki/CCache I personally use this for any packages I override in an overlay to reduce build times significantly.