* Don't access /nix/var/nix/db directly but use the Nix Perl bindings.
[?]
Mar 4, 2010, 1:25 PM
UC3YQDZF25LANTONKN3SM4NBFKKARRTH7KKWGGSGYQR7U3UBAD6QCDependencies
- [2]
DV33AJ23 - [3]
2GK5DOU7* Downloading closures. - [4]
A63IHCMX* Register GC roots properly. - [5]
PPJN6SDP* paging for releases page - [6]
BDSD2JLV* Speed up manifest generation. - [7]
XBU2ODSP* More renaming. - [8]
WZ3AEJ67* hydra_update_gc_roots.pl registers build outputs that should be kept - [9]
IN272KZW* Automatically keep all builds in the latest successful release in - [10]
AFTXA575* $HYDRA_DATA environment variable.
Change contents
- edit in src/lib/Hydra/Helper/Nix.pm at line 7
use Nix; - replacement in src/lib/Hydra/Helper/Nix.pm at line 21
#$SIG{CHLD} = 'DEFAULT'; # !!! work around system() failing if SIGCHLD is ignored#return system("nix-store --check-validity $path 2> /dev/null") == 0;# This is faster than calling nix-store, but it breaks abstraction...return -e ("/nix/var/nix/db/info/" . basename $path);return Nix::isValidPath($path); - edit in src/lib/Hydra/Helper/Nix.pm at line 27
# !!! like above, this breaks abstraction. What we really need is# Perl bindings for libstore :-) - replacement in src/lib/Hydra/Helper/Nix.pm at line 28
open FH, "</nix/var/nix/db/info/" . basename $pathor die "cannot open info file for $path";my $hash = Nix::queryPathHash($path);my $deriver = Nix::queryDeriver($path);my @refs = Nix::queryReferences($path); - edit in src/lib/Hydra/Helper/Nix.pm at line 32
my $hash;my $deriver;my @refs = ();while (<FH>) {if (/^Hash: (\S+)$/) {$hash = $1;}elsif (/^Deriver: (\S+)$/) {$deriver = $1;}elsif (/^References: (.*)$/) {@refs = split / /, $1;}}close FH;die "path $path does not have a hash" unless defined $hash;