allow safely building a specific file's attrs

This commit is contained in:
Graham Christensen 2017-11-24 12:39:30 -05:00
parent 75c3a6ddb8
commit 1323890e07
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
2 changed files with 6 additions and 3 deletions

View file

@ -27,8 +27,9 @@ impl Nix {
};
}
pub fn safely_build_attrs(&self, nixpkgs: &Path, attrs: Vec<String>) -> Result<File,File> {
let mut attrargs: Vec<String> = Vec::with_capacity(2 + (attrs.len() * 2));
pub fn safely_build_attrs(&self, nixpkgs: &Path, file: &str, attrs: Vec<String>) -> Result<File,File> {
let mut attrargs: Vec<String> = 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 {

View file

@ -80,7 +80,9 @@ impl worker::SimpleWorker for BuildWorker {
let success: bool;
let reader: BufReader<File>;
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);