Add stdenv bootstrap tools generation to release.nix

This commit is contained in:
Eelco Dolstra 2015-10-23 13:04:10 +02:00
parent e48ad583b0
commit 45c7dd7d98
5 changed files with 53 additions and 37 deletions

View file

@ -116,7 +116,7 @@ rec {
Type: Type:
collect :: collect ::
(AttrSet -> Bool) -> AttrSet -> AttrSet (AttrSet -> Bool) -> AttrSet -> [x]
Example: Example:
collect isList { a = { b = ["b"]; }; c = [1]; } collect isList { a = { b = ["b"]; }; c = [1]; }

View file

@ -34,7 +34,7 @@ rec {
build = build =
stdenv.mkDerivation { stdenv.mkDerivation {
name = "build"; name = "stdenv-bootstrap-tools";
buildInputs = [nukeReferences cpio]; buildInputs = [nukeReferences cpio];
@ -154,9 +154,19 @@ rec {
allowedReferences = []; allowedReferences = [];
}; };
dist = stdenv.mkDerivation {
name = "stdenv-bootstrap-tools";
buildCommand = ''
mkdir -p $out/nix-support
echo "file tarball ${build}/on-server/bootstrap-tools.tar.xz" >> $out/nix-support/hydra-build-products
echo "file busybox ${build}/on-server/busybox" >> $out/nix-support/hydra-build-products
'';
};
test = ((import ./default.nix) { test = ((import ./default.nix) {
inherit system; inherit system;
customBootstrapFiles = { customBootstrapFiles = {
busybox = "${build}/on-server/busybox"; busybox = "${build}/on-server/busybox";
bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz"; bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz";

View file

@ -1,6 +1,4 @@
{system ? builtins.currentSystem}: with import ../../top-level/all-packages.nix { system = "x86_64-darwin"; };
with import ../../top-level/all-packages.nix {inherit system;};
rec { rec {
# We want coreutils without ACL support. # We want coreutils without ACL support.
@ -9,7 +7,7 @@ rec {
}); });
build = stdenv.mkDerivation { build = stdenv.mkDerivation {
name = "build"; name = "stdenv-bootstrap-tools";
buildInputs = [nukeReferences cpio]; buildInputs = [nukeReferences cpio];
@ -128,45 +126,42 @@ rec {
nuke-refs $out/lib/clang/3.5.0/lib/darwin/* nuke-refs $out/lib/clang/3.5.0/lib/darwin/*
nuke-refs $out/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation nuke-refs $out/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
set -x
mkdir $out/.pack mkdir $out/.pack
mv $out/* $out/.pack mv $out/* $out/.pack
mv $out/.pack $out/pack mv $out/.pack $out/pack
mkdir $out/on-server mkdir $out/on-server
(cd $out/pack && (find | cpio -o -H newc)) | bzip2 > $out/on-server/bootstrap-tools.cpio.bz2 cp ${stdenv.shell} $out/on-server/sh
cp ${cpio}/bin/cpio $out/on-server
cp ${coreutils_}/bin/mkdir $out/on-server
cp ${bzip2}/bin/bzip2 $out/on-server
mkdir $out/in-nixpkgs chmod u+w $out/on-server/*
cp ${stdenv.shell} $out/in-nixpkgs/sh strip $out/on-server/*
cp ${cpio}/bin/cpio $out/in-nixpkgs nuke-refs $out/on-server/*
cp ${coreutils_}/bin/mkdir $out/in-nixpkgs
cp ${bzip2}/bin/bzip2 $out/in-nixpkgs
chmod u+w $out/in-nixpkgs/* for i in $out/on-server/*; do
strip $out/in-nixpkgs/*
nuke-refs $out/in-nixpkgs/*
for i in $out/in-nixpkgs/*; do
fix_dyld $i fix_dyld $i
done done
(cd $out/pack && (find | cpio -o -H newc)) | bzip2 > $out/on-server/bootstrap-tools.cpio.bz2
''; '';
allowedReferences = []; allowedReferences = [];
}; };
host = stdenv.mkDerivation { dist = stdenv.mkDerivation {
name = "host"; name = "stdenv-bootstrap-tools";
buildCommand = '' buildCommand = ''
mkdir -p $out/nix-support mkdir -p $out/hydra-build-products
echo "file tarball ${build}/on-server/bootstrap-tools.cpio.bz2" >> $out/nix-support/hydra-build-products
for i in "${build}/on-server/"*; do echo "file sh ${build}/on-server/sh" >> $out/nix-support/hydra-build-products
echo "file binary-dist $i" >> $out/nix-support/hydra-build-products echo "file cpio ${build}/on-server/cpio" >> $out/nix-support/hydra-build-products
done echo "file mkdir ${build}/on-server/mkdir" >> $out/nix-support/hydra-build-products
echo "file bzip2 ${build}/on-server/bzip2" >> $out/nix-support/hydra-build-products
echo "darwin-bootstrap-tools-$(date +%Y.%m.%d)" >> $out/nix-support/hydra-release-name
''; '';
allowedReferences = [ build ];
}; };
unpack = stdenv.mkDerivation { unpack = stdenv.mkDerivation {
@ -218,9 +213,9 @@ rec {
tarball = "${build}/on-server/bootstrap-tools.cpio.bz2"; tarball = "${build}/on-server/bootstrap-tools.cpio.bz2";
mkdir = "${build}/in-nixpkgs/mkdir"; mkdir = "${build}/on-server/mkdir";
bzip2 = "${build}/in-nixpkgs/bzip2"; bzip2 = "${build}/on-server/bzip2";
cpio = "${build}/in-nixpkgs/cpio"; cpio = "${build}/on-server/cpio";
allowedReferences = [ "out" ]; allowedReferences = [ "out" ];
}; };
@ -249,7 +244,7 @@ rec {
# an SSL-capable curl # an SSL-capable curl
curl --version | grep SSL curl --version | grep SSL
${build}/in-nixpkgs/sh -c 'echo Hello World' ${build}/on-server/sh -c 'echo Hello World'
export flags="-idirafter ${unpack}/include-Libsystem --sysroot=${unpack} -L${unpack}/lib" export flags="-idirafter ${unpack}/include-Libsystem --sysroot=${unpack} -L${unpack}/lib"

View file

@ -2,9 +2,9 @@
also builds the documentation and tests whether the Nix expressions also builds the documentation and tests whether the Nix expressions
evaluate correctly. */ evaluate correctly. */
{ nixpkgs, officialRelease }: { pkgs, nixpkgs, officialRelease }:
with import nixpkgs.outPath {}; with pkgs;
releaseTools.sourceTarball rec { releaseTools.sourceTarball rec {
name = "nixpkgs-tarball"; name = "nixpkgs-tarball";

View file

@ -19,8 +19,10 @@ with import ./release-lib.nix { inherit supportedSystems; };
let let
lib = pkgs.lib;
jobs = jobs =
{ tarball = import ./make-tarball.nix { inherit nixpkgs officialRelease; }; { tarball = import ./make-tarball.nix { inherit pkgs nixpkgs officialRelease; };
manual = import ../../doc; manual = import ../../doc;
lib-tests = import ../../lib/tests/release.nix { inherit nixpkgs; }; lib-tests = import ../../lib/tests/release.nix { inherit nixpkgs; };
@ -42,9 +44,18 @@ let
jobs.thunderbird.i686-linux jobs.thunderbird.i686-linux
jobs.glib-tested.x86_64-linux # standard glib doesn't do checks jobs.glib-tested.x86_64-linux # standard glib doesn't do checks
jobs.glib-tested.i686-linux jobs.glib-tested.i686-linux
]; ] ++ lib.collect lib.isDerivation jobs.stdenvBootstrapTools;
}; };
stdenvBootstrapTools.i686-linux =
{ inherit (import ../stdenv/linux/make-bootstrap-tools.nix { system = "i686-linux"; }) dist test; };
stdenvBootstrapTools.x86_64-linux =
{ inherit (import ../stdenv/linux/make-bootstrap-tools.nix { system = "x86_64-linux"; }) dist test; };
stdenvBootstrapTools.x86_64-darwin =
{ inherit (import ../stdenv/pure-darwin/make-bootstrap-tools.nix) dist test; };
} // (mapTestOn ((packagePlatforms pkgs) // rec { } // (mapTestOn ((packagePlatforms pkgs) // rec {
abcde = linux; abcde = linux;