Remove the tarball job

Source tarballs are not very useful anymore. People who want to build
from source can also just build from the Git repository. Once upon a
time, the source tarball also saved users from needing a few
dependencies (e.g. bison and flex) but those are dwarfed by the other
dependencies, so it's no longer worth it.

Note: the release script should be updated to copy the vendoredCrates
tarball.
This commit is contained in:
Eelco Dolstra 2020-03-13 14:05:49 +01:00
parent eab7d790a3
commit 7c39201bcb
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 45 additions and 65 deletions

View file

@ -34,7 +34,7 @@ rec {
"--with-sandbox-shell=${sh}/bin/busybox" "--with-sandbox-shell=${sh}/bin/busybox"
]; ];
tarballDeps = buildDeps =
[ bison [ bison
flex flex
libxml2 libxml2
@ -43,10 +43,8 @@ rec {
docbook_xsl_ns docbook_xsl_ns
autoconf-archive autoconf-archive
autoreconfHook autoreconfHook
];
buildDeps = curl
[ curl
bzip2 xz brotli zlib editline bzip2 xz brotli zlib editline
openssl pkgconfig sqlite openssl pkgconfig sqlite
libarchive libarchive

View file

@ -8,11 +8,14 @@ let
pkgs = import nixpkgs { system = builtins.currentSystem or "x86_64-linux"; }; pkgs = import nixpkgs { system = builtins.currentSystem or "x86_64-linux"; };
version =
builtins.readFile ./.version
+ (if officialRelease then "" else "pre${toString nix.revCount}_${nix.shortRev}");
jobs = rec { jobs = rec {
# Create a "vendor" directory that contains the crates listed in # Create a "vendor" directory that contains the crates listed in
# Cargo.lock, and include it in the Nix tarball. This allows Nix # Cargo.lock. This allows Nix to be built without network access.
# to be built without network access.
vendoredCrates = vendoredCrates =
let let
lockFile = builtins.fromTOML (builtins.readFile nix-rust/Cargo.lock); lockFile = builtins.fromTOML (builtins.readFile nix-rust/Cargo.lock);
@ -55,48 +58,6 @@ let
''; '';
tarball =
with pkgs;
with import ./release-common.nix { inherit pkgs; };
releaseTools.sourceTarball {
name = "nix-tarball";
version = builtins.readFile ./.version;
versionSuffix = if officialRelease then "" else "pre${toString nix.revCount}_${nix.shortRev}";
src = nix;
inherit officialRelease;
buildInputs = tarballDeps ++ buildDeps ++ propagatedDeps;
postUnpack = ''
(cd $sourceRoot && find . -type f) | cut -c3- > $sourceRoot/.dist-files
cat $sourceRoot/.dist-files
'';
preConfigure = ''
(cd perl ; autoreconf --install --force --verbose)
# TeX needs a writable font cache.
export VARTEXFONTS=$TMPDIR/texfonts
'';
distPhase =
''
cp -prd ${vendoredCrates}/vendor/ nix-rust/vendor/
runHook preDist
make dist
mkdir -p $out/tarballs
cp *.tar.* $out/tarballs
'';
preDist = ''
make install docdir=$out/share/doc/nix makefiles=doc/manual/local.mk
echo "doc manual $out/share/doc/nix/manual" >> $out/nix-support/hydra-build-products
'';
};
build = pkgs.lib.genAttrs systems (system: build = pkgs.lib.genAttrs systems (system:
let pkgs = import nixpkgs { inherit system; }; in let pkgs = import nixpkgs { inherit system; }; in
@ -105,20 +66,21 @@ let
with import ./release-common.nix { inherit pkgs; }; with import ./release-common.nix { inherit pkgs; };
releaseTools.nixBuild { stdenv.mkDerivation {
name = "nix"; name = "nix-${version}";
src = tarball;
outputs = [ "out" "dev" ]; src = nix;
outputs = [ "out" "dev" "doc" ];
buildInputs = buildDeps; buildInputs = buildDeps;
propagatedBuildInputs = propagatedDeps; propagatedBuildInputs = propagatedDeps;
preConfigure = preConfigure =
# Copy libboost_context so we don't get all of Boost in our closure.
# https://github.com/NixOS/nixpkgs/issues/45462
'' ''
# Copy libboost_context so we don't get all of Boost in our closure.
# https://github.com/NixOS/nixpkgs/issues/45462
mkdir -p $out/lib mkdir -p $out/lib
cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib
rm -f $out/lib/*.a rm -f $out/lib/*.a
@ -126,6 +88,10 @@ let
chmod u+w $out/lib/*.so.* chmod u+w $out/lib/*.so.*
patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.* patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.*
''} ''}
ln -sfn ${vendoredCrates}/vendor/ nix-rust/vendor
(cd perl; autoreconf --install --force --verbose)
''; '';
configureFlags = configureFlags ++ configureFlags = configureFlags ++
@ -137,10 +103,17 @@ let
installFlags = "sysconfdir=$(out)/etc"; installFlags = "sysconfdir=$(out)/etc";
doCheck = true;
doInstallCheck = true; doInstallCheck = true;
installCheckFlags = "sysconfdir=$(out)/etc"; installCheckFlags = "sysconfdir=$(out)/etc";
separateDebugInfo = true; separateDebugInfo = true;
preDist = ''
mkdir -p $doc/nix-support
echo "doc manual $doc/share/doc/nix/manual" >> $doc/nix-support/hydra-build-products
'';
}); });
@ -149,11 +122,21 @@ let
let pkgs = import nixpkgs { inherit system; }; in with pkgs; let pkgs = import nixpkgs { inherit system; }; in with pkgs;
releaseTools.nixBuild { releaseTools.nixBuild {
name = "nix-perl"; name = "nix-perl-${version}";
src = tarball;
src = nix;
buildInputs = buildInputs =
[ jobs.build.${system} curl bzip2 xz pkgconfig pkgs.perl boost ] [ autoconf-archive
autoreconfHook
jobs.build.${system}
curl
bzip2
xz
pkgconfig
pkgs.perl
boost
]
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium; ++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium;
configureFlags = '' configureFlags = ''
@ -173,7 +156,6 @@ let
let let
toplevel = builtins.getAttr system jobs.build; toplevel = builtins.getAttr system jobs.build;
version = toplevel.src.version;
installerClosureInfo = closureInfo { rootPaths = [ toplevel cacert ]; }; installerClosureInfo = closureInfo { rootPaths = [ toplevel cacert ]; };
in in
@ -243,8 +225,9 @@ let
with import ./release-common.nix { inherit pkgs; }; with import ./release-common.nix { inherit pkgs; };
releaseTools.coverageAnalysis { releaseTools.coverageAnalysis {
name = "nix-build"; name = "nix-coverage-${version}";
src = tarball;
src = nix;
enableParallelBuilding = true; enableParallelBuilding = true;
@ -349,7 +332,7 @@ let
(system: "--replace '@binaryTarball_${system}@' $(nix --experimental-features nix-command hash-file --base16 --type sha256 ${binaryTarball.${system}}/*.tar.xz) ") (system: "--replace '@binaryTarball_${system}@' $(nix --experimental-features nix-command hash-file --base16 --type sha256 ${binaryTarball.${system}}/*.tar.xz) ")
systems systems
} \ } \
--replace '@nixVersion@' ${build.${builtins.head systems}.src.version} --replace '@nixVersion@' ${version}
echo "file installer $out/install" >> $out/nix-support/hydra-build-products echo "file installer $out/install" >> $out/nix-support/hydra-build-products
''; '';
@ -357,11 +340,10 @@ let
# Aggregate job containing the release-critical jobs. # Aggregate job containing the release-critical jobs.
release = pkgs.releaseTools.aggregate { release = pkgs.releaseTools.aggregate {
name = "nix-${tarball.version}"; name = "nix-${version}";
meta.description = "Release-critical builds"; meta.description = "Release-critical builds";
constituents = constituents =
[ tarball [ build.i686-linux
build.i686-linux
build.x86_64-darwin build.x86_64-darwin
build.x86_64-linux build.x86_64-linux
build.aarch64-linux build.aarch64-linux

View file

@ -7,7 +7,7 @@ with import ./release-common.nix { inherit pkgs; };
(if useClang then clangStdenv else stdenv).mkDerivation { (if useClang then clangStdenv else stdenv).mkDerivation {
name = "nix"; name = "nix";
buildInputs = buildDeps ++ propagatedDeps ++ tarballDeps ++ perlDeps ++ [ pkgs.rustfmt ]; buildInputs = buildDeps ++ propagatedDeps ++ perlDeps ++ [ pkgs.rustfmt ];
inherit configureFlags; inherit configureFlags;