From 1125eb6d1bf4d07213087c0ade68c15f471d3654 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Tue, 29 Dec 2020 12:10:00 -0800 Subject: [PATCH] nix: Suppress GC warnings The derivations and built closures are intentionally not added as GC roots. Maybe we can provide an option for those who want GC roots to be created. --- src/nix/host.rs | 3 ++- src/nix/mod.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nix/host.rs b/src/nix/host.rs index fb9cfde..f86d0d7 100644 --- a/src/nix/host.rs +++ b/src/nix/host.rs @@ -76,6 +76,7 @@ impl Host for Local { } async fn realize_remote(&mut self, derivation: &StorePath) -> NixResult> { Command::new("nix-store") + .arg("--no-gc-warning") .arg("--realise") .arg(derivation.as_path()) .capture_output() @@ -125,7 +126,7 @@ impl Host for SSH { } async fn realize_remote(&mut self, derivation: &StorePath) -> NixResult> { // FIXME - self.ssh(&["nix-store", "--realise", derivation.as_path().to_str().unwrap()]) + self.ssh(&["nix-store", "--no-gc-warning", "--realise", derivation.as_path().to_str().unwrap()]) .capture_output() .await .map(|paths| { diff --git a/src/nix/mod.rs b/src/nix/mod.rs index 927ebea..e6df34a 100644 --- a/src/nix/mod.rs +++ b/src/nix/mod.rs @@ -235,6 +235,7 @@ impl<'hive> NixInstantiate<'hive> { let mut command = Command::new("nix-instantiate"); command + .arg("--no-gc-warning") .arg("-E") .arg(format!( "with builtins; let eval = import {}; hive = eval {{ rawHive = import {}; }}; in {}",