From: Felix Lechner via Guix-patches via <guix-patches@gnu.org>
To: 54165@patchwise.org
Cc: "Ludovic Courtès" <ludo@gnu.org>,
"Taylan Kammer" <taylan.kammer@gmail.com>,
"Felix Lechner" <felix.lechner@lease-up.com>,
"Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#54165] [PATCH v2 2/2] gnu: guile-bytestructures: add patch. (Closes: #54165)
Date: Fri, 7 Jun 2024 06:44:56 -0700 [thread overview]
Message-ID: <eff1f3146d51e82bbc6a2bc3c8e9e98aab6e82c7.1717767896.git.felix.lechner@lease-up.com> (raw)
In-Reply-To: <87mti97vj9.fsf@gnu.org>
Adds the patch from a pull request recently submitted upstream. [1] The
maintainer has not responded yet, so there could be further updates as time
goes on.
With this commit, nyacc 1.08.1 builds successfully..
[1] https://github.com/TaylanUB/scheme-bytestructures/pull/48
Change-Id: I8cd248e6e33efd36f54ca3b31c17badf54a863c5
---
gnu/packages/guile.scm | 3 +-
.../guile-bytestructures-fix-54165.patch | 92 +++++++++++++++++++
2 files changed, 94 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/guile-bytestructures-fix-54165.patch
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 0bbd4a12ad..f7ef0dceff 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -796,7 +796,8 @@ (define-public guile-bytestructures
(file-name (git-file-name name version))
(sha256
(base32
- "1gnh3p2042cch1nkapl0p4pv20q7qs8cxvvbp7a5h1dwqbrkdyss"))))
+ "1gnh3p2042cch1nkapl0p4pv20q7qs8cxvvbp7a5h1dwqbrkdyss"))
+ (patches (search-patches "guile-bytestructures-fix-54165.patch"))))
(build-system gnu-build-system)
(arguments
`(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings
diff --git a/gnu/packages/patches/guile-bytestructures-fix-54165.patch b/gnu/packages/patches/guile-bytestructures-fix-54165.patch
new file mode 100644
index 0000000000..b91ca36df4
--- /dev/null
+++ b/gnu/packages/patches/guile-bytestructures-fix-54165.patch
@@ -0,0 +1,92 @@
+From 5082cdd2529f13286509a525a28f9d9917456fc1 Mon Sep 17 00:00:00 2001
+From: Felix Lechner <felix.lechner@lease-up.com>
+Date: Fri, 7 Jun 2024 04:51:17 -0700
+Subject: [PATCH] Fix alignment in unpacked structs containing unions. (Closes:
+ #47)
+
+The 2.0.1 release suffered from a test failure [1] that caused some
+distributions to disable the test [2] but the underlying cause had yet
+to be identified.
+
+Based on a preliminary review of the code, the author of this commit
+believes there was a surplus line in the code [3] which is deleted
+here. This is the proposed evidence: The line shadowed the
+'alignment' variable in line immediately above it. [4] Then, the same
+expression was used two lines down below. [5] In combination, the line
+being removed here seems to have been left over from editing under
+time pressure. It may also have been added inadvertently.
+
+On GNU Guix, this commit fixes the 'ref1' test for aligned struct
+bytestructures containing union members, which was referenced via
+"run-tests.body.scm:194: FAIL ref1" in Ludo's original report. [6] The
+test output can be found at the bottom of this message.
+
+This commit closes Github issue #47. [7]
+
+[1] https://issues.guix.gnu.org/54165#1
+[2] https://github.com/alpinelinux/aports/commit/2d8604645ca38552343c61fbc65728a2881e6ddd
+[3] https://github.com/TaylanUB/scheme-bytestructures/blob/a6d5d25b26c0c5ef1f5fa38e2472fbf6a32cdf89/bytestructures/body/struct.scm#L110
+[4] https://github.com/TaylanUB/scheme-bytestructures/blob/a6d5d25b26c0c5ef1f5fa38e2472fbf6a32cdf89/bytestructures/body/struct.scm#L109
+[5] https://github.com/TaylanUB/scheme-bytestructures/blob/a6d5d25b26c0c5ef1f5fa38e2472fbf6a32cdf89/bytestructures/body/struct.scm#L112
+[6] https://github.com/TaylanUB/scheme-bytestructures/blob/a6d5d25b26c0c5ef1f5fa38e2472fbf6a32cdf89/run-tests.body.scm#L194
+[7] https://github.com/TaylanUB/scheme-bytestructures/issues/47
+
+* * *
+
+Group begin: aligned
+Test begin:
+ test-name: "ref1"
+ source-file: "run-tests.body.scm"
+ source-line: 194
+ source-form: (test-eqv "ref1" 321 (bytestructure-ref bs (quote a)))
+Test end:
+ result-kind: pass
+ actual-value: 321
+ expected-value: 321
+Test begin:
+ test-name: "ref2"
+ source-file: "run-tests.body.scm"
+ source-line: 196
+ source-form: (test-eqv "ref2" 456 (bytestructure-ref bs (quote b)))
+Test end:
+ result-kind: pass
+ actual-value: 456
+ expected-value: 456
+Test begin:
+ test-name: "set1"
+ source-file: "run-tests.body.scm"
+ source-line: 197
+ source-form: (test-eqv "set1" 789 (begin (bytestructure-set! bs (quote a) 789) (bytestructure-ref bs (quote a))))
+Test end:
+ result-kind: pass
+ actual-value: 789
+ expected-value: 789
+Test begin:
+ test-name: "set2"
+ source-file: "run-tests.body.scm"
+ source-line: 199
+ source-form: (test-eqv "set2" 987 (begin (bytestructure-set! bs (quote b) 987) (bytestructure-ref bs (quote b))))
+Test end:
+ result-kind: pass
+ actual-value: 987
+ expected-value: 987
+Group end: aligned
+---
+ bytestructures/body/struct.scm | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/bytestructures/body/struct.scm b/bytestructures/body/struct.scm
+index 07797b5..0113a17 100644
+--- a/bytestructures/body/struct.scm
++++ b/bytestructures/body/struct.scm
+@@ -107,7 +107,6 @@
+ (let ((descriptor (cadr field-spec)))
+ (bytestructure-descriptor-size descriptor)))
+ (let* ((alignment (apply max (map field-spec-alignment field-specs)))
+- (alignment (pack-alignment pack alignment))
+ (size (apply max (map field-spec-size field-specs)))
+ (position (align position size (pack-alignment pack alignment))))
+ (let loop ((field-specs field-specs)
+--
+2.41.0
+
--
2.41.0
prev parent reply other threads:[~2024-06-07 13:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-25 20:51 [bug#54165] [PATCH] gnu: guile-bytestructures: Update to 2.0.1 Taylan Kammer
2022-03-01 11:38 ` Ludovic Courtès
2024-06-07 13:44 ` [bug#54165] [PATCH v2 1/2] " Felix Lechner via Guix-patches via
2024-08-20 19:11 ` [bug#54165] Update guile-bytestructures to 2.0.2 Vagrant Cascadian
2024-06-07 13:44 ` Felix Lechner via Guix-patches via [this message]
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=eff1f3146d51e82bbc6a2bc3c8e9e98aab6e82c7.1717767896.git.felix.lechner@lease-up.com \
--to=guix-patches@gnu.org \
--cc=54165@patchwise.org \
--cc=felix.lechner@lease-up.com \
--cc=ludo@gnu.org \
--cc=taylan.kammer@gmail.com \
/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).