GNU bug report logs - #45299
[PATCH] maint: Require Guile >= 2.2.6.

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Thu, 17 Dec 2020 15:34:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 45299 in the body.
You can then email your comments to 45299 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#45299; Package guix-patches. (Thu, 17 Dec 2020 15:34:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 17 Dec 2020 15:34:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH] maint: Require Guile >= 2.2.6.
Date: Thu, 17 Dec 2020 16:33:00 +0100
* configure.ac: For Guile 2.2, require 2.2.6 or later.
* guix/gexp.scm (define-syntax-parameter-once): Remove.
Use 'define-syntax-parameter' instead.
* guix/mnoads.scm: Likewise.
* guix/inferior.scm (proxy)[select*]: Remove.
* guix/scripts/publish.scm <top level>: Remove replacement for (@@ (web
http) read-header-line).
* guix/store/deduplication.scm (counting-wrapper-port): Remove.
(nar-sha256): Call 'port-position' on PORT to compute SIZE.
---
 configure.ac                 |  2 +-
 guix/gexp.scm                | 15 ++-------------
 guix/inferior.scm            | 11 +----------
 guix/monads.scm              | 15 ++-------------
 guix/scripts/publish.scm     | 26 --------------------------
 guix/store/deduplication.scm | 32 ++++----------------------------
 6 files changed, 10 insertions(+), 91 deletions(-)

diff --git a/configure.ac b/configure.ac
index a5bdf24e93..afb449950f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,7 +102,7 @@ if test "x$GUILD" = "x"; then
 fi
 
 if test "x$GUILE_EFFECTIVE_VERSION" = "x2.2"; then
-  PKG_CHECK_MODULES([GUILE], [guile-2.2 >= 2.2.3])
+  PKG_CHECK_MODULES([GUILE], [guile-2.2 >= 2.2.6])
 fi
 
 dnl Get CFLAGS and LDFLAGS for libguile.
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 051831238e..764c89a187 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1317,18 +1317,7 @@ and in the current monad setting (system type, etc.)"
                    reference->sexp (gexp-references exp))))
     (return (apply (gexp-proc exp) args))))
 
