unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Vivien Kraus via Guix-patches via <guix-patches@gnu.org>
To: 69957@debbugs.gnu.org
Cc: rg@raghavgururajan.name, vivien@planete-kraus.eu,
	liliana.prikler@gmail.com, maxim.cournoyer@gmail.com
Subject: [bug#69957] [PATCH gnome-team 1/2] gnu: duc: Fix build.
Date: Sat, 23 Mar 2024 08:12:48 +0100	[thread overview]
Message-ID: <89b68e33e58fd258fb33db7ee66111eb90c20b77.1711178973.git.vivien@planete-kraus.eu> (raw)
In-Reply-To: <cover.1711178973.git.vivien@planete-kraus.eu>

* gnu/packages/patches/duc-fix-test-sh.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it here.
* gnu/packages/disk.scm (duc): Use it here.

Change-Id: I664614dc35fb88f8ee63dbe727a38f17f4af0f8e
---
 gnu/local.mk                               |  1 +
 gnu/packages/disk.scm                      |  4 +-
 gnu/packages/patches/duc-fix-test-sh.patch | 70 ++++++++++++++++++++++
 3 files changed, 74 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/duc-fix-test-sh.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 2ea9806b7e..24103a4da7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1114,6 +1114,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/dstat-fix-crash-when-specifying-delay.patch	\
   %D%/packages/patches/dstat-skip-devices-without-io.patch	\
   %D%/packages/patches/dtc-meson-cell-overflow.patch		\
+  %D%/packages/patches/duc-fix-test-sh.patch                    \
   %D%/packages/patches/dune-common-skip-failing-tests.patch	\
   %D%/packages/patches/dune-grid-add-missing-include-cassert.patch	\
   %D%/packages/patches/dune-istl-fix-solver-playground.patch	\
diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index b0117d77ce..ea18a98ab6 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -1562,7 +1562,9 @@ (define-public duc
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0sglcn38rgn6y3m5ahngizyn3x2rzhqjphs7g0ppnlinkz56rcv4"))))
+                "0sglcn38rgn6y3m5ahngizyn3x2rzhqjphs7g0ppnlinkz56rcv4"))
+              (patches
+               (search-patches "duc-fix-test-sh.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
diff --git a/gnu/packages/patches/duc-fix-test-sh.patch b/gnu/packages/patches/duc-fix-test-sh.patch
new file mode 100644
index 0000000000..8b79e4bd03
--- /dev/null
+++ b/gnu/packages/patches/duc-fix-test-sh.patch
@@ -0,0 +1,70 @@
+From a84835e481d9b5fcfc101bb1fa5aba38a245b6f3 Mon Sep 17 00:00:00 2001
+Message-ID: <a84835e481d9b5fcfc101bb1fa5aba38a245b6f3.1711177846.git.vivien@planete-kraus.eu>
+From: Fabio Natali <me@fabionatali.com>
+Date: Wed, 30 Aug 2023 11:35:40 +0100
+Subject: [PATCH] Fix test.sh which used to fail in some circumstances
+
+duc's behaviour may legitimately vary depending on the system it is being run
+on. The test.sh script used to fail in some circumstances as it was too strict
+and it did not account for some legitimate behaviour differences.
+
+Fix: update `test.sh' variable
+---
+
+This is a squash of pull request https://github.com/zevv/duc/pull/318,
+waiting to be merged.
+
+ test.sh | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+diff --git a/test.sh b/test.sh
+index eb592be..7668499 100755
+--- a/test.sh
++++ b/test.sh
+@@ -130,8 +130,8 @@ fi
+ # Actual tests are below.  If you add test cases above, these need to be tweaked.
+ #---------------------------------------------------------------------------------
+ 
+-
+-cat ${DUC_TEST_DIR}.out | grep -q "Indexed 77 files and 47 directories, (91869B apparent, 540672B actual)"
++# An exact match is expected on the apparent size; the actual size may vary.
++cat ${DUC_TEST_DIR}.out | grep -q "Indexed 77 files and 47 directories, (91869B apparent, [0-9]*B actual)"
+ 
+ if [ "$?" = "0" ]; then
+ 	echo "report: ok"
+@@ -153,16 +153,26 @@ if [ "$?" != "0" ]; then
+ 	exit 1
+ fi
+ 
+-testsum="33e2be27a9e70e81d4006a2d7b555948"
++# When two or more hard links point to the same file and when running duc with
++# the `--check-hard-links' option, only one of the hard links will be
++# counted. However, duc may pick up and display a different hard link depending
++# on the system it is being run on. Since our tests include three hard links to
++# the same file, we should be expecting three possible outcomes, all equally
++# valid, each corresponding to one of the following MD5 checksums.
++testsum0="78dbf880ef6917ea665fddb5ebb44428"
++testsum1="38ab7b7d1ec6ac57d672c5618371386d"
++testsum2="33e2be27a9e70e81d4006a2d7b555948"
+ md5sum ${DUC_TEST_DIR}.out > /tmp/.duc.md5sum
+-grep -q $testsum /tmp/.duc.md5sum
++grep -q "$testsum0\|$testsum1\|$testsum2" /tmp/.duc.md5sum
+ 
+ if [ "$?" = "0" ]; then
+ 	echo "md5sum: ok"
+ else
+ 	echo "md5sum: failed"
+-	echo "expected: "
+-	echo "$testsum  ${DUC_TEST_DIR}.out"
++	echo "expected one of: "
++	echo "$testsum0  ${DUC_TEST_DIR}.out"
++	echo "$testsum1  ${DUC_TEST_DIR}.out"
++	echo "$testsum2  ${DUC_TEST_DIR}.out"
+ 	echo "got: "
+ 	cat /tmp/.duc.md5sum
+ 	exit 1
+
+base-commit: b8f9659688a38476df9f613be3342bb8e2d65402
+-- 
+2.41.0
+
-- 
2.41.0




  reply	other threads:[~2024-03-23  8:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-23  7:29 [bug#69957] [PATCH gnome-team 0/2] Fix Duc build Vivien Kraus via Guix-patches via
2024-03-23  7:12 ` Vivien Kraus via Guix-patches via [this message]
2024-03-23 10:15   ` [bug#69957] [PATCH gnome-team 1/2] gnu: duc: Fix build Liliana Marie Prikler
2024-03-24 10:32     ` Christopher Baines
2024-03-23  7:13 ` [bug#69957] [PATCH gnome-team 2/2] gnu: duc: Update style Vivien Kraus via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=89b68e33e58fd258fb33db7ee66111eb90c20b77.1711178973.git.vivien@planete-kraus.eu \
    --to=guix-patches@gnu.org \
    --cc=69957@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    --cc=maxim.cournoyer@gmail.com \
    --cc=rg@raghavgururajan.name \
    --cc=vivien@planete-kraus.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).