From a75a12e819b845e4941844e4dfeb41bade635be8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 26 Nov 2010 14:34:58 +0000 Subject: [PATCH] * Include the system type in manifests as a hint for the binary patch generator. --- src/lib/Hydra/Helper/CatalystUtils.pm | 8 +++++++- src/lib/Hydra/View/NixManifest.pm | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Helper/CatalystUtils.pm b/src/lib/Hydra/Helper/CatalystUtils.pm index d36dd706..165a6413 100644 --- a/src/lib/Hydra/Helper/CatalystUtils.pm +++ b/src/lib/Hydra/Helper/CatalystUtils.pm @@ -123,10 +123,16 @@ sub getChannelData { # `--include-outputs' flag passed to `nix-store'. push @storePaths, $build->drvpath; } else { - push @storePaths, $build->outpath; + push @storePaths, $build->outpath; } my $pkgName = $build->nixname . "-" . $build->system . "-" . $build->id; $c->stash->{nixPkgs}->{"${pkgName}.nixpkg"} = {build => $build, name => $pkgName}; + # Put the system type in the manifest (for top-level paths) as + # a hint to the binary patch generator. (It shouldn't try to + # generate patches between builds for different systems.) It + # would be nice if Nix stored this info for every path but it + # doesn't. + $c->stash->{systemForPath}->{$build->outpath} = $build->system; }; $c->stash->{storePaths} = [@storePaths]; diff --git a/src/lib/Hydra/View/NixManifest.pm b/src/lib/Hydra/View/NixManifest.pm index 8a672084..94301119 100644 --- a/src/lib/Hydra/View/NixManifest.pm +++ b/src/lib/Hydra/View/NixManifest.pm @@ -33,6 +33,8 @@ sub process { my $url = $c->stash->{narBase} . "/" . $escaped; + my $system = $c->stash->{systemForPath}->{$path}; + $manifest .= "{\n" . " StorePath: $path\n" . @@ -41,6 +43,7 @@ sub process { " NarURL: $url\n" . " NarHash: $hash\n" . ($narSize != 0 ? " NarSize: $narSize\n" : "") . + (defined $system ? " System: $system\n" : "") . "}\n"; }