-(define-syntax-rule (define-syntax-parameter-once name proc)
-  ;; Like 'define-syntax-parameter' but ensure the top-level binding for NAME
-  ;; does not get redefined.  This works around a race condition in a
-  ;; multi-threaded context with Guile <= 2.2.4: <https://bugs.gnu.org/27476>.
-  (eval-when (load eval expand compile)
-    (define name
-      (if (module-locally-bound? (current-module) 'name)
-          (module-ref (current-module) 'name)
-          (make-syntax-transformer 'name 'syntax-parameter
-                                   (list proc))))))
-
-(define-syntax-parameter-once current-imported-modules
+(define-syntax-parameter current-imported-modules
   ;; Current list of imported modules.
   (identifier-syntax '()))
 
@@ -1339,7 +1328,7 @@ environment."
                          (identifier-syntax modules)))
     body ...))
 
-(define-syntax-parameter-once current-imported-extensions
+(define-syntax-parameter current-imported-extensions
   ;; Current list of extensions.
   (identifier-syntax '()))
 
diff --git a/guix/inferior.scm b/guix/inferior.scm
index 77820872b3..2fe91beaab 100644
--- a/guix/inferior.scm
+++ b/guix/inferior.scm
@@ -469,22 +469,13 @@ is similar to the sexp returned by 'package-provenance' for regular packages."
   "Proxy communication between CLIENT and BACKEND until CLIENT closes the
 connection, at which point CLIENT is closed (both CLIENT and BACKEND must be
 input/output ports.)"
-  (define (select* read write except)
-    ;; This is a workaround for <https://bugs.gnu.org/30365> in Guile < 2.2.4:
-    ;; since 'select' sometimes returns non-empty sets for no good reason,
-    ;; call 'select' a second time with a zero timeout to filter out incorrect
-    ;; replies.
-    (match (select read write except)
-      ((read write except)
-       (select read write except 0))))
-
   ;; Use buffered ports so that 'get-bytevector-some' returns up to the
   ;; whole buffer like read(2) would--see <https://bugs.gnu.org/30066>.
   (setvbuf client 'block 65536)
   (setvbuf backend 'block 65536)
 
   (let loop ()
-    (match (select* (list client backend) '() '())
+    (match (select (list client backend) '() '())
       ((reads () ())
        (when (memq client reads)
          (match (get-bytevector-some client)
diff --git a/guix/monads.scm b/guix/monads.scm
index 6924471345..6ae616aca9 100644
--- a/guix/monads.scm
+++ b/guix/monads.scm
@@ -274,23 +274,12 @@ more optimizations."
                    (_
                     #'generic-name))))))))))
 
-(define-syntax-rule (define-syntax-parameter-once name proc)
-  ;; Like 'define-syntax-parameter' but ensure the top-level binding for NAME
-  ;; does not get redefined.  This works around a race condition in a
-  ;; multi-threaded context with Guile <= 2.2.4: <https://bugs.gnu.org/27476>.
-  (eval-when (load eval expand compile)
-    (define name
-      (if (module-locally-bound? (current-module) 'name)
-          (module-ref (current-module) 'name)
-          (make-syntax-transformer 'name 'syntax-parameter
-                                   (list proc))))))
-
-(define-syntax-parameter-once >>=
+(define-syntax-parameter >>=
   ;; The name 'bind' is already taken, so we choose this (obscure) symbol.
   (lambda (s)
     (syntax-violation '>>= ">>= (bind) used outside of 'with-monad'" s)))
 
-(define-syntax-parameter-once return
+(define-syntax-parameter return
   (lambda (s)
     (syntax-violation 'return "return used outside of 'with-monad'" s)))
 
diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm
index c31cef3181..5a865c838d 100644
--- a/guix/scripts/publish.scm
+++ b/guix/scripts/publish.scm
@@ -824,32 +824,6 @@ example: \"/foo/bar\" yields '(\"foo\" \"bar\")."
 (define %http-write
   (@@ (web server http) http-write))
 
-(match (list (major-version) (minor-version) (micro-version))
-  (("2" "2" "5")                                  ;Guile 2.2.5
-   (let ()
-     (define %read-line (@ (ice-9 rdelim) %read-line))
-     (define bad-header (@@ (web http) bad-header))
-
-     ;; XXX: Work around <https://bugs.gnu.org/36350> by reverting to the
-     ;; definition of 'read-header-line' as found in 2.2.4 and earlier.
-     (define (read-header-line port)
-       "Read an HTTP header line and return it without its final CRLF or LF.
-Raise a 'bad-header' exception if the line does not end in CRLF or LF,
-or if EOF is reached."
-       (match (%read-line port)
-         (((? string? line) . #\newline)
-          ;; '%read-line' does not consider #\return a delimiter; so if it's
-          ;; there, remove it.  We are more tolerant than the RFC in that we
-          ;; tolerate LF-only endings.
-          (if (string-suffix? "\r" line)
-              (string-drop-right line 1)
-              line))
-         ((line . _)                              ;EOF or missing delimiter
-          (bad-header 'read-header-line line))))
-
-     (set! (@@ (web http) read-header-line) read-header-line)))
-  (_ #t))
-
 (define (strip-headers response)
   "Return RESPONSE's headers minus 'Content-Length' and our internal headers."
   (fold alist-delete
diff --git a/guix/store/deduplication.scm b/guix/store/deduplication.scm
index a72a43bf79..cd9660174c 100644
--- a/guix/store/deduplication.scm
+++ b/guix/store/deduplication.scm
@@ -37,38 +37,14 @@
             dump-file/deduplicate
             copy-file/deduplicate))
 
-;; XXX: This port is used as a workaround on Guile <= 2.2.4 where
-;; 'port-position' throws to 'out-of-range' when the offset is great than or
-;; equal to 2^32: <https://bugs.gnu.org/32161>.
-(define (counting-wrapper-port output-port)
-  "Return two values: an output port that wraps OUTPUT-PORT, and a thunk to
-retrieve the number of bytes written to OUTPUT-PORT."
-  (let ((byte-count 0))
-    (values (make-custom-binary-output-port "counting-wrapper"
-                                            (lambda (bytes offset count)
-                                              (put-bytevector output-port bytes
-                                                              offset count)
-                                              (set! byte-count
-                                                (+ byte-count count))
-                                              count)
-                                            (lambda ()
-                                              byte-count)
-                                            #f
-                                            (lambda ()
-                                              (close-port output-port)))
-            (lambda ()
-              byte-count))))
-
 (define (nar-sha256 file)
   "Gives the sha256 hash of a file and the size of the file in nar form."
-  (let*-values (((port get-hash) (open-sha256-port))
-                ((wrapper get-size) (counting-wrapper-port port)))
-    (write-file file wrapper)
-    (force-output wrapper)
+  (let-values (((port get-hash) (open-sha256-port)))
+    (write-file file port)
     (force-output port)
     (let ((hash (get-hash))
-          (size (get-size)))
-      (close-port wrapper)
+          (size (port-position port)))
+      (close-port port)
       (values hash size))))
 
 (define (tempname-in directory)
-- 
2.29.2





Information forwarded to guix-patches <at> gnu.org:
bug#45299; Package guix-patches. (Thu, 17 Dec 2020 20:17:02 GMT) Full text and rfc822 format available.

Message #8 received at 45299 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 45299 <at> debbugs.gnu.org
Subject: Re: [bug#45299] [PATCH] maint: Require Guile >= 2.2.6.
Date: Thu, 17 Dec 2020 22:16:36 +0200
[Message part 1 (text/plain, inline)]
Debian 10 (the current release) has guile-2.2.4

(ins)efraim <at> E5400 ~$ ssh do1 apt-cache policy guile-2.2
guile-2.2:
  Installed: (none)
  Candidate: 2.2.4+1-2+deb10u1
  Version table:
     2.2.7+1-5.4 200
        200 http://deb.debian.org/debian sid/main amd64 Packages
     2.2.4+1-2+deb10u1 500
        500 http://mirrors.digitalocean.com/debian buster/main amd64 Packages
        500 http://deb.debian.org/debian buster/main amd64 Packages

guile-3 is currently in unstable

(ins)efraim <at> E5400 ~$ ssh do1 apt-cache policy guile-3.0
guile-3.0:
  Installed: (none)
  Candidate: 3.0.4-3
  Version table:
     3.0.4-3 200
        200 http://deb.debian.org/debian sid/main amd64 Packages

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#45299; Package guix-patches. (Fri, 18 Dec 2020 14:52:01 GMT) Full text and rfc822 format available.

Message #11 received at 45299 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 45299 <at> debbugs.gnu.org
Subject: Re: [bug#45299] [PATCH] maint: Require Guile >= 2.2.6.
Date: Fri, 18 Dec 2020 15:51:39 +0100
Hi Efraim,

Efraim Flashner <efraim <at> flashner.co.il> skribis:

> Debian 10 (the current release) has guile-2.2.4

Hmm OK.  Should it hold us back, though?

2.2.6 was released in June 2019.  Also, I expect most users to either
use Vagrant’s brand new ‘guix’ package or to use our binary tarball.

Thoughts?

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#45299; Package guix-patches. (Fri, 18 Dec 2020 21:07:01 GMT) Full text and rfc822 format available.

Message #14 received at 45299 <at> debbugs.gnu.org (full text, mbox):

From: Vagrant Cascadian <vagrant <at> debian.org>
To: Ludovic Courtès <ludo <at> gnu.org>, Efraim Flashner
 <efraim <at> flashner.co.il>
Cc: 45299 <at> debbugs.gnu.org
Subject: Re: [bug#45299] [PATCH] maint: Require Guile >= 2.2.6.
Date: Fri, 18 Dec 2020 13:06:46 -0800
[Message part 1 (text/plain, inline)]
On 2020-12-18, Ludovic Courtès wrote:
> Efraim Flashner <efraim <at> flashner.co.il> skribis:
>
>> Debian 10 (the current release) has guile-2.2.4

> Hmm OK.  Should it hold us back, though?

Debian 10 doesn't have many of the guile-* build dependencies, so I
would not recommend the current Debian stable release block bumping the
minimum guile 2.2 version for guix...


> 2.2.6 was released in June 2019.

Debian bullseye (the testing branch) currently has guile-2.2 at 2.2.7:

  https://tracker.debian.org/pkg/guile-2.2

Debian bullseye is likely to become Debian stable mid-2021, starting to
freeze in early 2021.

It should have all the dependencies for building guix against guile-2.2,
and *almost* all for building guix against guile-3.0...


> Also, I expect most users to either use Vagrant’s brand new ‘guix’
> package or to use our binary tarball.

The guix package may not make it out of Debian experimental any time
soon... unless I switch it to use guile-2.2 (and track down the
corresponding test suite failures) or the guile-gnutls test suite issues
with guile-3.0 get fixed.


live well,
  vagrant
[signature.asc (application/pgp-signature, inline)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sat, 19 Dec 2020 23:05:04 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Sat, 19 Dec 2020 23:05:04 GMT) Full text and rfc822 format available.

Message #19 received at 45299-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vagrant Cascadian <vagrant <at> debian.org>
Cc: 45299-done <at> debbugs.gnu.org, Efraim Flashner <efraim <at> flashner.co.il>
Subject: Re: [bug#45299] [PATCH] maint: Require Guile >= 2.2.6.
Date: Sun, 20 Dec 2020 00:04:05 +0100
Hi,

Vagrant Cascadian <vagrant <at> debian.org> skribis:

> On 2020-12-18, Ludovic Courtès wrote:
>> Efraim Flashner <efraim <at> flashner.co.il> skribis:
>>
>>> Debian 10 (the current release) has guile-2.2.4
>
>> Hmm OK.  Should it hold us back, though?
>
> Debian 10 doesn't have many of the guile-* build dependencies, so I
> would not recommend the current Debian stable release block bumping the
> minimum guile 2.2 version for guix...

Alright.  Pushed as 4f621a2b003e85d480999e4d0630e9dc3de85bc3!

> The guix package may not make it out of Debian experimental any time
> soon... unless I switch it to use guile-2.2 (and track down the
> corresponding test suite failures) or the guile-gnutls test suite issues
> with guile-3.0 get fixed.

Noted, I should keep investigating.

Thanks for your feedback!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 17 Jan 2021 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 155 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.