Skip to content

Allow using substitutes when building remotely #937

Closed

Description

@k0001

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 am happy to try and implement this.

Activity

  1. Ericson2314 commented on Jun 24, 2016

    @Ericson2314
    Member

    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.

  2. k0001 commented on Jun 25, 2016

    @k0001
    ContributorAuthor

    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.

  3. vcunat commented on Jun 26, 2016

    @vcunat
    Member

    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...

  4. k0001 commented on Jul 13, 2016

    @k0001
    ContributorAuthor

    Bump.

  5. added this to the perl-to-c++ milestone on Jul 21, 2016
  6. domenkozar commented on Jul 21, 2016

    @domenkozar
    Member

    @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).

  7. added
    feature
    on Jul 21, 2016
  8. shlevy commented on Jul 21, 2016

    @shlevy
    Member

    @k0001 we just want NIX_REMOTE_BUILD_SUBSTUTITUES=1 to mean use substitutes? I can add that.

  9. shlevy commented on Jul 21, 2016

    @shlevy
    Member

    incorporated into #981

  10. k0001 commented on Jul 21, 2016

    @k0001
    ContributorAuthor

    @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!

  11. added a commit that references this issue on Jan 9, 2018
    b0328c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions