Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/ofborg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2b03d05a0f97
Choose a base ref
...
head repository: NixOS/ofborg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b21c87bdd123
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Jun 30, 2018

  1. massrebuilder: return the outpath instead of .drv

    Currently some stdenv changes might get laballed as rebuilds even if the
    drv changes don't have an effect on the output path (eg: meta attribute
    changes).
    zimbatm committed Jun 30, 2018

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Copy the full SHA
    88899d8 View commit details
  2. Release v0.1.6

    zimbatm committed Jun 30, 2018

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Copy the full SHA
    15a50f0 View commit details
  3. Merge pull request #188 from zimbatm/outpath-instead-of-drv

    massrebuilder: return the outpath instead of .drv
    grahamc authored Jun 30, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    eadwu Edmund Wu
    Copy the full SHA
    b21c87b View commit details
Showing with 7 additions and 36 deletions.
  1. +1 −1 ofborg/Cargo.toml
  2. +6 −35 ofborg/src/tasks/massrebuilder.rs
2 changes: 1 addition & 1 deletion ofborg/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ofborg"
version = "0.1.5"
version = "0.1.6"
authors = ["Graham Christensen <graham@grahamc.com>"]
include = ["Cargo.toml", "Cargo.lock", "src", "test-srcs", "build.rs"]
build = "build.rs"
41 changes: 6 additions & 35 deletions ofborg/src/tasks/massrebuilder.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// This is what evaluates every pull-requests
extern crate amqp;
extern crate env_logger;
extern crate uuid;
@@ -6,8 +7,6 @@ use uuid::Uuid;
use std::collections::HashMap;
use std::fs::File;
use std::io::Read;
use std::io::BufRead;
use std::io::BufReader;
use std::path::Path;
use std::path::PathBuf;
use ofborg::checkout;
@@ -643,11 +642,14 @@ impl Stdenvs {
}
}

/// This is used to find out what the output path of the stdenv for the
/// given system.
fn evalstdenv(&self, system: &str) -> Option<String> {
let result = self.nix.with_system(system.to_owned()).safely(
nix::Operation::Instantiate,
nix::Operation::QueryPackagesOutputs,
&self.co,
vec![
String::from("-f"),
String::from("."),
String::from("-A"),
String::from("stdenv"),
@@ -658,7 +660,7 @@ impl Stdenvs {
println!("{:?}", result);

return match result {
Ok(mut out) => file_to_drv(&mut out),
Ok(mut out) => Some(file_to_str(&mut out)),
Err(mut out) => {
println!("{:?}", file_to_str(&mut out));
None
@@ -725,37 +727,6 @@ pub fn update_labels(issue: &hubcaps::issues::IssueRef, add: Vec<String>, remove
}
}

fn file_to_drv(f: &mut File) -> Option<String> {
let r = BufReader::new(f);
let matches: Vec<String>;
matches = r.lines()
.filter_map(|x| match x {
Ok(line) => {
if !line.starts_with("/nix/store/") {
debug!("Skipping line, not /nix/store: {}", line);
return None;
}

if !line.ends_with(".drv") {
debug!("Skipping line, not .drv: {}", line);
return None;
}

return Some(line);
}
Err(_) => None,
})
.collect();

if matches.len() == 1 {
return Some(matches.first().unwrap().clone());
} else {
info!("Got wrong number of matches: {}", matches.len());
info!("Matches: {:?}", matches);
return None;
}
}

fn file_to_str(f: &mut File) -> String {
let mut buffer = Vec::new();
f.read_to_end(&mut buffer).expect("Reading eval output");