Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
builder/parse_evaluation_line: non-standard store locations
Browse files Browse the repository at this point in the history
If one uses a non-standard nix store location, the attributes could
not be parsed, which lead to CI failure for the nix-build CI.
  • Loading branch information
Profpatsch committed Aug 9, 2019
1 parent 6601513 commit a54af4a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ fn parse_evaluation_line(line: &OsStr) -> LogDatum {
Regex::new("^copied source '(?P<source>.*)' -> '(?:.*)'$").expect("invalid regex!");
static ref LORRI_READ: Regex =
Regex::new("^trace: lorri read: '(?P<source>.*)'$").expect("invalid regex!");
// we put a (/.*) before the store path to allow for non-standard store locations
static ref LORRI_ATTR_DRV: Regex =
Regex::new("^trace: lorri attribute: '(?P<attribute>.*)' -> '(?P<drv>/nix/store/.*)'$")
Regex::new("^trace: lorri attribute: '(?P<attribute>.*)' -> '(?P<drv>(/.*)?/nix/store/.*)'$")
.expect("invalid regex!");
}

Expand Down Expand Up @@ -373,6 +374,13 @@ mod tests {
LogDatum::ShellGcRootDrv(PathBuf::from("/nix/store/q3ngidzvincycjjvlilf1z6vj1w4wnas-lorri-keep-env-hack-foo.drv"))
);

// This tests whether the attribute parsing still works
// for non-standard store locations with prefixes (e.g. CI)
assert_eq!(
parse_evaluation_line(&OsString::from("trace: lorri attribute: 'shell_gc_root' -> '/build/local-store/nix/store/q3ngidzvincycjjvlilf1z6vj1w4wnas-lorri-keep-env-hack-foo.drv'")),
LogDatum::ShellGcRootDrv(PathBuf::from("/build/local-store/nix/store/q3ngidzvincycjjvlilf1z6vj1w4wnas-lorri-keep-env-hack-foo.drv"))
);

assert_eq!(
parse_evaluation_line(&OsString::from(
"downloading 'https://static.rust-lang.org/dist/channel-rust-stable.toml'..."
Expand Down

0 comments on commit a54af4a

Please sign in to comment.