From patchwork Mon Jan 7 10:48:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 697 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6450F16A29; Mon, 7 Jan 2019 10:50:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 66EB316A28 for ; Mon, 7 Jan 2019 10:50:23 +0000 (GMT) Received: from localhost ([127.0.0.1]:32982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggSUA-0008AG-VZ for patchwork@mira.cbaines.net; Mon, 07 Jan 2019 05:50:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggSTr-0007xr-BD for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggSTq-0002qa-4d for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48396) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggSTq-0002qV-1D for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ggSTp-0004Ii-Tw for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34007] [PATCH 1/5] build: Require Guile 2.2. References: <20190107104700.6375-1-ludo@gnu.org> In-Reply-To: <20190107104700.6375-1-ludo@gnu.org> Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Jan 2019 10:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34007 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34007@debbugs.gnu.org Received: via spool by 34007-submit@debbugs.gnu.org id=B34007.154685815316441 (code B ref 34007); Mon, 07 Jan 2019 10:50:01 +0000 Received: (at 34007) by debbugs.gnu.org; 7 Jan 2019 10:49:13 +0000 Received: from localhost ([127.0.0.1]:47667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggSSx-0004Gl-7N for submit@debbugs.gnu.org; Mon, 07 Jan 2019 05:49:12 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:60124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggSSv-0004GT-57 for 34007@debbugs.gnu.org; Mon, 07 Jan 2019 05:49:06 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 3F261EEE; Mon, 7 Jan 2019 11:49:04 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VAjyy2Pbq_g3; Mon, 7 Jan 2019 11:49:02 +0100 (CET) Received: from gnu.org (unknown [IPv6:2001:660:6102:320:e120:2c8f:8909:cdfe]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 7045A774; Mon, 7 Jan 2019 11:49:02 +0100 (CET) From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 7 Jan 2019 11:48:53 +0100 Message-Id: <20190107104857.6456-1-ludo@gnu.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2015, 2017 Ricardo Wurmus ;;; Copyright © 2017 Muriithi Frederick Muriuki ;;; Copyright © 2017, 2018 Oleg Pykhalov @@ -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 From patchwork Mon Jan 7 10:48:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 698 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8B2E216A29; Mon, 7 Jan 2019 10:50:37 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 9FFAC16A27 for ; Mon, 7 Jan 2019 10:50:36 +0000 (GMT) Received: from localhost ([127.0.0.1]:32996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggSUO-0008Et-6s for patchwork@mira.cbaines.net; Mon, 07 Jan 2019 05:50:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggSTx-00081B-UE for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggSTr-0002rA-7e for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:09 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48398) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggSTr-0002r5-4O for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ggSTr-0004Ix-0m for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34007] [PATCH 2/5] maint: Remove 'cond-expand' forms for Guile 2.0. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Jan 2019 10:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34007 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34007@debbugs.gnu.org Received: via spool by 34007-submit@debbugs.gnu.org id=B34007.154685815416456 (code B ref 34007); Mon, 07 Jan 2019 10:50:02 +0000 Received: (at 34007) by debbugs.gnu.org; 7 Jan 2019 10:49:14 +0000 Received: from localhost ([127.0.0.1]:47673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggST3-0004HF-99 for submit@debbugs.gnu.org; Mon, 07 Jan 2019 05:49:13 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:60134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggSSv-0004GV-RG for 34007@debbugs.gnu.org; Mon, 07 Jan 2019 05:49:07 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 22066F09; Mon, 7 Jan 2019 11:49:05 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZI7hFKJSLhLv; Mon, 7 Jan 2019 11:49:02 +0100 (CET) Received: from gnu.org (unknown [IPv6:2001:660:6102:320:e120:2c8f:8909:cdfe]) by hera.aquilenet.fr (Postfix) with ESMTPSA id B94BBE1E; Mon, 7 Jan 2019 11:49:02 +0100 (CET) From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 7 Jan 2019 11:48:54 +0100 Message-Id: <20190107104857.6456-2-ludo@gnu.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107104857.6456-1-ludo@gnu.org> References: <20190107104857.6456-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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 +;;; Copyright © 2013, 2014, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer ;;; ;;; 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 +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2017 Tobias Geerinckx-Rice ;;; @@ -314,9 +314,7 @@ host name without trailing dot." ;; Write HTTP requests line by line rather than byte by byte: ;; . 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 +;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2015 David Thompson ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2017 Mathieu Othacehe @@ -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 +;;; Copyright © 2018, 2019 Ludovic Courtès ;;; ;;; 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 +;;; Copyright © 2015, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2017, 2018 Ricardo Wurmus ;;; Copyright © 2018 Konrad Hinsen ;;; Copyright © 2018 Chris Marusich @@ -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 +;;; Copyright © 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2018 Ricardo Wurmus ;;; ;;; 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 +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2018 Jan Nieuwenhuizen ;;; ;;; 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 +;;; Copyright © 2018, 2019 Ludovic Courtès ;;; ;;; 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 +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; ;;; 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" '())) From patchwork Mon Jan 7 10:48:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 695 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 88EFC16A27; Mon, 7 Jan 2019 10:50:23 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 40F5716A27 for ; Mon, 7 Jan 2019 10:50:23 +0000 (GMT) Received: from localhost ([127.0.0.1]:32945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggSUA-00081X-OV for patchwork@mira.cbaines.net; Mon, 07 Jan 2019 05:50:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggSTw-0007y7-4U for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggSTq-0002qt-K6 for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48397) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggSTq-0002qp-HI for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ggSTq-0004Iq-EU for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34007] [PATCH 3/5] download: Remove Guile 2.0 workaround. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Jan 2019 10:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34007 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34007@debbugs.gnu.org Received: via spool by 34007-submit@debbugs.gnu.org id=B34007.154685815316448 (code B ref 34007); Mon, 07 Jan 2019 10:50:02 +0000 Received: (at 34007) by debbugs.gnu.org; 7 Jan 2019 10:49:13 +0000 Received: from localhost ([127.0.0.1]:47671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggST2-0004H8-Vh for submit@debbugs.gnu.org; Mon, 07 Jan 2019 05:49:13 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:60140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggSSw-0004GX-0v for 34007@debbugs.gnu.org; Mon, 07 Jan 2019 05:49:06 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 4AF18774; Mon, 7 Jan 2019 11:49:05 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ouaKHIfZFGQN; Mon, 7 Jan 2019 11:49:04 +0100 (CET) Received: from gnu.org (unknown [IPv6:2001:660:6102:320:e120:2c8f:8909:cdfe]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 0D550E93; Mon, 7 Jan 2019 11:49:03 +0100 (CET) From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 7 Jan 2019 11:48:55 +0100 Message-Id: <20190107104857.6456-3-ludo@gnu.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107104857.6456-1-ludo@gnu.org> References: <20190107104857.6456-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 , 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 From patchwork Mon Jan 7 10:48:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 696 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0922B16A2A; Mon, 7 Jan 2019 10:50:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id CEE7916A27 for ; Mon, 7 Jan 2019 10:50:23 +0000 (GMT) Received: from localhost ([127.0.0.1]:32938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggSUA-000818-Bm for patchwork@mira.cbaines.net; Mon, 07 Jan 2019 05:50:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggSTu-0007xu-51 for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggSTs-0002rr-7w for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48400) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggSTs-0002rm-4o for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ggSTs-0004JC-23 for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34007] [PATCH 4/5] Remove most uses of the _IO*F constants. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Jan 2019 10:50:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34007 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34007@debbugs.gnu.org Received: via spool by 34007-submit@debbugs.gnu.org id=B34007.154685815516470 (code B ref 34007); Mon, 07 Jan 2019 10:50:04 +0000 Received: (at 34007) by debbugs.gnu.org; 7 Jan 2019 10:49:15 +0000 Received: from localhost ([127.0.0.1]:47677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggST4-0004HU-An for submit@debbugs.gnu.org; Mon, 07 Jan 2019 05:49:14 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:60152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggSSy-0004Gr-0I for 34007@debbugs.gnu.org; Mon, 07 Jan 2019 05:49:09 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 5A126E8C; Mon, 7 Jan 2019 11:49:07 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DCyFk_yE7K2s; Mon, 7 Jan 2019 11:49:05 +0100 (CET) Received: from gnu.org (unknown [IPv6:2001:660:6102:320:e120:2c8f:8909:cdfe]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 579D7EB9; Mon, 7 Jan 2019 11:49:03 +0100 (CET) From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 7 Jan 2019 11:48:56 +0100 Message-Id: <20190107104857.6456-4-ludo@gnu.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107104857.6456-1-ludo@gnu.org> References: <20190107104857.6456-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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 +;;; Copyright © 2017, 2019 Ludovic Courtès ;;; ;;; 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 -;;; Copyright © 2015 Ludovic Courtès +;;; Copyright © 2015, 2019 Ludovic Courtès ;;; ;;; 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 +;;; Copyright © 2012, 2013, 2014, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2014 Mark H Weaver ;;; Copyright © 2017 Huang Ying ;;; @@ -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 +;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2019 Ludovic Courtès ;;; ;;; 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 . - (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 +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2014 Nikita Karetnikov ;;; Copyright © 2018 Kyle Meyer ;;; @@ -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 +;;; Copyright © 2017, 2018, 2019 Ludovic Courtès ;;; ;;; 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 +;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès ;;; ;;; 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 . - (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 -;;; Copyright © 2016, 2017, 2018 Ludovic Courtès +;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès ;;; ;;; 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 + ;; Don't (setvbuf port 'none) because of ;; (PORT might be a custom binary input port). port)))) From patchwork Mon Jan 7 10:48:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 694 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 595CD16A29; Mon, 7 Jan 2019 10:50:19 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id C70E816A27 for ; Mon, 7 Jan 2019 10:50:18 +0000 (GMT) Received: from localhost ([127.0.0.1]:32918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggSU6-0007yH-D9 for patchwork@mira.cbaines.net; Mon, 07 Jan 2019 05:50:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggSTu-0007xt-4V for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggSTr-0002rS-PO for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48399) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggSTr-0002rM-LY for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ggSTr-0004J5-IO for guix-patches@gnu.org; Mon, 07 Jan 2019 05:50:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34007] [PATCH 5/5] self: Drop support for Guix < 0.15 on Guile 2.0. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Jan 2019 10:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34007 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34007@debbugs.gnu.org Received: via spool by 34007-submit@debbugs.gnu.org id=B34007.154685815416463 (code B ref 34007); Mon, 07 Jan 2019 10:50:03 +0000 Received: (at 34007) by debbugs.gnu.org; 7 Jan 2019 10:49:14 +0000 Received: from localhost ([127.0.0.1]:47675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggST3-0004HN-VR for submit@debbugs.gnu.org; Mon, 07 Jan 2019 05:49:14 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:60146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggSSx-0004Gk-7d for 34007@debbugs.gnu.org; Mon, 07 Jan 2019 05:49:07 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 9151BE1E; Mon, 7 Jan 2019 11:49:06 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JIC_Njak5WQj; Mon, 7 Jan 2019 11:49:05 +0100 (CET) Received: from gnu.org (unknown [IPv6:2001:660:6102:320:e120:2c8f:8909:cdfe]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 9EC8BED1; Mon, 7 Jan 2019 11:49:03 +0100 (CET) From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 7 Jan 2019 11:48:57 +0100 Message-Id: <20190107104857.6456-5-ludo@gnu.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107104857.6456-1-ludo@gnu.org> References: <20190107104857.6456-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 ;;; @@ -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)