copy-tarballs.pl: Revive extracting all tarballs from release.nix
This commit is contained in:
parent
493f633002
commit
7cd3d502bb
18
maintainers/scripts/all-tarballs.nix
Normal file
18
maintainers/scripts/all-tarballs.nix
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/* Helper expression for copy-tarballs. This returns (nearly) all
|
||||||
|
tarballs used the free packages in Nixpkgs.
|
||||||
|
|
||||||
|
Typical usage:
|
||||||
|
|
||||||
|
$ copy-tarballs.pl --expr 'import <nixpkgs/maintainers/scripts/all-tarballs.nix>'
|
||||||
|
*/
|
||||||
|
|
||||||
|
removeAttrs (import ../../pkgs/top-level/release.nix
|
||||||
|
{ # Don't apply ‘hydraJob’ to jobs, because then we can't get to the
|
||||||
|
# dependency graph.
|
||||||
|
scrubJobs = false;
|
||||||
|
# No need to evaluate on i686.
|
||||||
|
supportedSystems = [ "x86_64-linux" ];
|
||||||
|
})
|
||||||
|
[ # Remove jobs whose evaluation depends on a writable Nix store.
|
||||||
|
"tarball" "unstable"
|
||||||
|
]
|
@ -93,7 +93,7 @@ elsif ($op eq "--expr") {
|
|||||||
|
|
||||||
# Evaluate find-tarballs.nix.
|
# Evaluate find-tarballs.nix.
|
||||||
my $expr = $ARGV[0] // die "$0: --expr requires a Nix expression\n";
|
my $expr = $ARGV[0] // die "$0: --expr requires a Nix expression\n";
|
||||||
my $pid = open(JSON, "-|", "nix-instantiate", "--eval-only", "--json", "--strict",
|
my $pid = open(JSON, "-|", "nix-instantiate", "--eval", "--json", "--strict",
|
||||||
"<nixpkgs/maintainers/scripts/find-tarballs.nix>",
|
"<nixpkgs/maintainers/scripts/find-tarballs.nix>",
|
||||||
"--arg", "expr", $expr);
|
"--arg", "expr", $expr);
|
||||||
my $stdout = <JSON>;
|
my $stdout = <JSON>;
|
||||||
@ -113,6 +113,11 @@ elsif ($op eq "--expr") {
|
|||||||
my $algo = $fetch->{type};
|
my $algo = $fetch->{type};
|
||||||
my $hash = $fetch->{hash};
|
my $hash = $fetch->{hash};
|
||||||
|
|
||||||
|
if (defined $ENV{DEBUG}) {
|
||||||
|
print "$url $algo $hash\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
if ($url !~ /^http:/ && $url !~ /^https:/ && $url !~ /^ftp:/ && $url !~ /^mirror:/) {
|
if ($url !~ /^http:/ && $url !~ /^https:/ && $url !~ /^ftp:/ && $url !~ /^mirror:/) {
|
||||||
print STDERR "skipping $url (unsupported scheme)\n";
|
print STDERR "skipping $url (unsupported scheme)\n";
|
||||||
next;
|
next;
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
# This expression returns a list of all fetchurl calls used by all
|
# This expression returns a list of all fetchurl calls used by ‘expr’.
|
||||||
# packages reachable from release.nix.
|
|
||||||
|
|
||||||
with import ../.. { };
|
with import ../.. { };
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
{ expr ? removeAttrs (import ../../pkgs/top-level/release.nix { }) [ "tarball" "unstable" ] }:
|
{ expr }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ releaseTools.sourceTarball rec {
|
|||||||
version = builtins.readFile ../../.version;
|
version = builtins.readFile ../../.version;
|
||||||
versionSuffix = "pre${toString nixpkgs.revCount}.${nixpkgs.shortRev}";
|
versionSuffix = "pre${toString nixpkgs.revCount}.${nixpkgs.shortRev}";
|
||||||
|
|
||||||
buildInputs = [ nix ];
|
buildInputs = [ nix jq ];
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
eval "$preConfigure"
|
eval "$preConfigure"
|
||||||
@ -83,7 +83,15 @@ releaseTools.sourceTarball rec {
|
|||||||
stopNest
|
stopNest
|
||||||
|
|
||||||
header "checking find-tarballs.nix"
|
header "checking find-tarballs.nix"
|
||||||
nix-instantiate --eval --strict --show-trace ./maintainers/scripts/find-tarballs.nix > /dev/null
|
nix-instantiate --eval --strict --show-trace --json \
|
||||||
|
./maintainers/scripts/find-tarballs.nix \
|
||||||
|
--arg expr 'import ./maintainers/scripts/all-tarballs.nix' > $TMPDIR/tarballs.json
|
||||||
|
nrUrls=$(jq -r '.[].url' < $TMPDIR/tarballs.json | wc -l)
|
||||||
|
echo "found $nrUrls URLs"
|
||||||
|
if [ "$nrUrls" -lt 10000 ]; then
|
||||||
|
echo "suspiciously low number of URLs"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
stopNest
|
stopNest
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
{ supportedSystems, packageSet ? (import ./all-packages.nix), allowTexliveBuilds ? false }:
|
{ supportedSystems
|
||||||
|
, packageSet ? (import ./all-packages.nix)
|
||||||
|
, allowTexliveBuilds ? false
|
||||||
|
, scrubJobs ? true
|
||||||
|
}:
|
||||||
|
|
||||||
with import ../../lib;
|
with import ../../lib;
|
||||||
|
|
||||||
@ -14,6 +18,9 @@ rec {
|
|||||||
pkgs = pkgsFor "x86_64-linux";
|
pkgs = pkgsFor "x86_64-linux";
|
||||||
|
|
||||||
|
|
||||||
|
hydraJob' = if scrubJobs then hydraJob else id;
|
||||||
|
|
||||||
|
|
||||||
/* !!! Hack: poor man's memoisation function. Necessary to prevent
|
/* !!! Hack: poor man's memoisation function. Necessary to prevent
|
||||||
Nixpkgs from being evaluated again and again for every
|
Nixpkgs from being evaluated again and again for every
|
||||||
job/platform pair. */
|
job/platform pair. */
|
||||||
@ -48,7 +55,7 @@ rec {
|
|||||||
a derivation for each supported platform, i.e. ‘{ x86_64-linux =
|
a derivation for each supported platform, i.e. ‘{ x86_64-linux =
|
||||||
f pkgs_x86_64_linux; i686-linux = f pkgs_i686_linux; ... }’. */
|
f pkgs_x86_64_linux; i686-linux = f pkgs_i686_linux; ... }’. */
|
||||||
testOn = systems: f: genAttrs
|
testOn = systems: f: genAttrs
|
||||||
(filter (x: elem x supportedSystems) systems) (system: hydraJob (f (pkgsFor system)));
|
(filter (x: elem x supportedSystems) systems) (system: hydraJob' (f (pkgsFor system)));
|
||||||
|
|
||||||
|
|
||||||
/* Similar to the testOn function, but with an additional
|
/* Similar to the testOn function, but with an additional
|
||||||
|
@ -13,9 +13,10 @@
|
|||||||
, officialRelease ? false
|
, officialRelease ? false
|
||||||
, # The platforms for which we build Nixpkgs.
|
, # The platforms for which we build Nixpkgs.
|
||||||
supportedSystems ? [ "x86_64-linux" "i686-linux" "x86_64-darwin" ]
|
supportedSystems ? [ "x86_64-linux" "i686-linux" "x86_64-darwin" ]
|
||||||
|
, scrubJobs ? true
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with import ./release-lib.nix { inherit supportedSystems; };
|
with import ./release-lib.nix { inherit supportedSystems scrubJobs; };
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user