Skip to content

support building only drvs that lack substitutes (aka nix-build-uncached) #3946

@colemickens

Description

@colemickens

Is your feature request related to a problem? Please describe.
Not necessarily, since nix-build-uncached exists, but it seems like a nice-to-have in nix itself. Also, I think the implementation in nix itself would likely be much more simple than nix-build-uncached itself, just due to how it works.

Describe the solution you'd like
nix build --lacking-substitutes .#packages would build only the packages which can not be substituted from a known store or trusted binary cache.

Also, a more-eloquent flag name would work, but I can't think of any :).

Describe alternatives you've considered
Just using nix-build-uncached.

Additional context
This makes using Nix in CI scenarios a bit easier. For example, nixpkgs-wayland cuts down on wasted resources significantly by using nix-build-uncached. Otherwise the builder will download hundreds of MBs of store paths just to fulfill the build, even though in reality we only want to build binary artifacts that aren't already in our CI's binary cache.

Alternatively

It seems like nix-build-uncached has to resolve unsubstitutable-derivations by parsing the output of nix-build supposedly because nix build's dry-run doesn't work; maybe that could be fixed.

cc: @Mic92

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions