* Register builds as GC roots so they don't get deleted.
[?]
Feb 6, 2009, 9:01 PM
2T42QGZDK23C5V4ZHO4R7EBJESIQ62GKWDBWVX7OBEE3YVBUNUFACDependencies
- [2]
IN272KZW* Automatically keep all builds in the latest successful release in - [3]
4X6NS66Q* Keep the most recent builds for each job. - [4]
WZ3AEJ67* hydra_update_gc_roots.pl registers build outputs that should be kept - [*]
2GK5DOU7* Downloading closures. - [*]
AFTXA575* $HYDRA_DATA environment variable. - [*]
7YBYT2LQ - [*]
BD3GRK4B* Get rid of "positive failures" and separate log phases. - [*]
N22GPKYT* Put info about logs / build products in the DB.
Change contents
- edit in src/Hydra/lib/Hydra/Helper/Nix.pm at line 5
use File::Path; - edit in src/Hydra/lib/Hydra/Helper/Nix.pm at line 11
registerRoot getGCRootsDir - edit in src/Hydra/lib/Hydra/Helper/Nix.pm at line 44
}sub getGCRootsDir {die unless defined $ENV{LOGNAME};return "/nix/var/nix/gcroots/per-user/$ENV{LOGNAME}/hydra-roots";}sub registerRoot {my ($path) = @_;my $gcRootsDir = getGCRootsDir;mkpath($gcRootsDir) if !-e $gcRootsDir;my $link = "$gcRootsDir/" . basename $path;if (!-l $link) {symlink($path, $link)or die "cannot create symlink in $gcRootsDir to $path";} - edit in src/Hydra/script/hydra_build.pl at line 27
registerRoot $outPath; - edit in src/Hydra/script/hydra_scheduler.pl at line 251
# !!! this should really by done by nix-instantiate to prevent a GC race.registerRoot $drvPath; - edit in src/Hydra/script/hydra_update_gc_roots.pl at line 11
die unless defined $ENV{LOGNAME};my $gcRootsDir = "/nix/var/nix/gcroots/per-user/$ENV{LOGNAME}/hydra-roots"; - replacement in src/Hydra/script/hydra_update_gc_roots.pl at line 17[3.795]→[3.25:47](∅→∅),[3.47]→[3.816:919](∅→∅),[3.816]→[3.816:919](∅→∅),[3.919]→[3.48:69](∅→∅),[3.69]→[3.940:970](∅→∅),[3.940]→[3.940:970](∅→∅),[3.970]→[3.70:138](∅→∅),[3.138]→[3.1040:1047](∅→∅),[3.1040]→[3.1040:1047](∅→∅)
#print "$path\n";mkpath($gcRootsDir) if !-e $gcRootsDir;my $link = "$gcRootsDir/" . basename $path;if (!-l $link) {symlink($path, $link)or die "cannot create symlink in $gcRootsDir to $path";}Hydra::Helper::Nix::registerRoot($path); - replacement in src/Hydra/script/hydra_update_gc_roots.pl at line 87
# For scheduled builds, we register the derivation as a GC root.# For scheduled builds, we register the derivation and the output as a GC root. - edit in src/Hydra/script/hydra_update_gc_roots.pl at line 91
print "keeping scheduled build ", $build->id, " (",strftime("%Y-%m-%d %H:%M:%S", localtime($build->timestamp)), ")\n"; - edit in src/Hydra/script/hydra_update_gc_roots.pl at line 94
registerRoot $build->outpath; - edit in src/Hydra/script/hydra_update_gc_roots.pl at line 102
print "*** removing unneeded GC roots\n";my $gcRootsDir = getGCRootsDir;