[?]
Nov 5, 2008, 1:58 AM
T7AHGVGMWWB3BDSY3SDB4KTSSQMKAJYEUL3QHVMM436LKH4LZSBQC

Dependencies

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

Change contents

  • replacement in src/scheduler.pl at line 52
    [2.6612][2.6612:6620]()
    });
    [2.6612]
    [2.6620]
    print " build ID = ", $build->id, "\n";
  • replacement in src/scheduler.pl at line 54
    [2.6621][2.6621:6635]()
    return 0;
    [2.6621]
    [2.6635]
    my $logPath = "/nix/var/log/nix/drvs/" . basename $drvPath;
    if (-e $logPath) {
    print " LOG $logPath\n";
    $db->resultset('Buildlogs')->create(
    { buildid => $build->id
    , logphase => "full"
    , path => $logPath
    , type => "raw"
    });
    }
  • replacement in src/scheduler.pl at line 65
    [2.6636][2.6636:6679]()
    my $dbh, my $description, my $jobName;
    [2.6636]
    [2.6679]
    if ($buildStatus == 0) {
  • replacement in src/scheduler.pl at line 67
    [2.6680][3.2422:2445](),[3.2422][3.2422:2445](),[3.2445][3.2686:3001](),[3.3001][3.2656:2763](),[3.2656][3.2656:2763](),[3.2763][3.3002:3285](),[3.3285][3.2763:2963](),[3.2763][3.2763:2963](),[3.3270][3.3270:3586]()
    $dbh->begin_work;
    $dbh->prepare("insert into builds(timestamp, jobName, description, drvPath, outPath, isCachedBuild, buildStatus, errorMsg, startTime, stopTime) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")
    ->execute(time(), $jobName, $description, $drvPath, $outPath, $isCachedBuild, $buildStatus, "", $startTime, $stopTime);
    my $buildId = $dbh->last_insert_id(undef, undef, undef, undef);
    print " db id = $buildId\n";
    my $logPath = "/nix/var/log/nix/drvs/" . basename $drvPath;
    if (-e $logPath) {
    print " LOG $logPath\n";
    $dbh->prepare("insert into buildLogs(buildId, logPhase, path, type) values(?, ?, ?, ?)")
    ->execute($buildId, "full", $logPath, "raw");
    }
    if ($buildStatus == 0) {
    $dbh->prepare("insert into buildProducts(buildId, type, subtype, path) values(?, ?, ?, ?)")
    ->execute($buildId, "nix-build", "", $outPath);
    if (-e "$outPath/log") {
    foreach my $logPath (glob "$outPath/log/*") {
    print " LOG $logPath\n";
    $dbh->prepare("insert into buildLogs(buildId, logPhase, path, type) values(?, ?, ?, ?)")
    ->execute($buildId, basename($logPath), $logPath, "raw");
    [2.6680]
    [3.3586]
    $db->resultset('Buildproducts')->create(
    { buildid => $build->id
    , type => "nix-build"
    , subtype => ""
    , path => $outPath
    });
    if (-e "$outPath/log") {
    foreach my $logPath (glob "$outPath/log/*") {
    print " LOG $logPath\n";
    $db->resultset('Buildlogs')->create(
    { buildid => $build->id
    , logphase => basename($logPath)
    , path => $logPath
    , type => "raw"
    });
    }
  • replacement in src/scheduler.pl at line 86
    [3.3610][3.3610:3616]()
    }
    [3.3610]
    [3.3616]
    });
  • edit in src/scheduler.pl at line 89
    [3.3617][3.3617:3635]()
    $dbh->commit;