[PATCH gnome-team 0/2] Fix Duc build

  • Done
  • quality assurance status badge
Details
3 participants
  • Liliana Marie Prikler
  • Christopher Baines
  • Vivien Kraus
Owner
unassigned
Submitted by
Vivien Kraus
Severity
normal

Debbugs page

Vivien Kraus wrote 12 months ago
(address . guix-patches@gnu.org)
cover.1711178973.git.vivien@planete-kraus.eu
Dear Guix,

The duc build failure is known upstream, and a kind person offered a merge request.



I squashed it and made it a patch, what do you think?

Best regards,

Vivien

Vivien Kraus (2):
gnu: duc: Fix build.
gnu: duc: Update style.

gnu/local.mk | 1 +
gnu/packages/disk.scm | 59 +++++++++---------
gnu/packages/patches/duc-fix-test-sh.patch | 70 ++++++++++++++++++++++
3 files changed, 102 insertions(+), 28 deletions(-)
create mode 100644 gnu/packages/patches/duc-fix-test-sh.patch


base-commit: a9951a74a591a9b22ee2d93d8efe0523c6c42c97
--
2.41.0
Vivien Kraus wrote 12 months ago
[PATCH gnome-team 1/2] gnu: duc: Fix build.
(address . 69957@debbugs.gnu.org)
89b68e33e58fd258fb33db7ee66111eb90c20b77.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

Toggle diff (105 lines)
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
Vivien Kraus wrote 12 months ago
[PATCH gnome-team 2/2] gnu: duc: Update style.
(address . 69957@debbugs.gnu.org)
672487dc535ab1f95f95028a95e095b4d7922508.1711178973.git.vivien@planete-kraus.eu
* gnu/packages/disk.scm (duc) [arguments]: Convert to list of G-Expressions.

Change-Id: Iefcdcc55b1e71f7e866cb04795ef74f3b675cfce
---
gnu/packages/disk.scm | 55 ++++++++++++++++++++++---------------------
1 file changed, 28 insertions(+), 27 deletions(-)

Toggle diff (68 lines)
diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index ea18a98ab6..2e2c5739cc 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -1567,33 +1567,34 @@ (define-public duc
(search-patches "duc-fix-test-sh.patch"))))
(build-system gnu-build-system)
(arguments
- `(#:phases
- (modify-phases %standard-phases
- (add-after 'unpack 'patch
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out")))
- (substitute* "src/duc/cmd-ui.c"
- (("ncursesw/ncurses.h") "ncurses.h"))
- (substitute* "examples/index.cgi"
- (("/usr/local/bin/duc")
- (string-append out "/bin/duc"))))))
- (add-after 'install 'install-examples
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (doc (string-append out "/share/doc/" ,name "-" ,version)))
- (copy-recursively "examples" (string-append doc "/examples")))))
- (replace 'check
- (lambda* (#:key tests? #:allow-other-keys)
- (substitute* "test.sh"
- ;; Keep the test logs where --keep-failed can see them.
- (("^(DUC_TEST_DIR=).*" _ assign)
- (format #f "~a~a/test-directory~%" assign (getcwd)))
- ;; XXX ‘actual size’ differed on my system (a consistent 348160
- ;; bytes where the tests expect 540672). However, the ‘apparent
- ;; size’ matches, as does the actual test output. Good enough…?
- ((" [0-9]*B actual") " [0-9]*B actual"))
- (when tests?
- (invoke "./test.sh"))))))) ; no ‘check’ target
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out")))
+ (substitute* "src/duc/cmd-ui.c"
+ (("ncursesw/ncurses.h") "ncurses.h"))
+ (substitute* "examples/index.cgi"
+ (("/usr/local/bin/duc")
+ (string-append out "/bin/duc"))))))
+ (add-after 'install 'install-examples
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (doc (string-append out "/share/doc/" #$name "-" #$version)))
+ (copy-recursively "examples" (string-append doc "/examples")))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (substitute* "test.sh"
+ ;; Keep the test logs where --keep-failed can see them.
+ (("^(DUC_TEST_DIR=).*" _ assign)
+ (format #f "~a~a/test-directory~%" assign (getcwd)))
+ ;; XXX ‘actual size’ differed on my system (a consistent 348160
+ ;; bytes where the tests expect 540672). However, the ‘apparent
+ ;; size’ matches, as does the actual test output. Good enough…?
+ ((" [0-9]*B actual") " [0-9]*B actual"))
+ (when tests?
+ (invoke "./test.sh"))))))) ; no ‘check’ target
(native-inputs
(list autoconf automake libtool pkg-config))
(inputs
--
2.41.0
Liliana Marie Prikler wrote 12 months ago
Re: [PATCH gnome-team 1/2] gnu: duc: Fix build.
ae545f1232acd9cc9f665060f9c2b7b91fe5231c.camel@gmail.com
Am Samstag, dem 23.03.2024 um 08:12 +0100 schrieb Vivien Kraus:
Toggle quote (5 lines)
> * 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
LGTM, though we might want to look closer at the reproducibility of duc
if it's important.
Christopher Baines wrote 12 months ago
Re: [bug#69957] [PATCH gnome-team 1/2] gnu: duc: Fix build.
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
878r27j4xw.fsf@cbaines.net
Liliana Marie Prikler <liliana.prikler@gmail.com> writes:

Toggle quote (9 lines)
> Am Samstag, dem 23.03.2024 um 08:12 +0100 schrieb Vivien Kraus:
>> * 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
> LGTM, though we might want to look closer at the reproducibility of duc
> if it's important.

Thanks both, pushed to gnome-team as
19cd76e3f7a7da7f42e5d576b624897570218928.

Chris
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmYAATtfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XfMmA//VkzydTBxenMyXerqSv+lCit5BA2lXWm7
4xHRwjnWf3VCBh9A3mnhT+p/Ea0qSSoEvvP4u5Rw5MflkC8Z4LFgq/YUNbiHRikQ
sFEZZGf9PUhbfQOQqpv7CJou/dgwWTLvWjamFSlYukvUs/ud2ZWCo48Dtn++Ngqn
3V7+PdIQlSZR0jaciBl0hEE/ieo/A5vUtmEQRPWp8+xy5LqowWSKnNHk+Mk4WuOq
iQKG9p1IWlPXWeYC2jrCZtLBBhlRQhnl8xAjuQp2ihLDWZvhcdQ3UbJJmnvFlrsa
lb5tr2ex3d5n+B4uBgdXxSuNdv/3WxSz5fq8ky8NLyUPyXzXy3/Ekb57AkG5EhGa
pbNNNT/KngkuUt/sNr3orD72+GEHFAkNDE4be+zT+G3MFx0eP8w6N/m3bjxEd/3a
FFT1aS+KFuUGl5Bzzpsm20IBNtEpSw5X+f8BD7RQyP9+EAonr7IEKvsfaYJbd/UD
pNBz1YOJZ+j9j/hhOUsi6NZM6FRxQMj+IFWncUpZxVpSn/qI8iHA5Uuu8SU1xbiq
bhwwAKeH5D257U+ITjpkjTCcPVGxB3B8Luq/6mIgY860k9AS3aRyxGwl8XqvJDbl
EDNss8UG+el1F7XlWP28RtnvoGebgXhDCbPgmBIIhhPRGyAMYpsV8rforA1N51Yx
/uSL8Bejz3o=
=8bRU
-----END PGP SIGNATURE-----

?
Your comment

This issue is archived.

To comment on this conversation send an email to 69957@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 69957
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help