From f809d3b21ca2d354917830c5cea7caeaddea53ec Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Sat, 1 Jan 2022 16:41:35 -0800 Subject: [PATCH] nix/host: Always copy outputs to remote along with derivations when realizing This prevents useless rebuilds when trying to realize a derivation on a remote host. This code path isn't actually used by Colmena at the moment. --- src/nix/host/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nix/host/mod.rs b/src/nix/host/mod.rs index 1db8647..a0718e8 100644 --- a/src/nix/host/mod.rs +++ b/src/nix/host/mod.rs @@ -79,11 +79,12 @@ pub trait Host: Send + Sync + std::fmt::Debug { /// Realizes the specified local derivation on the host then retrieves the outputs. async fn realize(&mut self, derivation: &StorePath) -> NixResult> { - let options = CopyOptions::default(); + let options = CopyOptions::default() + .include_outputs(true); - self.copy_closure(derivation, CopyDirection::ToRemote, options.include_outputs(false)).await?; + self.copy_closure(derivation, CopyDirection::ToRemote, options).await?; let paths = self.realize_remote(derivation).await?; - self.copy_closure(derivation, CopyDirection::FromRemote, options.include_outputs(true)).await?; + self.copy_closure(derivation, CopyDirection::FromRemote, options).await?; Ok(paths) }