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.
This commit is contained in:
Zhaofeng Li 2020-12-29 12:10:00 -08:00
parent 4c1ce95c15
commit 1125eb6d1b
2 changed files with 3 additions and 1 deletions

View file

@ -76,6 +76,7 @@ impl Host for Local {
}
async fn realize_remote(&mut self, derivation: &StorePath) -> NixResult<Vec<StorePath>> {
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<Vec<StorePath>> {
// 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| {

View file

@ -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 {}",