You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow using substitutes when building remotely #937
Currently, when building a package remotely with build-remote.pl, if the remote host is missing some dependencies, these will be sent over the network from the local host. However, when the connection between the local and the remote hosts is slow, it would be preferable to download as many of those dependencies as possible from nixos.org using the substitutes approach.
To achieve this, I think it should suffice to change build-remote.pl so that it passes, optionally, the --use-substitutes flag to nix-copy-closure (well, Nix::CopyClosure::copyToOpen actually). Please correct me if I am wrong, as I am not familiar with the code base here.
I wonder what is the best way to enable/disable this feature so that the caller of nix-build can decide whether to use substitutes in the remote end or not.
I'm thinking more generally, when a node builds derivations on behalf of a client, it should use the binary caches of the client + client itself, and not necessarily trust the derivations unless it also happens to also trust's their closures.
I've implemented this and it seems to work just fine: k0001@f98af93 - Now I don't need to wait for hours until dependencies are uploaded to the remote build server!
I've made the change on top of the 1.11 maintenance branch, as that is what I am using locally. I can send a pull request on top of master if you agree that this is the way to go.
@k0001 sorry for closing your PR. I know it's really demotivating to close perfectly valid PR, but we're rewriting perl stuff to C++ so you'll have to implement this again (or ask @shlevy to help you out).
Activity
Ericson2314 commentedon Jun 24, 2016
I'm thinking more generally, when a node builds derivations on behalf of a client, it should use the binary caches of the client + client itself, and not necessarily trust the derivations unless it also happens to also trust's their closures.
We might need intensional store for that though.
k0001 commentedon Jun 25, 2016
I've implemented this and it seems to work just fine: k0001@f98af93 - Now I don't need to wait for hours until dependencies are uploaded to the remote build server!
I've made the change on top of the 1.11 maintenance branch, as that is what I am using locally. I can send a pull request on top of
masterif you agree that this is the way to go.vcunat commentedon Jun 26, 2016
It seems nice to me to add that option. Note: that perl script is being migrated to C++ #341, but your change is so simple anyway...
build-remote.pl: Add NIX_REMOTE_USE_SUBSTITUTES support
k0001 commentedon Jul 13, 2016
Bump.
domenkozar commentedon Jul 21, 2016
@k0001 sorry for closing your PR. I know it's really demotivating to close perfectly valid PR, but we're rewriting perl stuff to C++ so you'll have to implement this again (or ask @shlevy to help you out).
shlevy commentedon Jul 21, 2016
@k0001 we just want
NIX_REMOTE_BUILD_SUBSTUTITUES=1to mean use substitutes? I can add that.shlevy commentedon Jul 21, 2016
incorporated into #981
k0001 commentedon Jul 21, 2016
@domenkozar no worries! I understand perfectly. It is no use making this change in Perl if it won't ever be shipped.
@shlevy thank you for going ahead with this change yourself!
nix.conf: builders-use-substitutes