From 1323890e073d416931ad903b7ffd4ba7e3603c3b Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 24 Nov 2017 12:39:30 -0500 Subject: [PATCH] allow safely building a specific file's attrs --- ofborg/src/nix.rs | 5 +++-- ofborg/src/tasks/build.rs | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ofborg/src/nix.rs b/ofborg/src/nix.rs index dff5818..d8be6c8 100644 --- a/ofborg/src/nix.rs +++ b/ofborg/src/nix.rs @@ -27,8 +27,9 @@ impl Nix { }; } - pub fn safely_build_attrs(&self, nixpkgs: &Path, attrs: Vec) -> Result { - let mut attrargs: Vec = Vec::with_capacity(2 + (attrs.len() * 2)); + pub fn safely_build_attrs(&self, nixpkgs: &Path, file: &str, attrs: Vec) -> Result { + let mut attrargs: Vec = Vec::with_capacity(3 + (attrs.len() * 2)); + attrargs.push(file.to_owned()); attrargs.push(String::from("--no-out-link")); attrargs.push(String::from("--keep-going")); for attr in attrs { diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index ee629fe..954ce4f 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -80,7 +80,9 @@ impl worker::SimpleWorker for BuildWorker { let success: bool; let reader: BufReader; - match self.nix.safely_build_attrs(refpath.as_ref(), job.attrs.clone()) { + match self.nix.safely_build_attrs(refpath.as_ref(), + "./default.nix", + job.attrs.clone()) { Ok(r) => { success = true; reader = BufReader::new(r);