Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

copy-tarballs.pl: Revive extracting all tarballs from release.nix

+47 -9
+18
maintainers/scripts/all-tarballs.nix
··· 1 + /* Helper expression for copy-tarballs. This returns (nearly) all 2 + tarballs used the free packages in Nixpkgs. 3 + 4 + Typical usage: 5 + 6 + $ copy-tarballs.pl --expr 'import <nixpkgs/maintainers/scripts/all-tarballs.nix>' 7 + */ 8 + 9 + removeAttrs (import ../../pkgs/top-level/release.nix 10 + { # Don't apply ‘hydraJob’ to jobs, because then we can't get to the 11 + # dependency graph. 12 + scrubJobs = false; 13 + # No need to evaluate on i686. 14 + supportedSystems = [ "x86_64-linux" ]; 15 + }) 16 + [ # Remove jobs whose evaluation depends on a writable Nix store. 17 + "tarball" "unstable" 18 + ]
+6 -1
maintainers/scripts/copy-tarballs.pl
··· 93 93 94 94 # Evaluate find-tarballs.nix. 95 95 my $expr = $ARGV[0] // die "$0: --expr requires a Nix expression\n"; 96 - my $pid = open(JSON, "-|", "nix-instantiate", "--eval-only", "--json", "--strict", 96 + my $pid = open(JSON, "-|", "nix-instantiate", "--eval", "--json", "--strict", 97 97 "<nixpkgs/maintainers/scripts/find-tarballs.nix>", 98 98 "--arg", "expr", $expr); 99 99 my $stdout = <JSON>; ··· 112 112 my $url = $fetch->{url}; 113 113 my $algo = $fetch->{type}; 114 114 my $hash = $fetch->{hash}; 115 + 116 + if (defined $ENV{DEBUG}) { 117 + print "$url $algo $hash\n"; 118 + next; 119 + } 115 120 116 121 if ($url !~ /^http:/ && $url !~ /^https:/ && $url !~ /^ftp:/ && $url !~ /^mirror:/) { 117 122 print STDERR "skipping $url (unsupported scheme)\n";
+2 -3
maintainers/scripts/find-tarballs.nix
··· 1 - # This expression returns a list of all fetchurl calls used by all 2 - # packages reachable from release.nix. 1 + # This expression returns a list of all fetchurl calls used by ‘expr’. 3 2 4 3 with import ../.. { }; 5 4 with lib; 6 5 7 - { expr ? removeAttrs (import ../../pkgs/top-level/release.nix { }) [ "tarball" "unstable" ] }: 6 + { expr }: 8 7 9 8 let 10 9
+10 -2
pkgs/top-level/make-tarball.nix
··· 14 14 version = builtins.readFile ../../.version; 15 15 versionSuffix = "pre${toString nixpkgs.revCount}.${nixpkgs.shortRev}"; 16 16 17 - buildInputs = [ nix ]; 17 + buildInputs = [ nix jq ]; 18 18 19 19 configurePhase = '' 20 20 eval "$preConfigure" ··· 83 83 stopNest 84 84 85 85 header "checking find-tarballs.nix" 86 - nix-instantiate --eval --strict --show-trace ./maintainers/scripts/find-tarballs.nix > /dev/null 86 + nix-instantiate --eval --strict --show-trace --json \ 87 + ./maintainers/scripts/find-tarballs.nix \ 88 + --arg expr 'import ./maintainers/scripts/all-tarballs.nix' > $TMPDIR/tarballs.json 89 + nrUrls=$(jq -r '.[].url' < $TMPDIR/tarballs.json | wc -l) 90 + echo "found $nrUrls URLs" 91 + if [ "$nrUrls" -lt 10000 ]; then 92 + echo "suspiciously low number of URLs" 93 + exit 1 94 + fi 87 95 stopNest 88 96 ''; 89 97
+9 -2
pkgs/top-level/release-lib.nix
··· 1 - { supportedSystems, packageSet ? (import ./all-packages.nix), allowTexliveBuilds ? false }: 1 + { supportedSystems 2 + , packageSet ? (import ./all-packages.nix) 3 + , allowTexliveBuilds ? false 4 + , scrubJobs ? true 5 + }: 2 6 3 7 with import ../../lib; 4 8 ··· 12 16 }); 13 17 14 18 pkgs = pkgsFor "x86_64-linux"; 19 + 20 + 21 + hydraJob' = if scrubJobs then hydraJob else id; 15 22 16 23 17 24 /* !!! Hack: poor man's memoisation function. Necessary to prevent ··· 48 55 a derivation for each supported platform, i.e. ‘{ x86_64-linux = 49 56 f pkgs_x86_64_linux; i686-linux = f pkgs_i686_linux; ... }’. */ 50 57 testOn = systems: f: genAttrs 51 - (filter (x: elem x supportedSystems) systems) (system: hydraJob (f (pkgsFor system))); 58 + (filter (x: elem x supportedSystems) systems) (system: hydraJob' (f (pkgsFor system))); 52 59 53 60 54 61 /* Similar to the testOn function, but with an additional
+2 -1
pkgs/top-level/release.nix
··· 13 13 , officialRelease ? false 14 14 , # The platforms for which we build Nixpkgs. 15 15 supportedSystems ? [ "x86_64-linux" "i686-linux" "x86_64-darwin" ] 16 + , scrubJobs ? true 16 17 }: 17 18 18 - with import ./release-lib.nix { inherit supportedSystems; }; 19 + with import ./release-lib.nix { inherit supportedSystems scrubJobs; }; 19 20 20 21 let 21 22