[PATCH] gnu: guile-bytestructures: Update to 2.0.1.

  • Open
  • quality assurance status badge
Details
4 participants
  • Felix Lechner
  • Ludovic Courtès
  • Taylan Kammer
  • Vagrant Cascadian
Owner
unassigned
Submitted by
Taylan Kammer
Severity
normal
T
T
Taylan Kammer wrote on 25 Feb 2022 21:51
(address . guix-patches@gnu.org)
77e3dbeb-5d43-5450-075c-e74fccfff626@gmail.com
* gnu/packages/guile.scm (guile-bytestructures): Update to 2.0.1.

Although the major version number is increased due to a small API-breaking
change, all packages that depend on guile-bytestructures still build fine and
pass their test suite if they have one, so it should not be necessary to
create a bytestructures-2.0 package.

The breaking change is that bs:pointer would previously implicitly dereference
the pointer when any index other than '* was provided, whereas in this version
the dereference must be explicit, and can be '* or an integer that represents
an offset from the pointer address a la *(ptr + i) in C.
---
gnu/packages/guile.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index f74a389da5..1ac1690455 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -746,7 +746,7 @@ Guile's foreign function interface.")
(define-public guile-bytestructures
(package
(name "guile-bytestructures")
- (version "1.0.10")
+ (version "2.0.1")
(home-page "https://github.com/TaylanUB/scheme-bytestructures")
(source (origin
(method git-fetch)
@@ -756,7 +756,7 @@ Guile's foreign function interface.")
(file-name (git-file-name name version))
(sha256
(base32
- "14k50jln32kkxv41hvsdgjkkfj6xlv06vc1caz01qkgk1fzh72nk"))))
+ "1gnh3p2042cch1nkapl0p4pv20q7qs8cxvvbp7a5h1dwqbrkdyss"))))
(build-system gnu-build-system)
(arguments
`(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings
--
2.30.2
L
L
Ludovic Courtès wrote on 1 Mar 2022 12:38
(name . Taylan Kammer)(address . taylan.kammer@gmail.com)(address . 54165@debbugs.gnu.org)
87mti97vj9.fsf@gnu.org
Hi,

Taylan Kammer <taylan.kammer@gmail.com> skribis:

Toggle quote (12 lines)
> * gnu/packages/guile.scm (guile-bytestructures): Update to 2.0.1.
>
> Although the major version number is increased due to a small API-breaking
> change, all packages that depend on guile-bytestructures still build fine and
> pass their test suite if they have one, so it should not be necessary to
> create a bytestructures-2.0 package.
>
> The breaking change is that bs:pointer would previously implicitly dereference
> the pointer when any index other than '* was provided, whereas in this version
> the dereference must be explicit, and can be '* or an integer that represents
> an offset from the pointer address a la *(ptr + i) in C.

Since it’s an indirect dependency of Guix, I tested a bit more
thoroughly than for other packages.

While running this:

./pre-inst-env guix build guile-git -s x86_64-linux -s i686-linux -s armhf-linux -s aarch64-linux

I got this test failure on i686-linux:

Toggle snippet (34 lines)
starting phase `check'
./pre-inst-env \
/gnu/store/pihshjqc5x3k8yhdp1nvkgwiifyxin4v-guile-3.0.7/bin/guile --no-auto-compile \
./run-tests.guile.scm
Backtrace:
7 (primitive-load "/tmp/guix-build-guile-bytestructures-2…")
In ice-9/eval.scm:
619:8 6 (_ #f)
In ice-9/boot-9.scm:
142:2 5 (dynamic-wind #<procedure 8fca850 at ice-9/eval.scm:33…> …)
142:2 4 (dynamic-wind #<procedure 883d3b0 at ice-9/eval.scm:33…> …)
In ice-9/eval.scm:
619:8 3 (_ #(#(#<directory (guile-user) 8194690>)))
In ice-9/boot-9.scm:
142:2 2 (dynamic-wind #<procedure 8845110 at ice-9/eval.scm:33…> …)
In ice-9/eval.scm:
619:8 1 (_ #(#(#(#<directory (guile-user) 8194690>)) #<variab…>))
In unknown file:
0 (bytevector-u64-native-set! #vu8(0 0 0 0 0 0 0 0 65 1 …) …)

ERROR: In procedure bytevector-u64-native-set!:
In procedure bytevector-u64-native-set!: Value out of range: 8
%%%% Starting test bytestructures (Writing full log to "bytestructures.log")
run-tests.body.scm:194: FAIL ref1
make: *** [Makefile:779: check] Error 1

Test suite failed, dumping logs.
error: in phase 'check': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("check" "-j" "8" "GUILE_AUTO_COMPILE=0") exit-status: 2 term-signal: #f stop-signal: #f>
phase `check' failed after 1.1 seconds
command "make" "check" "-j" "8" "GUILE_AUTO_COMPILE=0" failed with status 2
builder for `/gnu/store/xkbc6a6jlg9r1lkma6zw8lfmprfsfkqw-guile-bytestructures-2.0.1.drv' failed with exit code 1

With:

./pre-inst-env guix build -v1 guile-drmaa nyacc nyacc@1.00 guile-lzma

I got this nyacc test failure:

Toggle snippet (47 lines)
GUILE_LOAD_PATH=/tmp/guix-build-nyacc-1.00.2.drv-0/nyacc-1.00.2/module GUILE_LOAD_COMPILED_PATH=/tmp/guix-build-nyacc-1.00.2.drv-0/nyacc-1.00.2/module \
/tmp/guix-build-nyacc-1.00.2.drv-0/nyacc-1.00.2/etc/guild compile -o system/ffi-help-rt.go system/ffi-help-rt.scm
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;; or pass the --no-auto-compile argument to disable.
;;; compiling /tmp/guix-build-nyacc-1.00.2.drv-0/nyacc-1.00.2/etc/guild
;;; WARNING: compilation of /tmp/guix-build-nyacc-1.00.2.drv-0/nyacc-1.00.2/etc/guild failed:
;;; failed to create path for auto-compiled file "/tmp/guix-build-nyacc-1.00.2.drv-0/nyacc-1.00.2/etc/guild"
Backtrace:
In system/base/target.scm:
65:6 19 (with-target _ _)
In system/base/compile.scm:
187:6 18 (compile-file "system/ffi-help-rt.scm" #:output-file _ # …)
53:4 17 (call-with-output-file/atomic _ _ _)
In ice-9/boot-9.scm:
1752:10 16 (with-exception-handler _ _ #:unwind? _ # _)
In system/base/compile.scm:
69:11 15 (_)
190:11 14 (_ #<closed: file 7fffedfe4150>)
331:39 13 (read-and-compile #<input: system/ffi-help-rt.scm 15> # …)
261:27 12 (_ _ _)
In ice-9/boot-9.scm:
2835:4 11 (save-module-excursion #<procedure 7fffee7e3c00 at lang…>)
In language/scheme/compile-tree-il.scm:
31:15 10 (_)
In ice-9/psyntax.scm:
1230:36 9 (expand-top-sequence (#<syntax:ffi-help-rt.scm:20:0 (…>) …)
1222:19 8 (parse _ (("placeholder" placeholder)) ((top) #(# # …)) …)
259:10 7 (parse _ (("placeholder" placeholder)) (()) _ c&e (# #) #)
In ice-9/eval.scm:
293:34 6 (_ #<module (#{ g100}#) 7fffee85c280>)
In ice-9/boot-9.scm:
3409:4 5 (define-module* _ #:filename _ #:pure _ #:version _ # _ …)
2594:24 4 (call-with-deferred-observers #<procedure 7fffefc7b1e0 …>)
3422:24 3 (_)
222:17 2 (map1 (((bytestructures guile)) ((bytestructures # …)) …))
3329:6 1 (resolve-interface (bytestructures guile) #:select _ # _ …)
1685:16 0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
no code for module (bytestructures guile)
make[1]: *** [Makefile:93: system/ffi-help-rt.go] Error 1

[…]

@ build-failed /gnu/store/qsnsix75inib689w6yr7a335xch13wk0-nyacc-1.00.2.drv - 1 builder for `/gnu/store/qsnsix75inib689w6yr7a335xch13wk0-nyacc-1.00.2.drv' failed with exit code 1

Could you take a look?

Thanks,
Ludo’.
F
F
Felix Lechner wrote on 7 Jun 15:44 +0200
[PATCH v2 1/2] gnu: guile-bytestructures: Update to 2.0.1.
(address . 54165@patchwise.org)
c48b47ba696a8068fda077c9a8e2a167bc21c677.1717767896.git.felix.lechner@lease-up.com
From: Taylan Kammer <taylan.kammer@gmail.com>

* gnu/packages/guile.scm (guile-bytestructures): Update to 2.0.1.

Although the major version number is increased due to a small API-breaking
change, all packages that depend on guile-bytestructures still build fine and
pass their test suite if they have one, so it should not be necessary to
create a bytestructures-2.0 package.

The breaking change is that bs:pointer would previously implicitly dereference
the pointer when any index other than '* was provided, whereas in this version
the dereference must be explicit, and can be '* or an integer that represents
an offset from the pointer address a la *(ptr + i) in C.
---
gnu/packages/guile.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index e8705dc7d2..0bbd4a12ad 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -786,7 +786,7 @@ (define-public guile2.2-sqlite3
(define-public guile-bytestructures
(package
(name "guile-bytestructures")
- (version "1.0.10")
+ (version "2.0.1")
(home-page "https://github.com/TaylanUB/scheme-bytestructures")
(source (origin
(method git-fetch)
@@ -796,7 +796,7 @@ (define-public guile-bytestructures
(file-name (git-file-name name version))
(sha256
(base32
- "14k50jln32kkxv41hvsdgjkkfj6xlv06vc1caz01qkgk1fzh72nk"))))
+ "1gnh3p2042cch1nkapl0p4pv20q7qs8cxvvbp7a5h1dwqbrkdyss"))))
(build-system gnu-build-system)
(arguments
`(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings

base-commit: 580d77d0fb12448ef1621699cc0c56e787e2aadb
--
2.41.0
F
F
Felix Lechner wrote on 7 Jun 15:44 +0200
[PATCH v2 2/2] gnu: guile-bytestructures: add patch. (Closes: #54165)
(address . 54165@patchwise.org)
eff1f3146d51e82bbc6a2bc3c8e9e98aab6e82c7.1717767896.git.felix.lechner@lease-up.com
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..


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

Toggle diff (114 lines)
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
V
V
Vagrant Cascadian wrote on 20 Aug 21:11 +0200
Update guile-bytestructures to 2.0.2.
(address . 54165@debbugs.gnu.org)
87seuzj9fx.fsf@wireframe
The attached patch updates to guile-bytestructures 2.0.2.

I am not sure if the other previously suggested changes are still
needed; I did successfully build most of the packages listed by "guix
refresh --list-dependent" other than guix-jupyter... though I only
tested on x86_64. Hopefully QA picks this up and gives us better
information.

FWIW, the updated guile-bytestructures seems to work fine in Debian. :)

live well,
vagrant
From 56dd4f2f1635c450bd62138c9c0e92f77427576f Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
Date: Tue, 20 Aug 2024 11:57:29 -0700
Subject: [PATCH] gnu: guile-bytestructures: Update to 2.0.2.

* gnu/packages/guile.scm (guile-bytestructures): Update to 2.0.2.
[source]: Adjust tag used to fetch git commit.
---
gnu/packages/guile.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (29 lines)
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index e8705dc7d2..581f188dbe 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -786,17 +786,17 @@ (define-public guile2.2-sqlite3
(define-public guile-bytestructures
(package
(name "guile-bytestructures")
- (version "1.0.10")
+ (version "2.0.2")
(home-page "https://github.com/TaylanUB/scheme-bytestructures")
(source (origin
(method git-fetch)
(uri (git-reference
(url home-page)
- (commit version)))
+ (commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
- "14k50jln32kkxv41hvsdgjkkfj6xlv06vc1caz01qkgk1fzh72nk"))))
+ "1dyhf39s16q3fvps0mfb65xrlcb8rk8m5kc82ngkwhzmf1svalpc"))))
(build-system gnu-build-system)
(arguments
`(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings

base-commit: bef48dd553aef3c8fb3bc48143739debb629c825
--
2.39.2
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCZsTqcgAKCRDcUY/If5cW
qpHsAP9vKW9R94ZSIeHxDpBN5Rao9Vqip+8SpAUO1hImmfHcwwD+NPYJPNhY+uP6
hg6eBypEOL7QPtQE+leNE43kmzO69A8=
=9F/9
-----END PGP SIGNATURE-----

?
Your comment

Commenting via the web interface is currently disabled.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 54165
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