unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#34007] [PATCH 0/5] Drop Guile 2.0 support
@ 2019-01-07 10:47 Ludovic Courtès
  2019-01-07 10:48 ` [bug#34007] [PATCH 1/5] build: Require Guile 2.2 Ludovic Courtès
  2019-01-09 14:44 ` bug#34007: [PATCH 0/5] Drop Guile 2.0 support Ludovic Courtès
  0 siblings, 2 replies; 7+ messages in thread
From: Ludovic Courtès @ 2019-01-07 10:47 UTC (permalink / raw)
  To: 34007

Hello Guix,

This removes Guile 2.0 support, which in turn in a first step towards
Guile 2.9/3.0 support.

Note that build-side code that would trigger full rebuilds is
unchanged and so still uses APIs that are deprecated in Guile 2.2, in
particular (guix build utils) and (guix build gnu-build-system).

Feedback welcome!

Ludo’.

Ludovic Courtès (5):
  build: Require Guile 2.2.
  maint: Remove 'cond-expand' forms for Guile 2.0.
  download: Remove Guile 2.0 workaround.
  Remove most uses of the _IO*F constants.
  self: Drop support for Guix < 0.15 on Guile 2.0.

 README                              |  2 +-
 configure.ac                        |  6 +-
 doc/guix.texi                       |  5 +-
 gnu/packages/package-management.scm | 39 ++++--------
 guix/build/compile.scm              | 18 ++----
 guix/build/download-nar.scm         |  6 +-
 guix/build/download.scm             | 28 +++------
 guix/build/make-bootstrap.scm       |  4 +-
 guix/build/syscalls.scm             | 56 ++++++++---------
 guix/build/union.scm                | 21 +++++--
 guix/ftp-client.scm                 |  8 +--
 guix/http-client.scm                |  2 +-
 guix/inferior.scm                   | 10 ++-
 guix/scripts/pack.scm               |  6 +-
 guix/scripts/substitute.scm         |  6 +-
 guix/self.scm                       | 95 +++++++----------------------
 guix/ssh.scm                        | 12 ++--
 guix/status.scm                     |  6 +-
 guix/store.scm                      |  9 +--
 guix/ui.scm                         |  9 +--
 tests/publish.scm                   |  6 +-
 tests/status.scm                    |  6 +-
 tests/store.scm                     |  6 +-
 23 files changed, 131 insertions(+), 235 deletions(-)

