summaryrefslogtreecommitdiffstats
path: root/release.nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-03-13 14:05:49 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-03-13 18:05:22 +0100
commit7c39201bcb181653af2bafee2fc02d1bcc58691b (patch)
tree3d2214538c1b21401e2073edc2c6291fa64b93d7 /release.nix
parenteab7d790a36ff0aa648321a39eaeaa4248755156 (diff)
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.
Diffstat (limited to 'release.nix')
-rw-r--r--release.nix102
1 files changed, 42 insertions, 60 deletions
diff --git a/release.nix b/release.nix
index b1cb1e437..be9f8b981 100644
--- a/release.nix
+++ b/release.nix
@@ -8,11 +8,14 @@ let
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 {
# Create a "vendor" directory that contains the crates listed in
- # Cargo.lock, and include it in the Nix tarball. This allows Nix
- # to be built without network access.
+ # Cargo.lock. This allows Nix to be built without network access.
vendoredCrates =
let
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:
let pkgs = import nixpkgs { inherit system; }; in
@@ -105,20 +66,21 @@ let
with import ./release-common.nix { inherit pkgs; };
- releaseTools.nixBuild {
- name = "nix";
- src = tarball;
+ stdenv.mkDerivation {
+ name = "nix-${version}";
- outputs = [ "out" "dev" ];
+ src = nix;
+
+ outputs = [ "out" "dev" "doc" ];
buildInputs = buildDeps;
propagatedBuildInputs = propagatedDeps;
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
cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib
rm -f $out/lib/*.a
@@ -126,6 +88,10 @@ let
chmod u+w $out/lib/*.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 ++
@@ -137,10 +103,17 @@ let
installFlags = "sysconfdir=$(out)/etc";
+ doCheck = true;
+
doInstallCheck = true;
installCheckFlags = "sysconfdir=$(out)/etc";
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;
releaseTools.nixBuild {
- name = "nix-perl";
- src = tarball;
+ name = "nix-perl-${version}";
+
+ src = nix;
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;
configureFlags = ''
@@ -173,7 +156,6 @@ let
let
toplevel = builtins.getAttr system jobs.build;
- version = toplevel.src.version;
installerClosureInfo = closureInfo { rootPaths = [ toplevel cacert ]; };
in
@@ -243,8 +225,9 @@ let
with import ./release-common.nix { inherit pkgs; };
releaseTools.coverageAnalysis {
- name = "nix-build";
- src = tarball;
+ name = "nix-coverage-${version}";
+
+ src = nix;
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) ")
systems
} \
- --replace '@nixVersion@' ${build.${builtins.head systems}.src.version}
+ --replace '@nixVersion@' ${version}
echo "file installer $out/install" >> $out/nix-support/hydra-build-products
'';
@@ -357,11 +340,10 @@ let
# Aggregate job containing the release-critical jobs.
release = pkgs.releaseTools.aggregate {
- name = "nix-${tarball.version}";
+ name = "nix-${version}";
meta.description = "Release-critical builds";
constituents =
- [ tarball
- build.i686-linux
+ [ build.i686-linux
build.x86_64-darwin
build.x86_64-linux
build.aarch64-linux