gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 161/324: guix: Patch 'guile' to fix some bugs.


From: gnunet
Subject: [gnunet-scheme] 161/324: guix: Patch 'guile' to fix some bugs.
Date: Tue, 21 Sep 2021 13:23:21 +0200

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit 7a09b03c7c6b9739a76a549a784cc25ffdbb70d5
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Tue Jul 20 13:33:39 2021 +0200

    guix: Patch 'guile' to fix some bugs.
    
    These patches are not yet merged upstream.
    
    * guix.scm (guile-3.0/fixed): New variable.
    * 0001-Fix-non-revealed-port-is-closed-ports.test.patch: New patch.
    * 0001-Fix-non-revealed-port-is-closed-ports.test.patch: New patch.
    * 0001-ice-9-read-Parse-properly.patch: Likewise.
    * guix.scm (scheme-gnunet): Use fixed guile.
    * README.org: Note "guix.scm" has a fixed Guile.
---
 ...ix-non-revealed-port-is-closed-ports.test.patch | 35 +++++++++++++
 0001-ice-9-read-Parse-properly.patch               | 59 ++++++++++++++++++++++
 README.org                                         |  3 ++
 guix.scm                                           | 14 ++++-
 4 files changed, 109 insertions(+), 2 deletions(-)

diff --git a/0001-Fix-non-revealed-port-is-closed-ports.test.patch 
b/0001-Fix-non-revealed-port-is-closed-ports.test.patch
new file mode 100644
index 0000000..0a1798e
--- /dev/null
+++ b/0001-Fix-non-revealed-port-is-closed-ports.test.patch
@@ -0,0 +1,35 @@
+From ac8dc55ebbd43306eb54989f096a6814dadda974 Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Sat, 19 Sep 2020 14:09:04 -0500
+Subject: [PATCH] Fix "non-revealed port is closed" ports.test
+
+Don't close the test port's file descriptor because the port still has a
+reference to it, and could still close it at any time when finally
+garbage collected.  This did soemetimes break subsequent tests.
+
+Bug: https://debbugs.gnu.org/43521
+---
+ test-suite/tests/ports.test | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test
+index 31fb2b0a8..9dca62df8 100644
+--- a/test-suite/tests/ports.test
++++ b/test-suite/tests/ports.test
+@@ -623,9 +623,10 @@
+         (seek fdes 0 SEEK_CUR)
+ 
+         ;; If we get here, it might be because PORT was not GC'd, we
+-        ;; don't know (and we can't use a guardian because it would keep
+-        ;; PORT alive.)
+-        (close-fdes fdes)
++        ;; don't know, and we can't use a guardian because it would keep
++        ;; PORT alive, and we can't close the descriptor because
++        ;; subseuqent opens may re-use it, and then if this port is
++        ;; garbage collected, it'll close the descriptor unexpectedly.
+         (throw 'unresolved))
+       (lambda args
+         (system-error-errno args)))))
+-- 
+2.32.0
+
diff --git a/0001-ice-9-read-Parse-properly.patch 
b/0001-ice-9-read-Parse-properly.patch
new file mode 100644
index 0000000..2ff1c7d
--- /dev/null
+++ b/0001-ice-9-read-Parse-properly.patch
@@ -0,0 +1,59 @@
+From 40b0b29c05d521cd8901988fa2bc71547f917f48 Mon Sep 17 00:00:00 2001
+From: Maxime Devos <maximedevos@telenet.be>
+Date: Sun, 18 Jul 2021 19:59:32 +0200
+Subject: [PATCH] ice-9/read: Parse #{}}# properly.
+
+This is a regression since Guile 3.0.2 and breaks compilation
+of a Guile library.
+
+* module/ice-9/read.scm
+  (%read)[read-parenthesized]: When SAW-BRACE? is #t but CH isn't
+  #\#, don't eat CH.
+* test-suite/tests/reader.test
+  ("#{}#): Add four test cases.
+---
+ module/ice-9/read.scm        | 7 +++++--
+ test-suite/tests/reader.test | 5 +++++
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/module/ice-9/read.scm b/module/ice-9/read.scm
+index ac407739f..283933064 100644
+--- a/module/ice-9/read.scm
++++ b/module/ice-9/read.scm
+@@ -556,12 +556,15 @@
+     (string->symbol
+      (list->string
+       (let lp ((saw-brace? #f))
+-        (let ((ch (next-not-eof)))
++        (let lp/inner ((ch (next-not-eof))
++                       (saw-brace? saw-brace?))
+           (cond
+            (saw-brace?
+             (if (eqv? ch #\#)
+                 '()
+-                (cons #\} (lp #f))))
++                ;; Don't eat CH, see
++                ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49623>.
++                (cons #\} (lp/inner ch #f))))
+            ((eqv? ch #\})
+             (lp #t))
+            ((eqv? ch #\\)
+diff --git a/test-suite/tests/reader.test b/test-suite/tests/reader.test
+index 1481a0a5d..ad7c6d575 100644
+--- a/test-suite/tests/reader.test
++++ b/test-suite/tests/reader.test
+@@ -536,6 +536,11 @@
+ 
+ (with-test-prefix "#{}#"
+   (pass-if (equal? (read-string "#{}#") '#{}#))
++  ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49623>
++  (pass-if (equal? (read-string "#{}}#") (string->symbol "}")))
++  (pass-if (equal? (read-string "#{}}}#") (string->symbol "}}")))
++  (pass-if (equal? (read-string "#{{}}#") (string->symbol "{}")))
++  (pass-if (equal? (read-string "#{{}b}#") (string->symbol "{}b")))
+   (pass-if (not (equal? (read-string "(a #{.}# b)") '(a . b))))
+   (pass-if (equal? (read-string "#{a}#") 'a))
+   (pass-if (equal? (read-string "#{a b}#") '#{a b}#))
+-- 
+2.32.0
+
diff --git a/README.org b/README.org
index 181e9ef..1b00ed3 100644
--- a/README.org
+++ b/README.org
@@ -27,6 +27,9 @@
   version of Guile (e.g. Guile 3.0.2 is known to work)
   or apply the patch from 
[[https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49623][bug #49623]].
 
+  "guix.scm" has a variable guile-3.0/fixed with the required
+  patches applied.
+
 * things that work
   TODO: test suite for download & publish.
   TODO (elsewhere): GNUnet service definitions for Guix in container
diff --git a/guix.scm b/guix.scm
index c9291cf..4cdff7f 100644
--- a/guix.scm
+++ b/guix.scm
@@ -26,6 +26,7 @@
             (gnu packages gettext)
             (gnu packages pkg-config)
             (guix packages)
+            (guix gexp)
             (guix download)
             (guix build-system gnu)
             ((guix licenses) #:prefix license:))
@@ -57,6 +58,15 @@ with specifications for its inputs) and test it by 
generating many
 random inputs and seeing if it holds.")
     (license license:gpl3+)))
 
+(define guile-3.0/fixed
+  (package
+    (inherit guile-3.0-latest)
+    (source
+     (origin
+       (inherit (package-source guile-3.0-latest))
+       (patches (list (local-file 
"0001-Fix-non-revealed-port-is-closed-ports.test.patch")
+                     (local-file "0001-ice-9-read-Parse-properly.patch")))))))
+
 (define-public scheme-gnunet
   (package
    (name "scheme-gnunet")
@@ -67,7 +77,7 @@ random inputs and seeing if it holds.")
                        ("guile-bytestructures" ,guile-bytestructures)
                        ("guile-fibers" ,guile-fibers)
                        ("guile-json" ,guile-json-4)))
-   (native-inputs `(("guile" ,guile-3.0)
+   (native-inputs `(("guile" ,guile-3.0/fixed)
                    ("automake" ,automake)
                    ;; Only used for testing.
                    ("guile-quickcheck" ,guile-quickcheck)
@@ -75,7 +85,7 @@ random inputs and seeing if it holds.")
                    ("gettext" ,gettext-minimal)
                    ("pkg-config" ,pkg-config)
                    ("autoconf" ,autoconf-wrapper)))
-   (inputs `(("guile" ,guile-3.0)))
+   (inputs `(("guile" ,guile-3.0/fixed)))
    (synopsis "partial Scheme port of GNUnet")
    (license license:agpl3+)
    (description #f)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]