-- 
2.20.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#34007] [PATCH 1/5] build: Require Guile 2.2.
  2019-01-07 10:47 [bug#34007] [PATCH 0/5] Drop Guile 2.0 support Ludovic Courtès
@ 2019-01-07 10:48 ` Ludovic Courtès
  2019-01-07 10:48   ` [bug#34007] [PATCH 2/5] maint: Remove 'cond-expand' forms for Guile 2.0 Ludovic Courtès
                     ` (3 more replies)
  2019-01-09 14:44 ` bug#34007: [PATCH 0/5] Drop Guile 2.0 support Ludovic Courtès
  1 sibling, 4 replies; 7+ messages in thread
From: Ludovic Courtès @ 2019-01-07 10:48 UTC (permalink / raw)
  To: 34007

* configure.ac: Require Guile 2.2.
* README: Adjust accordingly.
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/package-management.scm (guile2.0-guix): Deprecate.
(guix-minimal): Inherit from GUIX, not from GUILE2.0-GUIX.
---
 README                              |  2 +-
 configure.ac                        |  6 +----
 doc/guix.texi                       |  5 ++--
 gnu/packages/package-management.scm | 39 ++++++++++-------------------
 4 files changed, 17 insertions(+), 35 deletions(-)

diff --git a/README b/README
index e7871917f2..296df41516 100644
--- a/README
+++ b/README
@@ -20,7 +20,7 @@ Guix is based on the [[https://nixos.org/nix/][Nix]] package manager.
 
 GNU Guix currently depends on the following packages:
 
-  - [[https://gnu.org/software/guile/][GNU Guile 2.2.x or 2.0.x]], version 2.0.13 or later
+  - [[https://gnu.org/software/guile/][GNU Guile 2.2.x]]
   - [[https://notabug.org/cwebber/guile-gcrypt][Guile-Gcrypt]] 0.1.0 or later
   - [[https://www.gnu.org/software/make/][GNU Make]]
   - [[https://www.gnutls.org][GnuTLS]] compiled with guile support enabled
diff --git a/configure.ac b/configure.ac
index 2817e6e24d..891fce28ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,16 +93,12 @@ m4_pattern_forbid([^GUIX_])
 
 dnl Search for 'guile' and 'guild'.  This macro defines
 dnl 'GUILE_EFFECTIVE_VERSION'.
-GUILE_PKG([2.2 2.0])
+GUILE_PKG([2.2])
 GUILE_PROGS
 if test "x$GUILD" = "x"; then
    AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
 fi
 
-if test "x$GUILE_EFFECTIVE_VERSION" = "x2.0"; then
-  PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.13])
-fi
-
 dnl Installation directories for .scm and .go files.
 guilemoduledir="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION"
 guileobjectdir="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache"
diff --git a/doc/guix.texi b/doc/guix.texi
index fcb5b8c088..8376ce77a1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -17,7 +17,7 @@
 @set SUBSTITUTE-SERVER ci.guix.info
 
 @copying
-Copyright @copyright{} 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès@*
+Copyright @copyright{} 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès@*
 Copyright @copyright{} 2013, 2014, 2016 Andreas Enge@*
 Copyright @copyright{} 2013 Nikita Karetnikov@*
 Copyright @copyright{} 2014, 2015, 2016 Alex Kost@*
@@ -641,8 +641,7 @@ in the Guix source tree for additional details.
 GNU Guix depends on the following packages:
 
 @itemize
-@item @url{http://gnu.org/software/guile/, GNU Guile}, version 2.0.13 or
-later, including 2.2.x;
+@item @url{http://gnu.org/software/guile/, GNU Guile}, version 2.2.x;
 @item @url{https://notabug.org/cwebber/guile-gcrypt, Guile-Gcrypt}, version
 0.1.0 or later;
 @item
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 85c95a75e9..8eb4e2eefe 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Muriithi Frederick Muriuki <fredmanglis@gmail.com>
 ;;; Copyright © 2017, 2018 Oleg Pykhalov <go.wigust@gmail.com>
@@ -362,36 +362,23 @@ the Nix package manager.")
            (delete 'wrap-program)))))))
 
 (define-public guile2.0-guix
-  (package
-    (inherit guix)
-    (name "guile2.0-guix")
-    (inputs
-     `(("guile" ,guile-2.0)
-       ,@(alist-delete "guile" (package-inputs guix))))
-    (propagated-inputs
-     `(("gnutls" ,gnutls/guile-2.0)
-       ("guile-gcrypt" ,guile2.0-gcrypt)
-       ("guile-json" ,guile2.0-json)
-       ("guile-sqlite3" ,guile2.0-sqlite3)
-       ("guile-ssh" ,guile2.0-ssh)
-       ("guile-git" ,guile2.0-git)))))
+  (deprecated-package "guile2.0-guix" guix))
 
 (define-public guix-minimal
   ;; A version of Guix which is built with the minimal set of dependencies, as
   ;; outlined in the README "Requirements" section.  Intended as a CI job, so
   ;; marked as hidden.
-  (let ((guix guile2.0-guix))
-    (hidden-package
-     (package
-       (inherit guix)
-       (name "guix-minimal")
-       (inputs
-        `(("guile" ,guile-2.0.13)
-          ,@(alist-delete "guile" (package-inputs guix))))
-       (propagated-inputs
-        (fold alist-delete
-              (package-propagated-inputs guix)
-              '("guile-ssh")))))))
+  (hidden-package
+   (package
+     (inherit guix)
+     (name "guix-minimal")
+     (inputs
+      `(("guile" ,guile-2.2)
+        ,@(alist-delete "guile" (package-inputs guix))))
+     (propagated-inputs
+      (fold alist-delete
+            (package-propagated-inputs guix)
+            '("guile-ssh"))))))
 
 (define (source-file? file stat)
   "Return true if FILE is likely a source file, false if it is a typical
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#34007] [PATCH 2/5] maint: Remove 'cond-expand' forms for Guile 2.0.
  2019-01-07 10:48 ` [bug#34007] [PATCH 1/5] build: Require Guile 2.2 Ludovic Courtès
@ 2019-01-07 10:48   ` Ludovic Courtès
  2019-01-07 10:48   ` [bug#34007] [PATCH 3/5] download: Remove Guile 2.0 workaround Ludovic Courtès
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2019-01-07 10:48 UTC (permalink / raw)
  To: 34007

Note: Leave 'cond-expand' forms used in the build-side modules that can
run on %BOOTSTRAP-GUILE, which is currently Guile 2.0.

* guix/build/compile.scm: Move 'use-modules' clause from 'cond-expand'
to 'define-module' form.
(%default-optimizations): Remove 'cond-expand'.
* guix/build/download.scm (tls-wrap): Remove 'cond-expand'.
* guix/build/syscalls.scm: Remove 'cond-expand' form around
'%set-automatic-finalization-enabled?!' and
'without-automatic-finalization'.
* guix/inferior.scm (port->inferior): Remove 'cond-expand'.
* guix/scripts/pack.scm (wrapped-package)[build]: Remove 'cond-expand'.
* guix/status.scm (build-event-output-port): Remove 'cond-expand'.
* guix/store.scm (open-inet-socket): Remove 'cond-expand'.
* guix/ui.scm (install-locale): Remove 'cond-expand'.
* tests/status.scm ("current-build-output-port, UTF-8 + garbage"):
Remove 'cond-expand'.
* tests/store.scm ("current-build-output-port, UTF-8 + garbage"):
Remove 'cond-expand'.
---
 guix/build/compile.scm  | 18 +++++--------
 guix/build/download.scm |  6 ++---
 guix/build/syscalls.scm | 56 ++++++++++++++++++-----------------------
 guix/inferior.scm       |  6 ++---
 guix/scripts/pack.scm   |  6 ++---
 guix/status.scm         |  6 ++---
 guix/store.scm          |  7 +-----
 guix/ui.scm             |  5 ----
 tests/status.scm        |  6 ++---
 tests/store.scm         |  6 ++---
 10 files changed, 43 insertions(+), 79 deletions(-)

diff --git a/guix/build/compile.scm b/guix/build/compile.scm
index 5a1363556a..215489f136 100644
--- a/guix/build/compile.scm
+++ b/guix/build/compile.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -26,28 +26,22 @@
   #:use-module (system base message)
   #:use-module (guix modules)
   #:use-module (guix build utils)
+  #:use-module (language tree-il optimize)
+  #:use-module (language cps optimize)
   #:export (%default-optimizations
             %lightweight-optimizations
             compile-files))
 
 ;;; Commentary:
 ;;;
-;;; Support code to compile Guile code as efficiently as possible (both with
-;;; Guile 2.0 and 2.2).
+;;; Support code to compile Guile code as efficiently as possible (with 2.2).
 ;;;
 ;;; Code:
 
-(cond-expand
-  (guile-2.2 (use-modules (language tree-il optimize)
-                          (language cps optimize)))
-  (else #f))
-
 (define %default-optimizations
   ;; Default optimization options (equivalent to -O2 on Guile 2.2).
-  (cond-expand
-    (guile-2.2 (append (tree-il-default-optimization-options)
-                       (cps-default-optimization-options)))
-    (else '())))
+  (append (tree-il-default-optimization-options)
+          (cps-default-optimization-options)))
 
 (define %lightweight-optimizations
   ;; Lightweight optimizations (like -O0, but with partial evaluation).
diff --git a/guix/build/download.scm b/guix/build/download.scm
index 54163849a2..199702a679 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;;
@@ -314,9 +314,7 @@ host name without trailing dot."
 
       ;; Write HTTP requests line by line rather than byte by byte:
       ;; <https://bugs.gnu.org/22966>.  This is possible with Guile >= 2.2.
-      (cond-expand
-        (guile-2.2 (setvbuf record 'line))
-        (else #f))
+      (setvbuf record 'line)
 
       record)))
 
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 56a689f667..d75c11ada7 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
@@ -699,39 +699,31 @@ mounted at FILE."
 (define CLONE_NEWPID         #x20000000)
 (define CLONE_NEWNET         #x40000000)
 
-(cond-expand
-  (guile-2.2
-   (define %set-automatic-finalization-enabled?!
-     ;; When using a statically-linked Guile, for instance in the initrd, we
-     ;; cannot resolve this symbol, but most of the time we don't need it
-     ;; anyway.  Thus, delay it.
-     (let ((proc (delay
-                   (pointer->procedure int
-                                       (dynamic-func
-                                        "scm_set_automatic_finalization_enabled"
-                                        (dynamic-link))
-                                       (list int)))))
-       (lambda (enabled?)
-         "Switch on or off automatic finalization in a separate thread.
+(define %set-automatic-finalization-enabled?!
+  ;; When using a statically-linked Guile, for instance in the initrd, we
+  ;; cannot resolve this symbol, but most of the time we don't need it
+  ;; anyway.  Thus, delay it.
+  (let ((proc (delay
+                (pointer->procedure int
+                                    (dynamic-func
+                                     "scm_set_automatic_finalization_enabled"
+                                     (dynamic-link))
+                                    (list int)))))
+    (lambda (enabled?)
+      "Switch on or off automatic finalization in a separate thread.
 Turning finalization off shuts down the finalization thread as a side effect."
-         (->bool ((force proc) (if enabled? 1 0))))))
+      (->bool ((force proc) (if enabled? 1 0))))))
 
-   (define-syntax-rule (without-automatic-finalization exp)
-     "Turn off automatic finalization within the dynamic extent of EXP."
-     (let ((enabled? #t))
-       (dynamic-wind
-         (lambda ()
-           (set! enabled? (%set-automatic-finalization-enabled?! #f)))
-         (lambda ()
-           exp)
-         (lambda ()
-           (%set-automatic-finalization-enabled?! enabled?))))))
-
-  (else
-   (define-syntax-rule (without-automatic-finalization exp)
-     ;; Nothing to do here: Guile 2.0 does not have a separate finalization
-     ;; thread.
-     exp)))
+(define-syntax-rule (without-automatic-finalization exp)
+  "Turn off automatic finalization within the dynamic extent of EXP."
+  (let ((enabled? #t))
+    (dynamic-wind
+      (lambda ()
+        (set! enabled? (%set-automatic-finalization-enabled?! #f)))
+      (lambda ()
+        exp)
+      (lambda ()
+        (%set-automatic-finalization-enabled?! enabled?)))))
 
 ;; The libc interface to sys_clone is not useful for Scheme programs, so the
 ;; low-level system call is wrapped instead.  The 'syscall' function is
diff --git a/guix/inferior.scm b/guix/inferior.scm
index 973bd5264e..a6e6d2f16e 100644
--- a/guix/inferior.scm
+++ b/guix/inferior.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -137,9 +137,7 @@ it's an old Guix."
   "Given PIPE, an input/output port, return an inferior that talks over PIPE.
 PIPE is closed with CLOSE when 'close-inferior' is called on the returned
 inferior."
-  (cond-expand
-    ((and guile-2 (not guile-2.2)) #t)
-    (else (setvbuf pipe 'line)))
+  (setvbuf pipe 'line)
 
   (match (read pipe)
     (('repl-version 0 rest ...)
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 98b06971bd..e137fb136a 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen@fastmail.net>
 ;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
@@ -553,9 +553,7 @@ please email '~a'~%")
                       "run.c" "-o" result)
               (delete-file "run.c")))
 
-          (setvbuf (current-output-port)
-                   (cond-expand (guile-2.2 'line)
-                                (else      _IOLBF)))
+          (setvbuf (current-output-port) 'line)
 
           ;; Link the top-level files of PACKAGE so that search paths are
           ;; properly defined in PROFILE/etc/profile.
diff --git a/guix/status.scm b/guix/status.scm
index d4fc4ca16e..1a7cb313ea 100644
--- a/guix/status.scm
+++ b/guix/status.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -636,9 +636,7 @@ The second return value is a thunk to retrieve the current state."
 
   ;; The build port actually receives Unicode strings.
   (set-port-encoding! port "UTF-8")
-  (cond-expand
-    ((and guile-2 (not guile-2.2)) #t)
-    (else (setvbuf port 'line)))
+  (setvbuf port 'line)
   (values port (lambda () %state)))
 
 (define (call-with-status-report on-event thunk)
diff --git a/guix/store.scm b/guix/store.scm
index 042dfab67f..1883829231 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -404,11 +404,6 @@
 (define (open-inet-socket host port)
   "Connect to the Unix-domain socket at HOST:PORT and return it.  Raise a
 '&nix-connection-error' upon error."
-  ;; Define 'TCP_NODELAY' on Guile 2.0.  The value is the same on all GNU
-  ;; systems.
-  (cond-expand (guile-2.2 #t)
-               (else      (define TCP_NODELAY 1)))
-
   (let ((sock (with-fluids ((%default-port-encoding #f))
                 ;; This trick allows use of the `scm_c_read' optimization.
                 (socket PF_UNIX SOCK_STREAM 0))))
diff --git a/guix/ui.scm b/guix/ui.scm
index 4c31246920..f542cd3e3f 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -427,11 +427,6 @@ report them in a user-friendly way."
     (lambda _
       (setlocale LC_ALL ""))
     (lambda args
-      (cond-expand
-        ;; Guile 2.2 already emits a warning, so let's not add a second one.
-        (guile-2.2 #t)
-        (else (warning (G_ "failed to install locale: ~a~%")
-                       (strerror (system-error-errno args)))))
       (display-hint (G_ "Consider installing the @code{glibc-utf8-locales} or
 @code{glibc-locales} package and defining @code{GUIX_LOCPATH}, along these
 lines:
diff --git a/tests/status.scm b/tests/status.scm
index 99abb41c8b..08a3153218 100644
--- a/tests/status.scm
+++ b/tests/status.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -125,9 +125,7 @@
 
 (test-equal "current-build-output-port, UTF-8 + garbage"
   ;; What about a mixture of UTF-8 + garbage?
-  (let ((replacement (cond-expand
-                      ((and guile-2 (not guile-2.2)) "?")
-                      (else "�"))))
+  (let ((replacement "�"))
     `((build-log #f ,(string-append "garbage: " replacement "lambda: λ\n"))))
   (let-values (((port get-status) (build-event-output-port cons '())))
     (display "garbage: " port)
diff --git a/tests/store.scm b/tests/store.scm
index 3ff526cdcf..5ff9308d7d 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -444,9 +444,7 @@
                      (package-derivation %store %bootstrap-guile))))
             (guard (c ((nix-protocol-error? c) #t))
               (build-derivations %store (list d))))))))
-   (cond-expand
-     (guile-2.2 "garbage: �lambda: λ")
-     (else      "garbage: ?lambda: λ"))))
+   "garbage: �lambda: λ"))
 
 (test-assert "log-file, derivation"
   (let* ((b (add-text-to-store %store "build" "echo $foo > $out" '()))
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#34007] [PATCH 3/5] download: Remove Guile 2.0 workaround.
  2019-01-07 10:48 ` [bug#34007] [PATCH 1/5] build: Require Guile 2.2 Ludovic Courtès
  2019-01-07 10:48   ` [bug#34007] [PATCH 2/5] maint: Remove 'cond-expand' forms for Guile 2.0 Ludovic Courtès
@ 2019-01-07 10:48   ` Ludovic Courtès
  2019-01-07 10:48   ` [bug#34007] [PATCH 4/5] Remove most uses of the _IO*F constants Ludovic Courtès
  2019-01-07 10:48   ` [bug#34007] [PATCH 5/5] self: Drop support for Guix < 0.15 on Guile 2.0 Ludovic Courtès
  3 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2019-01-07 10:48 UTC (permalink / raw)
  To: 34007

* guix/build/download.scm: Remove Guile 2.0 workaround.
---
 guix/build/download.scm | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/guix/build/download.scm b/guix/build/download.scm
index 199702a679..24b5aa378f 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -504,18 +504,6 @@ port if PORT is a TLS session record port."
   (module-set! (resolve-module '(web http))
                'parse-rfc-822-date parse-rfc-822-date))
 
-;; XXX: Work around <http://bugs.gnu.org/19840>, present in Guile
-;; up to 2.0.11.
-(unless (or (> (string->number (major-version)) 2)
-            (> (string->number (minor-version)) 0)
-            (> (string->number (micro-version)) 11))
-  (let ((var (module-variable (resolve-module '(web http))
-                              'declare-relative-uri-header!)))
-    ;; If 'declare-relative-uri-header!' doesn't exist, forget it.
-    (when (and var (variable-bound? var))
-      (let ((declare-relative-uri-header! (variable-ref var)))
-        (declare-relative-uri-header! "Location")))))
-
 ;; XXX: Work around broken proxy handling on Guile 2.2 <= 2.2.2, fixed in
 ;; Guile commits 7d0d9e2c25c1e872cfc7d14ab5139915f1813d56 and
 ;; 6ad28ae3bc6a6d9e95ab7d70510d12c97673a143.  See bug report at
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#34007] [PATCH 4/5] Remove most uses of the _IO*F constants.
  2019-01-07 10:48 ` [bug#34007] [PATCH 1/5] build: Require Guile 2.2 Ludovic Courtès
  2019-01-07 10:48   ` [bug#34007] [PATCH 2/5] maint: Remove 'cond-expand' forms for Guile 2.0 Ludovic Courtès
  2019-01-07 10:48   ` [bug#34007] [PATCH 3/5] download: Remove Guile 2.0 workaround Ludovic Courtès
@ 2019-01-07 10:48   ` Ludovic Courtès
  2019-01-07 10:48   ` [bug#34007] [PATCH 5/5] self: Drop support for Guix < 0.15 on Guile 2.0 Ludovic Courtès
  3 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2019-01-07 10:48 UTC (permalink / raw)
  To: 34007

These constants, for use with 'setvbuf', were deprecated in Guile 2.2
and disappeared in Guile 3.0.  Here we keep these constants in
build-side code where removing them is not feasible.

* guix/build/download-nar.scm (download-nar): Adjust 'setvbuf' calls to
the Guile 2.2+ API.
* guix/build/download.scm (open-socket-for-uri): Likewise.
(open-connection-for-uri, url-fetch): Likewise.
* guix/build/make-bootstrap.scm (make-stripped-libc): Likewise.
* guix/build/union.scm (setvbuf) [guile-2.0]: New conditional wrapper.
(union-build): Adjust to new API.
* guix/ftp-client.scm (ftp-open, ftp-list, ftp-retr): Likewise.
* guix/http-client.scm (http-fetch): Likewise.
* guix/inferior.scm (proxy): Likewise.
* guix/scripts/substitute.scm (fetch, http-multiple-get): Likewise.
* guix/self.scm (compiled-modules): Likewise.
* guix/ssh.scm (remote-daemon-channel, store-import-channel)
(store-export-channel): Likewise.
* guix/ui.scm (initialize-guix): Likewise.
* tests/publish.scm (http-get-port): Likewise.
* guix/store.scm (%newlines): Adjust comment.
---
 guix/build/download-nar.scm   |  6 +++---
 guix/build/download.scm       | 10 +++++-----
 guix/build/make-bootstrap.scm |  4 ++--
 guix/build/union.scm          | 21 +++++++++++++++++----
 guix/ftp-client.scm           |  8 ++++----
 guix/http-client.scm          |  2 +-
 guix/inferior.scm             |  4 ++--
 guix/scripts/substitute.scm   |  6 +++---
 guix/self.scm                 |  6 +++---
 guix/ssh.scm                  | 12 ++++++------
 guix/store.scm                |  2 +-
 guix/ui.scm                   |  4 ++--
 tests/publish.scm             |  6 +++---
 13 files changed, 52 insertions(+), 39 deletions(-)

diff --git a/guix/build/download-nar.scm b/guix/build/download-nar.scm
index 13f01fb1e8..681f22238d 100644
--- a/guix/build/download-nar.scm
+++ b/guix/build/download-nar.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -93,8 +93,8 @@ ITEM."
   "Download and extract the normalized archive for ITEM.  Return #t on
 success, #f otherwise."
   ;; Let progress reports go through.
-  (setvbuf (current-error-port) _IONBF)
-  (setvbuf (current-output-port) _IONBF)
+  (setvbuf (current-error-port) 'none)
+  (setvbuf (current-output-port) 'none)
 
   (let loop ((urls (urls-for-item item)))
     (match urls
diff --git a/guix/build/download.scm b/guix/build/download.scm
index 24b5aa378f..c08221b3b2 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -357,7 +357,7 @@ ETIMEDOUT error is raised."
           (connect* s (addrinfo:addr ai) timeout)
 
           ;; Buffer input and output on this port.
-          (setvbuf s _IOFBF)
+          (setvbuf s 'block)
           ;; If we're using a proxy, make a note of that.
           (when http-proxy (set-http-proxy-port?! s #t))
           s)
@@ -401,7 +401,7 @@ VERIFY-CERTIFICATE? is true, verify HTTPS server certificates."
     (with-https-proxy
      (let ((s (open-socket-for-uri uri #:timeout timeout)))
        ;; Buffer input and output on this port.
-       (setvbuf s _IOFBF %http-receive-buffer-size)
+       (setvbuf s 'block %http-receive-buffer-size)
 
        (if https?
            (tls-wrap s (uri-host uri)
@@ -777,11 +777,11 @@ otherwise simply ignore them."
                               hashes))
                 content-addressed-mirrors))
 
-  ;; Make this unbuffered so 'progress-report/file' works as expected.  _IOLBF
+  ;; Make this unbuffered so 'progress-report/file' works as expected.  'line
   ;; means '\n', not '\r', so it's not appropriate here.
-  (setvbuf (current-output-port) _IONBF)
+  (setvbuf (current-output-port) 'none)
 
-  (setvbuf (current-error-port) _IOLBF)
+  (setvbuf (current-error-port) 'line)
 
   (let try ((uri (append uri content-addressed-uris)))
     (match uri
diff --git a/guix/build/make-bootstrap.scm b/guix/build/make-bootstrap.scm
index 43b136248f..48799f7e90 100644
--- a/guix/build/make-bootstrap.scm
+++ b/guix/build/make-bootstrap.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
-;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -67,7 +67,7 @@ when producing a bootstrap libc."
 util).*\\.so(\\..*)?|lib(machuser|hurduser).so.*|(libc(rt|)|libpthread)\
 _nonshared\\.a)$")
 
-  (setvbuf (current-output-port) _IOLBF)
+  (setvbuf (current-output-port) 'line)
   (let* ((libdir (string-append output "/lib")))
     (mkdir-p libdir)
     (for-each (lambda (file)
diff --git a/guix/build/union.scm b/guix/build/union.scm
index fff795c4d3..961ac3298b 100644
--- a/guix/build/union.scm
+++ b/guix/build/union.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2017 Huang Ying <huang.ying.caritas@gmail.com>
 ;;;
@@ -39,6 +39,19 @@
 ;;;
 ;;; Code:
 
+;; This code can be used with the bootstrap Guile, which is Guile 2.0, so
+;; provide a compatibility layer.
+(cond-expand
+  ((and guile-2 (not guile-2.2))
+   (define (setvbuf port mode . rest)
+     (apply (@ (guile) setvbuf) port
+            (match mode
+              ('line _IOLBF)
+              ('block _IOFBF)
+              ('none _IONBF))
+            rest)))
+  (else #f))
+
 (define (files-in-directory dirname)
   (let ((dir (opendir dirname)))
     (let loop ((files '()))
@@ -179,10 +192,10 @@ returns #f, skip the faulty file altogether."
                                    (reverse dirs-with-file))))
                      table)))
 
-  (setvbuf (current-output-port) _IOLBF)
-  (setvbuf (current-error-port) _IOLBF)
+  (setvbuf (current-output-port) 'line)
+  (setvbuf (current-error-port) 'line)
   (when (file-port? log-port)
-    (setvbuf log-port _IOLBF))
+    (setvbuf log-port 'line))
 
   (union-of-directories output (delete-duplicates inputs)))
 
diff --git a/guix/ftp-client.scm b/guix/ftp-client.scm
index 0b8f61c276..8d5adcb8ed 100644
--- a/guix/ftp-client.scm
+++ b/guix/ftp-client.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -154,7 +154,7 @@ TIMEOUT, an ETIMEDOUT error is raised."
          (catch 'system-error
            (lambda ()
              (connect* s (addrinfo:addr ai) timeout)
-             (setvbuf s _IOLBF)
+             (setvbuf s 'line)
              (let-values (((code message) (%ftp-listen s)))
                (if (eqv? code 220)
                    (begin
@@ -237,7 +237,7 @@ TIMEOUT, an ETIMEDOUT error is raised."
          (s    (socket (addrinfo:fam ai) (addrinfo:socktype ai)
                        (addrinfo:protocol ai))))
     (connect* s (address-with-port (addrinfo:addr ai) port) timeout)
-    (setvbuf s _IOLBF)
+    (setvbuf s 'line)
 
     (dynamic-wind
       (lambda () #t)
@@ -293,7 +293,7 @@ must be closed before CONN can be used for other purposes."
             (throw 'ftp-error conn "LIST" code message))))
 
     (connect* s (address-with-port (addrinfo:addr ai) port) timeout)
-    (setvbuf s _IOLBF)
+    (setvbuf s 'line)
 
     (%ftp-command (string-append "RETR " file)
                   150 (ftp-connection-socket conn))
diff --git a/guix/http-client.scm b/guix/http-client.scm
index 07360e6108..067002a79a 100644
--- a/guix/http-client.scm
+++ b/guix/http-client.scm
@@ -97,7 +97,7 @@ Raise an '&http-get-error' condition if downloading fails."
                             headers))
                      (_ headers))))
       (unless (or buffered? (not (file-port? port)))
-        (setvbuf port _IONBF))
+        (setvbuf port 'none))
       (let*-values (((resp data)
                      (http-get uri #:streaming? #t #:port port
                                #:keep-alive? #t
diff --git a/guix/inferior.scm b/guix/inferior.scm
index a6e6d2f16e..ba8d00866b 100644
--- a/guix/inferior.scm
+++ b/guix/inferior.scm
@@ -389,8 +389,8 @@ input/output ports.)"
 
   ;; 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 _IOFBF 65536)
-  (setvbuf backend _IOFBF 65536)
+  (setvbuf client 'block 65536)
+  (setvbuf backend 'block 65536)
 
   (let loop ()
     (match (select* (list client backend) '() '())
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 53b1777241..797a76db3f 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
 ;;;
@@ -219,7 +219,7 @@ provide."
                (set! port (guix:open-connection-for-uri
                            uri #:verify-certificate? #f))
                (unless (or buffered? (not (file-port? port)))
-                 (setvbuf port _IONBF)))
+                 (setvbuf port 'none)))
              (http-fetch uri #:text? #f #:port port
                          #:verify-certificate? #f))))))
     (else
@@ -567,7 +567,7 @@ initial connection on which HTTP requests are sent."
                        verify-certificate?))))
       ;; For HTTPS, P is not a file port and does not support 'setvbuf'.
       (when (file-port? p)
-        (setvbuf p _IOFBF (expt 2 16)))
+        (setvbuf p 'block (expt 2 16)))
 
       ;; Send REQUESTS, up to a certain number, in a row.
       ;; XXX: Do our own caching to work around inefficiencies when
diff --git a/guix/self.scm b/guix/self.scm
index 2664fd886f..4e97cb7e98 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -866,8 +866,8 @@ containing MODULE-FILES and possibly other files as well."
                              #:report-load report-load
                              #:report-compilation report-compilation)))
 
-          (setvbuf (current-output-port) _IONBF)
-          (setvbuf (current-error-port) _IONBF)
+          (setvbuf (current-output-port) 'none)
+          (setvbuf (current-error-port) 'none)
 
           (set! %load-path (cons #+module-tree %load-path))
           (set! %load-path
diff --git a/guix/ssh.scm b/guix/ssh.scm
index 1ed8406633..d90cb77be0 100644
--- a/guix/ssh.scm
+++ b/guix/ssh.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -140,12 +140,12 @@ right away."
                         (match (select read write except)
                           ((read write except)
                            (select read write except 0))))))
-         (setvbuf stdout _IONBF)
+         (setvbuf stdout 'none)
 
          ;; 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 stdin _IOFBF 65536)
-         (setvbuf sock _IOFBF 65536)
+         (setvbuf stdin 'block 65536)
+         (setvbuf sock 'block 65536)
 
          (connect sock AF_UNIX ,socket-name)
 
@@ -218,7 +218,7 @@ can be written."
                        (consume-input (current-input-port))
                        (list 'protocol-error (nix-protocol-error-message c))))
               (with-store store
-                (setvbuf (current-input-port) _IONBF)
+                (setvbuf (current-input-port) 'none)
                 (import-paths store (current-input-port))
                 '(success))))
           (lambda args
@@ -269,7 +269,7 @@ be read.  When RECURSIVE? is true, the closure of FILES is exported."
              (write '(exporting))                 ;we're ready
              (force-output)
 
-             (setvbuf (current-output-port) _IONBF)
+             (setvbuf (current-output-port) 'none)
              (export-paths store files (current-output-port)
                            #:recursive? ,recursive?))))))
 
diff --git a/guix/store.scm b/guix/store.scm
index 1883829231..1f88eb2b33 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -608,7 +608,7 @@ to OUT, using chunks of BUFFER-SIZE bytes."
 
 (define %newlines
   ;; Newline characters triggering a flush of 'current-build-output-port'.
-  ;; Unlike Guile's _IOLBF, we flush upon #\return so that progress reports
+  ;; Unlike Guile's 'line, we flush upon #\return so that progress reports
   ;; that use that trick are correctly displayed.
   (char-set #\newline #\return))
 
diff --git a/guix/ui.scm b/guix/ui.scm
index f542cd3e3f..1e089753e1 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -454,8 +454,8 @@ See the \"Application Setup\" section in the manual, for more info.\n")))))
   ;; notified via an EPIPE later.
   (sigaction SIGPIPE SIG_IGN)
 
-  (setvbuf (current-output-port) _IOLBF)
-  (setvbuf (current-error-port) _IOLBF))
+  (setvbuf (current-output-port) 'line)
+  (setvbuf (current-error-port) 'line))
 
 (define* (show-version-and-exit #:optional (command (car (command-line))))
   "Display version information for COMMAND and `(exit 0)'."
diff --git a/tests/publish.scm b/tests/publish.scm
index 79a786e723..097ac036e0 100644
--- a/tests/publish.scm
+++ b/tests/publish.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
-;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -63,12 +63,12 @@
   (let ((socket (open-socket-for-uri uri)))
     ;; Make sure to use an unbuffered port so that we can then peek at the
     ;; underlying file descriptor via 'call-with-gzip-input-port'.
-    (setvbuf socket _IONBF)
+    (setvbuf socket 'none)
     (call-with-values
         (lambda ()
           (http-get uri #:port socket #:streaming? #t))
       (lambda (response port)
-        ;; Don't (setvbuf port _IONBF) because of <http://bugs.gnu.org/19610>
+        ;; Don't (setvbuf port 'none) because of <http://bugs.gnu.org/19610>
         ;; (PORT might be a custom binary input port).
         port))))
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#34007] [PATCH 5/5] self: Drop support for Guix < 0.15 on Guile 2.0.
  2019-01-07 10:48 ` [bug#34007] [PATCH 1/5] build: Require Guile 2.2 Ludovic Courtès
                     ` (2 preceding siblings ...)
  2019-01-07 10:48   ` [bug#34007] [PATCH 4/5] Remove most uses of the _IO*F constants Ludovic Courtès
@ 2019-01-07 10:48   ` Ludovic Courtès
  3 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2019-01-07 10:48 UTC (permalink / raw)
  To: 34007

* guix/self.scm (false-if-wrong-guile, package-for-guile): Remove.
(specification->package): Remove "guile2.0-" variants.
(compiled-guix): #:guile-for-build defaults to (default-guile).
Use 'specification->package' instead of 'package-for-guile'.
(guile-for-build): Remove.
(guix-derivation): Use 'default-guile' instead of 'guile-for-build'.
Check whether we're running on Guile 2.0 with PULL-VERSION < 1.
---
 guix/self.scm | 89 +++++++++++----------------------------------------
 1 file changed, 19 insertions(+), 70 deletions(-)

diff --git a/guix/self.scm b/guix/self.scm
index 4e97cb7e98..c2ee5254f5 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -31,6 +31,7 @@
   #:use-module ((guix build compile) #:select (%lightweight-optimizations))
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-9)
+  #:use-module (srfi srfi-35)
   #:use-module (ice-9 match)
   #:export (make-config.scm
             whole-package                     ;for internal use in 'guix pull'
@@ -43,35 +44,6 @@
 ;;; Dependency handling.
 ;;;
 
-(define* (false-if-wrong-guile package
-                               #:optional (guile-version (effective-version)))
-  "Return #f if PACKAGE depends on the \"wrong\" major version of Guile (e.g.,
-2.0 instead of 2.2), otherwise return PACKAGE."
-  (let ((guile (any (match-lambda
-                      ((label (? package? dep) _ ...)
-                       (and (string=? (package-name dep) "guile")
-                            dep)))
-                    (package-direct-inputs package))))
-    (and (or (not guile)
-             (string-prefix? guile-version
-                             (package-version guile)))
-         package)))
-
-(define (package-for-guile guile-version . names)
-  "Return the package with one of the given NAMES that depends on
-GUILE-VERSION (\"2.0\" or \"2.2\"), or #f if none of the packages matches."
-  (let loop ((names names))
-    (match names
-      (()
-       #f)
-      ((name rest ...)
-       (match (specification->package name)
-         (#f
-          (loop rest))
-         ((? package? package)
-          (or (false-if-wrong-guile package guile-version)
-              (loop rest))))))))
-
 (define specification->package
   ;; Use our own variant of that procedure because that of (gnu packages)
   ;; would traverse all the .scm files, which is wasteful.
@@ -89,12 +61,7 @@ GUILE-VERSION (\"2.0\" or \"2.2\"), or #f if none of the packages matches."
       ("gzip"       (ref '(gnu packages compression) 'gzip))
       ("bzip2"      (ref '(gnu packages compression) 'bzip2))
       ("xz"         (ref '(gnu packages compression) 'xz))
-      ("guile2.0-json" (ref '(gnu packages guile) 'guile2.0-json))
-      ("guile2.0-ssh"  (ref '(gnu packages ssh) 'guile2.0-ssh))
-      ("guile2.0-git"  (ref '(gnu packages guile) 'guile2.0-git))
-      ;; XXX: No "guile2.0-sqlite3".
-      ("guile2.0-gnutls" (ref '(gnu packages tls) 'gnutls/guile-2.0))
-      (_               #f))))                     ;no such package
+      (_            #f))))                        ;no such package
 
 \f
 ;;;
@@ -488,7 +455,7 @@ assumed to be part of MODULES."
                         (pull-version 1)
                         (name (string-append "guix-" version))
                         (guile-version (effective-version))
-                        (guile-for-build (guile-for-build guile-version))
+                        (guile-for-build (default-guile))
                         (zlib (specification->package "zlib"))
                         (gzip (specification->package "gzip"))
                         (bzip2 (specification->package "bzip2"))
@@ -496,32 +463,22 @@ assumed to be part of MODULES."
                         (guix (specification->package "guix")))
   "Return a file-like object that contains a compiled Guix."
   (define guile-json
-    (package-for-guile guile-version
-                       "guile-json"
-                       "guile2.0-json"))
+    (specification->package "guile-json"))
 
   (define guile-ssh
-    (package-for-guile guile-version
-                       "guile-ssh"
-                       "guile2.0-ssh"))
+    (specification->package "guile-ssh"))
 
   (define guile-git
-    (package-for-guile guile-version
-                       "guile-git"
-                       "guile2.0-git"))
+    (specification->package "guile-git"))
 
   (define guile-sqlite3
-    (package-for-guile guile-version
-                       "guile-sqlite3"
-                       "guile2.0-sqlite3"))
+    (specification->package "guile-sqlite3"))
 
   (define guile-gcrypt
-    (package-for-guile guile-version
-                       "guile-gcrypt"))
+    (specification->package "guile-gcrypt"))
 
   (define gnutls
-    (package-for-guile guile-version
-                       "gnutls" "guile2.0-gnutls"))
+    (specification->package "gnutls"))
 
   (define dependencies
     (match (append-map (lambda (package)
@@ -912,21 +869,6 @@ containing MODULE-FILES and possibly other files as well."
 ;;; Building.
 ;;;
 
-(define (guile-for-build version)
-  "Return a derivation for Guile 2.0 or 2.2, whichever matches the currently
-running Guile."
-  (define canonical-package                       ;soft reference
-    (module-ref (resolve-interface '(gnu packages base))
-                'canonical-package))
-
-  (match version
-    ("2.2"
-     (canonical-package (module-ref (resolve-interface '(gnu packages guile))
-                                    'guile-2.2)))
-    ("2.0"
-     (module-ref (resolve-interface '(gnu packages guile))
-                 'guile-2.0))))
-
 (define* (guix-derivation source version
                           #:optional (guile-version (effective-version))
                           #:key (pull-version 0))
@@ -943,9 +885,16 @@ is not supported."
   (define guile
     ;; When PULL-VERSION >= 1, produce a self-contained Guix and use Guile 2.2
     ;; unconditionally.
-    (guile-for-build (if (>= pull-version 1)
-                         "2.2"
-                         guile-version)))
+    (default-guile))
+
+  (when (and (< pull-version 1)
+             (not (string=? (package-version guile) guile-version)))
+    ;; Guix < 0.15.0 has PULL-VERSION = 0, where the host Guile is reused and
+    ;; can be any version.  When that happens and Guile is not current (e.g.,
+    ;; it's Guile 2.0), just bail out.
+    (raise (condition
+            (&message
+             (message "Guix is too old and cannot be upgraded")))))
 
   (mbegin %store-monad
     (set-guile-for-build guile)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#34007: [PATCH 0/5] Drop Guile 2.0 support
  2019-01-07 10:47 [bug#34007] [PATCH 0/5] Drop Guile 2.0 support Ludovic Courtès
  2019-01-07 10:48 ` [bug#34007] [PATCH 1/5] build: Require Guile 2.2 Ludovic Courtès
@ 2019-01-09 14:44 ` Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2019-01-09 14:44 UTC (permalink / raw)
  To: 34007-done

Ludovic Courtès <ludo@gnu.org> skribis:

> This removes Guile 2.0 support, which in turn in a first step towards
> Guile 2.9/3.0 support.

Pushed!

  6e54e488c6 self: Drop support for Guix < 0.15 on Guile 2.0.
  76832d3420 Remove most uses of the _IO*F constants.
  c3d9bca48a download: Remove Guile 2.0 workaround.
  a65177a657 maint: Remove 'cond-expand' forms for Guile 2.0.
  0991fd5336 build: Require Guile 2.2.

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-01-09 14:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-07 10:47 [bug#34007] [PATCH 0/5] Drop Guile 2.0 support Ludovic Courtès
2019-01-07 10:48 ` [bug#34007] [PATCH 1/5] build: Require Guile 2.2 Ludovic Courtès
2019-01-07 10:48   ` [bug#34007] [PATCH 2/5] maint: Remove 'cond-expand' forms for Guile 2.0 Ludovic Courtès
2019-01-07 10:48   ` [bug#34007] [PATCH 3/5] download: Remove Guile 2.0 workaround Ludovic Courtès
2019-01-07 10:48   ` [bug#34007] [PATCH 4/5] Remove most uses of the _IO*F constants Ludovic Courtès
2019-01-07 10:48   ` [bug#34007] [PATCH 5/5] self: Drop support for Guix < 0.15 on Guile 2.0 Ludovic Courtès
2019-01-09 14:44 ` bug#34007: [PATCH 0/5] Drop Guile 2.0 support Ludovic Courtès

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).