release.nix: Revert back to before unchroot experiments.

* release.nix: Revert to commit 4050e5d6cf.
This commit is contained in:
Ludovic Courtès 2013-05-12 15:18:17 +02:00
parent 46614bba7c
commit 9b1ef2f323

View file

@ -1,5 +1,5 @@
/* GNU Guix --- Functional package management for GNU /* GNU Guix --- Functional package management for GNU
Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org> Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
This file is part of GNU Guix. This file is part of GNU Guix.
@ -26,39 +26,6 @@ let
succeedOnFailure = true; succeedOnFailure = true;
keepBuildDirectory = true; keepBuildDirectory = true;
# Run the given derivation in outside of a chroot. This hack is used on
# hydra.gnu.org where we want Guix derivations to run in a chroot that lacks
# /bin, whereas Nixpkgs relies on /bin/sh.
unchroot =
let
pkgs = import nixpkgs {};
# XXX: The `python' derivation contains a `modules' attribute that makes
# `overrideDerivation' fail with "cannot coerce an attribute set (except
# a derivation) to a string", so just remove it.
pythonKludge = drv: removeAttrs drv [ "modules" ];
in
drv:
if builtins.isAttrs drv
then pkgs.lib.overrideDerivation (pythonKludge drv) (args: {
__noChroot = true;
nativeBuildInputs = map unchroot args.nativeBuildInputs;
propagatedNativeBuildInputs =
map unchroot args.propagatedNativeBuildInputs;
})
else drv;
# Return a Nixpkgs with some derivations "unchrooted".
unchrootedNixpkgs = system:
import nixpkgs {
# XXX: Hack to make sure these ones also get "unchrooted".
config.packageOverrides = pkgs: {
zlib = unchroot pkgs.zlib;
libunistring = unchroot pkgs.libunistring;
};
inherit system;
};
# The Guile used to bootstrap the whole thing. It's normally # The Guile used to bootstrap the whole thing. It's normally
# downloaded by the build system, but here we download it via a # downloaded by the build system, but here we download it via a
# fixed-output derivation and stuff it into the build tree. # fixed-output derivation and stuff it into the build tree.
@ -77,39 +44,27 @@ let
jobs = { jobs = {
tarball = tarball =
unchroot let pkgs = import nixpkgs {}; in
(let pkgs = unchrootedNixpkgs builtins.currentSystem; in
pkgs.releaseTools.sourceTarball { pkgs.releaseTools.sourceTarball {
name = "guix-tarball"; name = "guix-tarball";
src = <guix>; src = <guix>;
buildInputs = buildInputs = with pkgs; [ guile sqlite bzip2 git libgcrypt ];
let git_light = pkgs.git.override { buildNativeInputs = with pkgs; [ texinfo gettext cvs pkgconfig ];
# Minimal Git to avoid building too many dependencies.
withManual = false;
pythonSupport = false;
svnSupport = false;
guiSupport = false;
};
in
[ git_light ] ++
(with pkgs; [ guile sqlite bzip2 libgcrypt ]);
nativeBuildInputs = with pkgs; [ texinfo gettext cvs pkgconfig ];
preAutoconf = ''git config submodule.nix.url "${<nix>}"''; preAutoconf = ''git config submodule.nix.url "${<nix>}"'';
configureFlags = configureFlags =
[ "--with-libgcrypt-prefix=${pkgs.libgcrypt}" [ "--with-libgcrypt-prefix=${pkgs.libgcrypt}"
"--localstatedir=/nix/var" "--localstatedir=/nix/var"
]; ];
}); };
build = build =
{ system ? builtins.currentSystem }: { system ? builtins.currentSystem }:
unchroot let pkgs = import nixpkgs { inherit system; }; in
(let pkgs = unchrootedNixpkgs system; in
pkgs.releaseTools.nixBuild { pkgs.releaseTools.nixBuild {
name = "guix"; name = "guix";
buildInputs = with pkgs; [ guile sqlite bzip2 libgcrypt ]; buildInputs = with pkgs; [ guile sqlite bzip2 libgcrypt ];
nativeBuildInputs = [ pkgs.pkgconfig ]; buildNativeInputs = [ pkgs.pkgconfig ];
src = jobs.tarball; src = jobs.tarball;
configureFlags = configureFlags =
[ "--with-libgcrypt-prefix=${pkgs.libgcrypt}" [ "--with-libgcrypt-prefix=${pkgs.libgcrypt}"
@ -128,15 +83,14 @@ let
inherit succeedOnFailure keepBuildDirectory inherit succeedOnFailure keepBuildDirectory
buildOutOfSourceTree; buildOutOfSourceTree;
}); };
build_disable_daemon = build_disable_daemon =
{ system ? builtins.currentSystem }: { system ? builtins.currentSystem }:
unchroot let
(let pkgs = import nixpkgs { inherit system; };
pkgs = unchrootedNixpkgs system;
build = jobs.build { inherit system; }; build = jobs.build { inherit system; };
in in
pkgs.lib.overrideDerivation build ({ configureFlags, ... }: { pkgs.lib.overrideDerivation build ({ configureFlags, ... }: {
@ -147,7 +101,7 @@ let
# the chroot. # the chroot.
preConfigure = "export NIX_REMOTE=daemon"; preConfigure = "export NIX_REMOTE=daemon";
__noChroot = true; __noChroot = true;
})); });
# Jobs to test the distro. # Jobs to test the distro.
distro = { distro = {
@ -155,7 +109,7 @@ let
{ system ? builtins.currentSystem }: { system ? builtins.currentSystem }:
let let
pkgs = unchrootedNixpkgs system; pkgs = import nixpkgs { inherit system; };
guix = jobs.build { inherit system; }; guix = jobs.build { inherit system; };
in in
# XXX: We have no way to tell the Nix code to swallow the .drv # XXX: We have no way to tell the Nix code to swallow the .drv