[Nix#2236] Treat remote builders as substituters? #141
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#141
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Upstream-Issue: NixOS/nix#2236
I can see some potential advantages to treating remote builders as substituters before trying to build any derivations — this would allow the build plan to be executed more efficiently in some cases, with less copying around of paths and potentially less overall building as well.
Consider:
b.drv
, a derivation which produces the output path/nix/store/b
c.drv
, a derivation which produces the output path/nix/store/c
a.drv
, which produces the output/nix/store/a
and depends on the outputs ofb.drv
andc.drv
./nix/store/a
has a reference to/nix/store/b
but none to/nix/store/c
.alice
, havingbob
andcharlotte
configured as remote builders, doesn't have any of the output paths available, nor can it build any of the drvs (incompatible system or something)bob
doesn't have any of the paths available, but can build themcharlotte
has all the paths built.Now running
nix build /nix/store/a.drv
onalice
can result in something like the following:alice
makesbob
buildb.drv
and copies the output path overalice
makescharlotte
buildc.drv
(no-op) and copies the output path overalice
copies/nix/store/c
tobob
and makesbob
builda.drv
, then copies the output path overEnd result being that all three derivation's output paths have been copied to all three systems, and
b.drv
anda.drv
have been unnecessarily rebuilt.If
alice
hasbob
andcharlotte
configured as substituters additionally,alice
will first query them for/nix/store/a
, and upon determining thatcharlotte
already has the path, will only copy/nix/store/a
and/nix/store/b
to itself, resulting in no unnecessary building and no superfluous space usage.Are there any drawbacks to universally treating builders as (absolutely trusted, i.e. no sigs required) substituters as well?