build: Require Guile >= 2.0.9.

* configure.ac: Bump requirement to 2.0.9.
* doc/guix.texi (Requirements): Adjust accordingly.
* README (Requirements): Likewise.
* build-aux/download.scm: Remove workaround for <http://bugs.gnu.org/13095>.
* guix/build/download.scm: Likewise.
(http-fetch)[post-2.0.7?]: Remove.  Remove conditional code for not
POST-2.0.7?.
* guix/http-client.scm:  Remove workaround for <http://bugs.gnu.org/13095>.
(http-fetch)[post-2.0.7?]: Remove.  Remove conditional code for not
POST-2.0.7?.
* guix/serialization.scm (read-latin1-string): Remove mention of 2.0.9.
* tests/nar.scm: Use (ice-9 control).
(let/ec): Remove.
This commit is contained in:
Ludovic Courtès 2017-03-17 23:07:01 +01:00
parent 5461115e8f
commit 36626c556e
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
8 changed files with 11 additions and 59 deletions

2
README
View File

@ -20,7 +20,7 @@ Guix is based on the [[http://nixos.org/nix/][Nix]] package manager.
GNU Guix currently depends on the following packages: GNU Guix currently depends on the following packages:
- [[http://gnu.org/software/guile/][GNU Guile 2.0.x]], version 2.0.7 or later - [[http://gnu.org/software/guile/][GNU Guile 2.2.x or 2.0.x]], version 2.0.9 or later
- [[http://gnupg.org/][GNU libgcrypt]] - [[http://gnupg.org/][GNU libgcrypt]]
- [[http://www.gnu.org/software/make/][GNU Make]] - [[http://www.gnu.org/software/make/][GNU Make]]
- optionally [[http://savannah.nongnu.org/projects/guile-json/][Guile-JSON]], for the 'guix import pypi' command - optionally [[http://savannah.nongnu.org/projects/guile-json/][Guile-JSON]], for the 'guix import pypi' command

View File

@ -36,11 +36,6 @@
;;"http://www.fdn.fr/~lcourtes/software/guix/packages" ;;"http://www.fdn.fr/~lcourtes/software/guix/packages"
) )
;; XXX: Work around <http://bugs.gnu.org/13095>, present in Guile
;; up to 2.0.7.
(module-define! (resolve-module '(web client))
'shutdown (const #f))
(define (file-name->uri file) (define (file-name->uri file)
"Return the URI for FILE." "Return the URI for FILE."
(match (string-tokenize file (char-set-complement (char-set #\/))) (match (string-tokenize file (char-set-complement (char-set #\/)))

View File

@ -82,7 +82,7 @@ if test "x$GUILD" = "x"; then
fi fi
if test "x$GUILE_EFFECTIVE_VERSION" = "x2.0"; then if test "x$GUILE_EFFECTIVE_VERSION" = "x2.0"; then
PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.7]) PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.9])
fi fi
dnl Installation directory for .scm and .go files. dnl Installation directory for .scm and .go files.

View File

@ -552,7 +552,7 @@ in the Guix source tree for additional details.
GNU Guix depends on the following packages: GNU Guix depends on the following packages:
@itemize @itemize
@item @url{http://gnu.org/software/guile/, GNU Guile}, version 2.0.7 or @item @url{http://gnu.org/software/guile/, GNU Guile}, version 2.0.9 or
later, including 2.2.x; later, including 2.2.x;
@item @url{http://gnupg.org/, GNU libgcrypt}; @item @url{http://gnupg.org/, GNU libgcrypt};
@item @item

View File

@ -512,12 +512,6 @@ port if PORT is a TLS session record port."
'set-port-encoding! 'set-port-encoding!
(lambda (p e) #f)) (lambda (p e) #f))
;; XXX: Work around <http://bugs.gnu.org/13095>, present in Guile
;; up to 2.0.7.
(module-define! (resolve-module '(web client))
'shutdown (const #f))
;; XXX: Work around <http://bugs.gnu.org/23421>, fixed in Guile commit ;; XXX: Work around <http://bugs.gnu.org/23421>, fixed in Guile commit
;; 16050431f29d56f80c4a8253506fc851b8441840. Guile's date validation ;; 16050431f29d56f80c4a8253506fc851b8441840. Guile's date validation
;; procedure rejects dates in which the hour is not padded with a zero but ;; procedure rejects dates in which the hour is not padded with a zero but
@ -682,12 +676,6 @@ the connection could not be established in less than TIMEOUT seconds. Return
FILE on success. When VERIFY-CERTIFICATE? is true, verify HTTPS FILE on success. When VERIFY-CERTIFICATE? is true, verify HTTPS
certificates; otherwise simply ignore them." certificates; otherwise simply ignore them."
(define post-2.0.7?
(or (> (string->number (major-version)) 2)
(> (string->number (minor-version)) 0)
(> (string->number (micro-version)) 7)
(string>? (version) "2.0.7")))
(define headers (define headers
`(;; Some web sites, such as http://dist.schmorp.de, would block you if `(;; Some web sites, such as http://dist.schmorp.de, would block you if
;; there's no 'User-Agent' header, presumably on the assumption that ;; there's no 'User-Agent' header, presumably on the assumption that
@ -712,20 +700,9 @@ certificates; otherwise simply ignore them."
#:verify-certificate? #:verify-certificate?
verify-certificate?)) verify-certificate?))
((resp bv-or-port) ((resp bv-or-port)
;; XXX: `http-get*' was introduced in 2.0.7, and replaced by (http-get uri #:port connection #:decode-body? #f
;; #:streaming? in 2.0.8. We know we're using it within the #:streaming? #t
;; chroot, but `guix-download' might be using a different #:headers headers))
;; version. So keep this compatibility hack for now.
(if post-2.0.7?
(http-get uri #:port connection #:decode-body? #f
#:streaming? #t
#:headers headers)
(if (module-defined? (resolve-interface '(web client))
'http-get*)
(http-get* uri #:port connection #:decode-body? #f
#:headers headers)
(http-get uri #:port connection #:decode-body? #f
#:extra-headers headers))))
((code) ((code)
(response-code resp)) (response-code resp))
((size) ((size)

View File

@ -217,10 +217,6 @@ or if EOF is reached."
(when (module-variable %web-http 'read-line*) (when (module-variable %web-http 'read-line*)
(module-set! %web-http 'read-line* read-header-line)))) (module-set! %web-http 'read-line* read-header-line))))
;; XXX: Work around <http://bugs.gnu.org/13095>, present in Guile
;; up to 2.0.7.
(module-define! (resolve-module '(web client))
'shutdown (const #f))
(define* (http-fetch uri #:key port (text? #f) (buffered? #t) (define* (http-fetch uri #:key port (text? #f) (buffered? #t)
keep-alive? (verify-certificate? #t) keep-alive? (verify-certificate? #t)
@ -252,14 +248,9 @@ Raise an '&http-get-error' condition if downloading fails."
(unless (or buffered? (not (file-port? port))) (unless (or buffered? (not (file-port? port)))
(setvbuf port _IONBF)) (setvbuf port _IONBF))
(let*-values (((resp data) (let*-values (((resp data)
;; Try hard to use the API du jour to get an input port. (http-get uri #:streaming? #t #:port port
(if (guile-version>? "2.0.7") #:keep-alive? #t
(http-get uri #:streaming? #t #:port port #:headers headers))
#:keep-alive? #t
#:headers headers) ; 2.0.9+
(http-get* uri #:decode-body? text? ; 2.0.7
#:keep-alive? #t
#:port port #:headers headers)))
((code) ((code)
(response-code resp))) (response-code resp)))
(case code (case code

View File

@ -130,8 +130,7 @@
;; <http://bugs.gnu.org/19621>. See <http://bugs.gnu.org/19610> for ;; <http://bugs.gnu.org/19621>. See <http://bugs.gnu.org/19610> for
;; a discussion. ;; a discussion.
(let ((bv (read-byte-string p))) (let ((bv (read-byte-string p)))
;; XXX: Rewrite using (ice-9 iconv) when the minimum requirement is ;; XXX: Rewrite using (ice-9 iconv).
;; upgraded to Guile >= 2.0.9.
(list->string (map integer->char (bytevector->u8-list bv))))) (list->string (map integer->char (bytevector->u8-list bv)))))
(define (read-maybe-utf8-string p) (define (read-maybe-utf8-string p)

View File

@ -35,6 +35,7 @@
#:use-module (srfi srfi-64) #:use-module (srfi srfi-64)
#:use-module (ice-9 ftw) #:use-module (ice-9 ftw)
#:use-module (ice-9 regex) #:use-module (ice-9 regex)
#:use-module ((ice-9 control) #:select (let/ec))
#:use-module (ice-9 match)) #:use-module (ice-9 match))
;; Test the (guix nar) module. ;; Test the (guix nar) module.
@ -148,17 +149,6 @@
(string-append (dirname (search-path %load-path "pre-inst-env")) (string-append (dirname (search-path %load-path "pre-inst-env"))
"/test-nar-" (number->string (getpid)))) "/test-nar-" (number->string (getpid))))
(define-syntax-rule (let/ec k exp...)
;; This one appeared in Guile 2.0.9, so provide a copy here.
(let ((tag (make-prompt-tag)))
(call-with-prompt tag
(lambda ()
(let ((k (lambda args
(apply abort-to-prompt tag args))))
exp...))
(lambda (_ . args)
(apply values args)))))
(test-begin "nar") (test-begin "nar")