* Get dependencies from the database.

[?]
Nov 5, 2008, 4:52 AM
5QJP6JHSLKEQ5WBHAU62HJXU4PUGVRDVAIS3SHHFHTTVPEVCRYCAC

Dependencies

  • [2] X27GNHDV * Basic job info in the database.
  • [3] WYN733ST * Store build duration, handle cached builds.
  • [4] N22GPKYT * Put info about logs / build products in the DB.

Change contents

  • edit in src/scheduler.pl at line 12
    [3.1426]
    [2.5762]
    sub isValidPath {
    my $path = shift;
    return system("nix-store --check-validity $path 2> /dev/null") == 0;
    }
  • replacement in src/scheduler.pl at line 31
    [3.2408][3.2408:2483]()
    if (system("nix-store --check-validity $outPath 2> /dev/null") != 0) {
    [3.2408]
    [3.2483]
    if (!isValidPath($outPath)) {
  • replacement in src/scheduler.pl at line 159
    [2.8609][2.8609:8797]()
    die "missing input `$argName'" if !defined $inputInfo->{$argName};
    $extraArgs .= " --arg $argName '{path = " . $inputInfo->{$argName}->{storePath} . ";}'";
    [2.8609]
    [2.8797]
    my $storePath;
    if (defined $inputInfo->{$argName}) {
    # The argument name matches an input.
    $storePath = $inputInfo->{$argName}->{storePath};
    } else {
    (my $prevBuild) = $db->resultset('Builds')->search(
    {project => $project->name, jobset => $jobset->name, attrname => $argName},
    {order_by => "timestamp DESC", rows => 1});
    if (defined $prevBuild) {
    # The argument name matches a previously built
    # job in this jobset. Pick the most recent
    # build. !!! refine the selection criteria:
    # e.g., most recent successful build.
    if (!isValidPath($prevBuild->outpath)) {
    die "input path " . $prevBuild->outpath . " has been garbage-collected";
    }
    $storePath = $prevBuild->outpath;
    } else {
    # !!! reschedule?
    die "missing input `$argName'";
    }
    }
    $extraArgs .= " --arg $argName '{path = " . $storePath . ";}'";
  • edit in src/scheduler.pl at line 186
    [2.8866]
    [2.8866]
    print "$extraArgs\n";