Subject: Re: bug#36747: Official MesCC bootstrap binaries differ from my locally built ones

From: Mark H Weaver <[email-masked]>
Date: Thu, 15 Aug 2019 16:56:47 -0400

Hi,

Marius Bakke <[email-masked]> writes:
> I can look into adjusting the bash fix for 5.0, and updating the
> bootstrap binary URLs and hashes.

I've attached preliminary untested patches for these.  I'm testing them
now.

       Mark

>From e3e477c92af3b62eb8f65a5c4459f02faf60e857 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <[email-masked]>
Date: Thu, 15 Aug 2019 15:39:57 -0400
Subject: [PATCH 1/2] gnu: bootstrap: Update to the 20190815 bootstrap
 binaries.

* gnu/packages/bootstrap.scm (%bootstrap-linux-libre-headers): Update the
download URL.
(%bootstrap-mescc-tools, %bootstrap-mes): Update the download URL and hash.
---
 gnu/packages/bootstrap.scm | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 8dbe52435e..1982c9706f 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <[email-masked]>
-;;; Copyright © 2014, 2015, 2018 Mark H Weaver <[email-masked]>
+;;; Copyright © 2014, 2015, 2018, 2019 Mark H Weaver <[email-masked]>
 ;;; Copyright © 2017 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen <[email-masked]>
 ;;;
@@ -490,7 +490,7 @@ $out/bin/guile --version~%"
      (origin
        (method url-fetch)
        (uri (map (cute string-append <>
-                       "/i686-linux/20181020/"
+                       "/i686-linux/20190815/"
                        "linux-libre-headers-stripped-4.14.67-i686-linux.tar.xz")
                  %bootstrap-base-urls))
        (sha256
@@ -735,12 +735,12 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
             (method url-fetch)
             (uri (map
                   (cute string-append <>
-                        "/i686-linux/20181020/"
-                        "mescc-tools-static-0.5.2-0.bb062b0-i686-linux.tar.xz")
+                        "/i686-linux/20190815/"
+                        "mescc-tools-static-stripped-0.5.2-i686-linux.tar.xz")
                   %bootstrap-base-urls))
             (sha256
              (base32
-              "11lniw0vg61kmyhvnwkmcnkci9ym6hbmiksiqggd0hkipbq7hvlz")))))))
+              "0c3kklgghzh4q2dbpl6asb74cimp7hp6jscdwqwmzxbapgcl6582")))))))
     (synopsis "Bootstrap binaries of MesCC Tools")
     (description synopsis)
     (home-page #f)
@@ -784,12 +784,12 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
             (method url-fetch)
             (uri (map
                   (cute string-append <>
-                        "/i686-linux/20181020/"
+                        "/i686-linux/20190815/"
                         "mes-minimal-stripped-0.19-i686-linux.tar.xz")
                   %bootstrap-base-urls))
             (sha256
              (base32
-              "0k7kkl68a6xaadv47ij0nr9jm5ca1ffj38n7f2lg80y72wdkwr9h")))))))
+              "1q4xjpx6nbn44kxnilpgl12bhpmwy2bblzwszc2ci7xkf400jcpv")))))))
     (supported-systems '("i686-linux" "x86_64-linux"))
     (synopsis "Bootstrap binaries of Mes")
     (description synopsis)
-- 
2.22.1

>From 1e609d70cd29af6eed7ceb81b840ac0a4f29fe42 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <[email-masked]>
Date: Thu, 15 Aug 2019 16:45:03 -0400
Subject: [PATCH 2/2] UNTESTED: bash: Unconditionally configure PGRP_PIPE for
 *-linux systems.

* gnu/packages/patches/bash-linux-pgrp-pipe.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/bash.scm (bash)[source]: Add the patch.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/bash.scm                         |  3 +-
 .../patches/bash-linux-pgrp-pipe.patch        | 32 +++++++++++++++++++
 3 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/bash-linux-pgrp-pipe.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 08bc205623..2e6d4776b9 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -697,6 +697,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/awesome-reproducible-png.patch		\
   %D%/packages/patches/azr3.patch				\
   %D%/packages/patches/bash-completion-directories.patch	\
+  %D%/packages/patches/bash-linux-pgrp-pipe.patch		\
   %D%/packages/patches/bastet-change-source-of-unordered_set.patch	\
   %D%/packages/patches/bazaar-CVE-2017-14176.patch		\
   %D%/packages/patches/beets-python-3.7-fix.patch		\
diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index d3abeec6e6..f1ef7047bf 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -115,7 +115,8 @@ number/base32-hash tuples, directly usable in the 'patch-series' form."
                (base32
                 "0kgvfwqdcd90waczf4gx39xnrxzijhjrzyzv7s8v4w31qqm0za5l"))
               (patch-flags '("-p0"))
-              (patches %patch-series-5.0)))
+              (patches (cons (search-patch "bash-linux-pgrp-pipe.patch")
+                             %patch-series-5.0))))
      (version (string-append version "." (number->string (length %patch-series-5.0))))
      (build-system gnu-build-system)
 
diff --git a/gnu/packages/patches/bash-linux-pgrp-pipe.patch b/gnu/packages/patches/bash-linux-pgrp-pipe.patch
new file mode 100644
index 0000000000..234a55e897
--- /dev/null
+++ b/gnu/packages/patches/bash-linux-pgrp-pipe.patch
@@ -0,0 +1,32 @@
+Unconditionally enable PGRP_PIPE on Linux (the kernel), regardless of
+the kernel version in use on the build machine.
+
+--- configure.ac.orig	2019-01-02 09:38:44.000000000 -0500
++++ configure.ac	2019-08-15 16:40:24.271758379 -0400
+@@ -1108,10 +1108,7 @@
+ solaris2*)	LOCAL_CFLAGS=-DSOLARIS ;;
+ lynxos*)	LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
+ linux*)		LOCAL_LDFLAGS=-rdynamic		 # allow dynamic loading
+-		case "`uname -r`" in
+-		1.*|2.[[0123]]*)	: ;;
+-		*)	AC_DEFINE(PGRP_PIPE) ;;
+-		esac ;;
++		AC_DEFINE(PGRP_PIPE) ;;
+ netbsd*|openbsd*)	LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;;
+ *qnx[[67]]*)	LOCAL_LIBS="-lncurses" ;;
+ *qnx*)		LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
+--- configure.orig	2019-01-02 09:43:04.000000000 -0500
++++ configure	2019-08-15 16:41:44.440155912 -0400
+@@ -16312,11 +16312,7 @@
+ solaris2*)	LOCAL_CFLAGS=-DSOLARIS ;;
+ lynxos*)	LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
+ linux*)		LOCAL_LDFLAGS=-rdynamic		 # allow dynamic loading
+-		case "`uname -r`" in
+-		1.*|2.[0123]*)	: ;;
+-		*)	$as_echo "#define PGRP_PIPE 1" >>confdefs.h
+- ;;
+-		esac ;;
++		$as_echo "#define PGRP_PIPE 1" >>confdefs.h ;;
+ netbsd*|openbsd*)	LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;;
+ *qnx[67]*)	LOCAL_LIBS="-lncurses" ;;
+ *qnx*)		LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
-- 
2.22.1