Skip to content
Snippets Groups Projects
Commit 11a7ceb9 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

release.nix: Build outside of a chroot.

* release.nix (unchroot): New function.
  (jobs)[tarball, build, build_disable_daemon]: Use it.
parent eb0880e7
No related branches found
No related tags found
No related merge requests found
/* GNU Guix --- Functional package management for GNU /* GNU Guix --- Functional package management for GNU
Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org> Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
This file is part of GNU Guix. This file is part of GNU Guix.
...@@ -26,6 +26,15 @@ let ...@@ -26,6 +26,15 @@ 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 {}; in
drv: pkgs.lib.overrideDerivation drv (args: {
__noChroot = true;
});
# 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.
...@@ -44,7 +53,8 @@ let ...@@ -44,7 +53,8 @@ let
jobs = { jobs = {
tarball = tarball =
let pkgs = import nixpkgs {}; in unchroot
(let pkgs = import nixpkgs {}; in
pkgs.releaseTools.sourceTarball { pkgs.releaseTools.sourceTarball {
name = "guix-tarball"; name = "guix-tarball";
src = <guix>; src = <guix>;
...@@ -55,12 +65,13 @@ let ...@@ -55,12 +65,13 @@ let
[ "--with-libgcrypt-prefix=${pkgs.libgcrypt}" [ "--with-libgcrypt-prefix=${pkgs.libgcrypt}"
"--localstatedir=/nix/var" "--localstatedir=/nix/var"
]; ];
}; });
build = build =
{ system ? builtins.currentSystem }: { system ? builtins.currentSystem }:
let pkgs = import nixpkgs { inherit system; }; in unchroot
(let pkgs = import nixpkgs { inherit 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 ];
...@@ -83,13 +94,14 @@ let ...@@ -83,13 +94,14 @@ let
inherit succeedOnFailure keepBuildDirectory inherit succeedOnFailure keepBuildDirectory
buildOutOfSourceTree; buildOutOfSourceTree;
}; });
build_disable_daemon = build_disable_daemon =
{ system ? builtins.currentSystem }: { system ? builtins.currentSystem }:
let unchroot
(let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
build = jobs.build { inherit system; }; build = jobs.build { inherit system; };
in in
...@@ -101,7 +113,7 @@ let ...@@ -101,7 +113,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 = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment