Nix-build-uncached: released 1.0.0

nix-build-uncached is a tool to make nix-build more efficient when running CIs that are not nix-aware such as github actions or travis ci.
It will only build derivations that are not available in any binary cache.
With the 1.0.0 release I rewrote the way it will query for not built packages. Previously
nix-build-uncached was limited to attribute sets of packages. With this release it can support
arbitrary packages that are build-able by nix-build.

4 Likes

Does nix-build only list top level drv that need to be build ?

How do you make sure that any transitive packages that are needed to be built are fetched though.

looking at the source it seems that the output is only printing top level packages but I don’t see that enforced anywhere by Nix itself in the output.

It uses the output of nix-build --dry-run. So it builds all derivation listed there. But it would work to just specify the top level derivations because nix will automatically build also the dependencies first.

nix-build by default will download already built packages

I am confused by this, as we are using nix in GitHub actions, and caching works.

Could you explain more in detail when nix-build is not behaving as you’d want?

Imagine you build 10 nixos machines but only 1 machine has an actual change. In this case you have to download the 10 nixos closures into your github action VM from the cache while only 1 machine is effectively rebuild.