[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: gnu: coreutils: Patch 'cut' unit test on ARM.
From: |
Ludovic Courtès |
Subject: |
01/01: gnu: coreutils: Patch 'cut' unit test on ARM. |
Date: |
Sat, 25 Mar 2017 18:32:07 -0400 (EDT) |
civodul pushed a commit to branch core-updates
in repository guix.
commit d1e3f59c9b8d1be79eded04fe23cceb56b4372f0
Author: Ludovic Courtès <address@hidden>
Date: Sat Mar 25 23:28:54 2017 +0100
gnu: coreutils: Patch 'cut' unit test on ARM.
Fixes <https://bugs.gnu.org/26253>.
* gnu/packages/patches/coreutils-cut-huge-range-test.patch: New file.
* gnu/packages/base.scm (coreutils)[native-inputs]: Add it as an input.
[arguments] <#:phases>: On ARM, add 'patch-cut-test' phase.
* gnu/local.mk (dist_patch_DATA): Add 'coreutils-cut-huge-range-test.patch'.
---
gnu/local.mk | 1 +
gnu/packages/base.scm | 31 +++++++++++++++++++---
.../patches/coreutils-cut-huge-range-test.patch | 22 +++++++++++++++
3 files changed, 50 insertions(+), 4 deletions(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index 6df3e58..ba908cd 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -514,6 +514,7 @@ dist_patch_DATA =
\
%D%/packages/patches/clx-remove-demo.patch \
%D%/packages/patches/cmake-fix-tests.patch \
%D%/packages/patches/coda-use-system-libs.patch \
+ %D%/packages/patches/coreutils-cut-huge-range-test.patch \
%D%/packages/patches/coreutils-fix-cross-compilation.patch \
%D%/packages/patches/cpio-CVE-2016-2037.patch \
%D%/packages/patches/cpufrequtils-fix-aclocal.patch \
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index ba9c820..2a6f6a4 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -307,9 +307,17 @@ used to apply commands with arbitrarily long arguments.")
;; copy of help2man. However, don't pass it when cross-compiling since
;; that would lead it to try to run programs to get their '--help' output
;; for help2man.
- (if (%current-target-system)
- '()
- `(("perl" ,perl))))
+ `(,@(if (%current-target-system)
+ '()
+ `(("perl" ,perl)))
+
+ ;; Apply this patch only on ARM to avoid a full rebuild.
+ ;; TODO: Move to 'patches' in the next update cycle.
+ ,@(if (string-prefix? "arm" (or (%current-target-system)
+ (%current-system)))
+ `(("cut-test.patch"
+ ,(search-patch "coreutils-cut-huge-range-test.patch")))
+ '())))
(outputs '("out" "debug"))
(arguments
`(#:parallel-build? #f ; help2man may be called too early
@@ -328,7 +336,22 @@ used to apply commands with arbitrarily long arguments.")
(substitute* (find-files "tests" "\\.sh$")
(("#!/bin/sh")
(format #f "#!~a/bin/sh" bash)))))
- %standard-phases)))
+
+ ,@(if (string-prefix? "arm" (or (%current-target-system)
+ (%current-system)))
+ '((alist-cons-before
+ 'build 'patch-cut-test
+ (lambda* (#:key inputs native-inputs
+ #:allow-other-keys)
+ (let ((patch (or (assoc-ref inputs
+ "cut-test.patch")
+ (assoc-ref native-inputs
+ "cut-test.patch"))))
+ (zero?
+ (system* "patch" "-p1" "--force"
+ "--input" patch))))
+ %standard-phases))
+ '(%standard-phases)))))
(synopsis "Core GNU utilities (file, text, shell)")
(description
"GNU Coreutils includes all of the basic command-line tools that are
diff --git a/gnu/packages/patches/coreutils-cut-huge-range-test.patch
b/gnu/packages/patches/coreutils-cut-huge-range-test.patch
new file mode 100644
index 0000000..0be2cef
--- /dev/null
+++ b/gnu/packages/patches/coreutils-cut-huge-range-test.patch
@@ -0,0 +1,22 @@
+This patch fixes 100% reproducible test failures on arm-linux-gnueabihf in our
+the build environment chroot, as reported at <https://bugs.gnu.org/26253>.
+It is a followup to this upstream patch:
+
+ commit 28803c8a3144d5d4363cdbd148bbe067af1a67c2
+ Author: Pádraig Brady <address@hidden>
+ Date: Fri Mar 3 00:25:54 2017 -0800
+
+ tests: avoid a spurious failure on older debian
+
+... which appeared to be insufficient.
+
+--- a/tests/misc/cut-huge-range.sh
++++ b/tests/misc/cut-huge-range.sh
+@@ -22,6 +22,7 @@ getlimits_
+
+ vm=$(get_min_ulimit_v_ cut -b1 /dev/null) \
+ || skip_ "this shell lacks ulimit support"
++vm=$(($vm + $(getconf PAGESIZE))) # avoid spurious failures
+
+ # sed script to subtract one from the input.
+ # Each input line should consist of a positive decimal number.