bootstrap: Build bootstrap bash deterministically.

* gnu/packages/patches/bash-4.4-linux-pgrp-pipe.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/make-bootstrap.scm (static-bash-for-bootstrap): New variable.
(%static-inputs): Use 'static-bash-for-bootstrap' instead of 'static-bash'.
This commit is contained in:
Mark H Weaver 2019-08-11 22:37:12 -04:00
parent 6744cef5b0
commit fe507d7a3d
No known key found for this signature in database
GPG Key ID: 7CEF29847562C516
3 changed files with 43 additions and 3 deletions

View File

@ -697,6 +697,7 @@ dist_patch_DATA = \
%D%/packages/patches/avidemux-install-to-lib.patch \
%D%/packages/patches/awesome-reproducible-png.patch \
%D%/packages/patches/azr3.patch \
%D%/packages/patches/bash-4.4-linux-pgrp-pipe.patch \
%D%/packages/patches/bash-completion-directories.patch \
%D%/packages/patches/bastet-change-source-of-unordered_set.patch \
%D%/packages/patches/bazaar-CVE-2017-14176.patch \

View File

@ -2,7 +2,7 @@
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2018, 2019 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Guix.
@ -125,6 +125,15 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
(current-source-location)
#:native-inputs native-inputs))
(define static-bash-for-bootstrap
(package
(inherit static-bash)
(source (origin
(inherit (package-source static-bash))
(patches
(cons (search-patch "bash-4.4-linux-pgrp-pipe.patch")
(origin-patches (package-source static-bash))))))))
(define %static-inputs
;; Packages that are to be used as %BOOTSTRAP-INPUTS.
(let ((coreutils (package (inherit coreutils)
@ -192,7 +201,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
(("-Wl,-export-dynamic") ""))
#t)))))))
(inputs (if (%current-target-system)
`(("bash" ,static-bash))
`(("bash" ,static-bash-for-bootstrap))
'()))))
(tar (package (inherit tar)
(arguments
@ -233,7 +242,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
("sed" ,sed)
("grep" ,grep)
("gawk" ,gawk)))
("bash" ,static-bash))))
("bash" ,static-bash-for-bootstrap))))
(define %static-binaries
(package

View File

@ -0,0 +1,30 @@
Unconditionally enable PGRP_PIPE on Linux (the kernel), regardless of
the kernel version in use on the build machine.
--- configure.ac.orig 1969-12-31 19:00:00.000000000 -0500
+++ configure.ac 2019-08-11 22:28:26.038841961 -0400
@@ -1092,9 +1092,7 @@
solaris2*) LOCAL_CFLAGS=-DSOLARIS ;;
lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
- case "`uname -r`" in
- 2.[[456789]]*|[[34]]*) AC_DEFINE(PGRP_PIPE) ;;
- esac ;;
+ AC_DEFINE(PGRP_PIPE) ;;
*qnx6*) LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;;
*qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
powerux*) LOCAL_LIBS="-lgen" ;;
--- configure.orig 1969-12-31 19:00:00.000000000 -0500
+++ configure 2019-08-11 22:28:10.166763255 -0400
@@ -16064,10 +16064,7 @@
solaris2*) LOCAL_CFLAGS=-DSOLARIS ;;
lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
- case "`uname -r`" in
- 2.[456789]*|[34]*) $as_echo "#define PGRP_PIPE 1" >>confdefs.h
- ;;
- esac ;;
+ $as_echo "#define PGRP_PIPE 1" >>confdefs.h ;;
*qnx6*) LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;;
*qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
powerux*) LOCAL_LIBS="-lgen" ;;