From patchwork Tue Aug 6 20:58:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jakob L. Kreuze" X-Patchwork-Id: 14881 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 3B06417264; Tue, 6 Aug 2019 22:03:08 +0100 (BST) 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 F3A791725C for ; Tue, 6 Aug 2019 22:03:07 +0100 (BST) Received: from localhost ([::1]:36228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hv6br-00044N-LM for patchwork@mira.cbaines.net; Tue, 06 Aug 2019 17:03:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39703) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hv6bn-000447-2M for guix-patches@gnu.org; Tue, 06 Aug 2019 17:03:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hv6bm-00071J-19 for guix-patches@gnu.org; Tue, 06 Aug 2019 17:03:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57310) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hv6bl-00071E-UB for guix-patches@gnu.org; Tue, 06 Aug 2019 17:03:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hv6bl-0006W2-QK for guix-patches@gnu.org; Tue, 06 Aug 2019 17:03:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36872] [PATCH v2 1/2] remote: Build derivations appropriate for the remote's Resent-From: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 06 Aug 2019 21:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36872 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Lemmer Webber Received: via spool by 36872-submit@debbugs.gnu.org id=B36872.156512532824959 (code B ref 36872); Tue, 06 Aug 2019 21:03:01 +0000 Received: (at 36872) by debbugs.gnu.org; 6 Aug 2019 21:02:08 +0000 Received: from localhost ([127.0.0.1]:37895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hv6au-0006UV-5H for submit@debbugs.gnu.org; Tue, 06 Aug 2019 17:02:08 -0400 Received: from ol.sdf.org ([205.166.94.20]:64011 helo=mx.sdf.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hv6as-0006UM-4Y for 36872@debbugs.gnu.org; Tue, 06 Aug 2019 17:02:06 -0400 Received: from Epsilon (pool-173-76-53-40.bstnma.fios.verizon.net [173.76.53.40]) (authenticated (0 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id x76L235R003431 (using TLSv1.2 with cipher AES256-GCM-SHA384 (256 bits) verified NO); Tue, 6 Aug 2019 21:02:04 GMT From: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) References: <87lfwee2yd.fsf@sdf.lonestar.org> <87h872e2v2.fsf@sdf.lonestar.org> <87ef1yovur.fsf@dustycloud.org> Date: Tue, 06 Aug 2019 16:58:54 -0400 In-Reply-To: <87ef1yovur.fsf@dustycloud.org> (Christopher Lemmer Webber's message of "Tue, 06 Aug 2019 16:57:32 -0400") Message-ID: <87o912vwmp.fsf_-_@sdf.lonestar.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) 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: , Cc: 36872@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/ssh.scm (remote-system): New variable. * guix/remote.scm (remote-eval): Use result of 'remote-system' when lowering the G-Expression. (trampoline): Return a rather than a . --- guix/remote.scm | 13 ++++++++----- guix/ssh.scm | 7 +++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/guix/remote.scm b/guix/remote.scm index 5fecd954e9..0a0bdaf30b 100644 --- a/guix/remote.scm +++ b/guix/remote.scm @@ -71,7 +71,7 @@ prerequisites of EXP are already available on the host at SESSION." "Return a \"trampoline\" gexp that evaluates EXP and writes the evaluation result to the current output port using the (guix repl) protocol." (define program - (scheme-file "remote-exp.scm" exp)) + (program-file "remote-exp.scm" exp)) (with-imported-modules (source-module-closure '((guix repl))) #~(begin @@ -96,10 +96,13 @@ all the elements EXP refers to are built and deployed to SESSION beforehand. When BUILD-LOCALLY? is true, said dependencies are built locally and sent to the remote store afterwards; otherwise, dependencies are built directly on the remote store." - (mlet %store-monad ((lowered (lower-gexp (trampoline exp) - #:module-path %load-path)) - (remote -> (connect-to-remote-daemon session - socket-name))) + (mlet* %store-monad ((system -> (remote-system session)) + (lowered (lower-gexp (trampoline exp) + #:system system + #:guile-for-build #f + #:module-path %load-path)) + (remote -> (connect-to-remote-daemon session + socket-name))) (define inputs (cons (lowered-gexp-guile lowered) (lowered-gexp-inputs lowered))) diff --git a/guix/ssh.scm b/guix/ssh.scm index ede00133c8..9b5ca68894 100644 --- a/guix/ssh.scm +++ b/guix/ssh.scm @@ -39,6 +39,7 @@ remote-inferior remote-daemon-channel connect-to-remote-daemon + remote-system send-files retrieve-files retrieve-files* @@ -282,6 +283,12 @@ be read. When RECURSIVE? is true, the closure of FILES is exported." ,(object->string (object->string export)))))) +(define (remote-system session) + "Return the system type as expected by Nix, usually ARCHITECTURE-KERNEL, of +the machine on the other end of SESSION." + (inferior-remote-eval '(begin (use-modules (guix utils)) (%current-system)) + session)) + (define* (send-files local files remote #:key recursive? From patchwork Tue Aug 6 20:59:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jakob L. Kreuze" X-Patchwork-Id: 14882 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 D67F717264; Tue, 6 Aug 2019 22:03:11 +0100 (BST) 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 9217D1725C for ; Tue, 6 Aug 2019 22:03:11 +0100 (BST) Received: from localhost ([::1]:36230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hv6bv-00048n-84 for patchwork@mira.cbaines.net; Tue, 06 Aug 2019 17:03:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39714) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hv6bn-000449-QY for guix-patches@gnu.org; Tue, 06 Aug 2019 17:03:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hv6bm-00071a-HY for guix-patches@gnu.org; Tue, 06 Aug 2019 17:03:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57311) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hv6bm-00071W-EH for guix-patches@gnu.org; Tue, 06 Aug 2019 17:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hv6bm-0006WA-8s for guix-patches@gnu.org; Tue, 06 Aug 2019 17:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36872] [PATCH v2 2/2] remote: Remove '--system' argument. Resent-From: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 06 Aug 2019 21:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36872 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Lemmer Webber Received: via spool by 36872-submit@debbugs.gnu.org id=B36872.156512536425016 (code B ref 36872); Tue, 06 Aug 2019 21:03:02 +0000 Received: (at 36872) by debbugs.gnu.org; 6 Aug 2019 21:02:44 +0000 Received: from localhost ([127.0.0.1]:37898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hv6bT-0006VM-FZ for submit@debbugs.gnu.org; Tue, 06 Aug 2019 17:02:43 -0400 Received: from ol.sdf.org ([205.166.94.20]:63847 helo=mx.sdf.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hv6bR-0006VE-OZ for 36872@debbugs.gnu.org; Tue, 06 Aug 2019 17:02:42 -0400 Received: from Epsilon (pool-173-76-53-40.bstnma.fios.verizon.net [173.76.53.40]) (authenticated (0 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id x76L2dYA017058 (using TLSv1.2 with cipher AES256-GCM-SHA384 (256 bits) verified NO); Tue, 6 Aug 2019 21:02:40 GMT From: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) References: <87lfwee2yd.fsf@sdf.lonestar.org> <87h872e2v2.fsf@sdf.lonestar.org> <87ef1yovur.fsf@dustycloud.org> <87o912vwmp.fsf_-_@sdf.lonestar.org> Date: Tue, 06 Aug 2019 16:59:31 -0400 In-Reply-To: <87o912vwmp.fsf_-_@sdf.lonestar.org> (Jakob L. Kreuze's message of "Tue, 06 Aug 2019 16:58:54 -0400") Message-ID: <87imravwlo.fsf_-_@sdf.lonestar.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) 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: , Cc: 36872@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/services.scm (activation-script): Return a rather than a . * gnu/deploy.scm (guix-deploy): Remove handling for '--system'. (show-help): Remove documentation for '--system'. (%default-options): Remove default setting for 'system'. --- gnu/services.scm | 56 ++++++++++++++++++++--------------------- guix/scripts/deploy.scm | 8 ++---- 2 files changed, 30 insertions(+), 34 deletions(-) diff --git a/gnu/services.scm b/gnu/services.scm index 7de78105ff..6ee05d4580 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -430,34 +430,34 @@ ACTIVATION-SCRIPT-TYPE." (define (activation-script gexps) "Return the system's activation script, which evaluates GEXPS." (define actions - (map (cut scheme-file "activate-service" <>) gexps)) - - (scheme-file "activate" - (with-imported-modules (source-module-closure - '((gnu build activation) - (guix build utils))) - #~(begin - (use-modules (gnu build activation) - (guix build utils)) - - ;; Make sure the user accounting database exists. If it - ;; does not exist, 'setutxent' does not create it and - ;; thus there is no accounting at all. - (close-port (open-file "/var/run/utmpx" "a0")) - - ;; Same for 'wtmp', which is populated by mingetty et - ;; al. - (mkdir-p "/var/log") - (close-port (open-file "/var/log/wtmp" "a0")) - - ;; Set up /run/current-system. Among other things this - ;; sets up locales, which the activation snippets - ;; executed below may expect. - (activate-current-system) - - ;; Run the services' activation snippets. - ;; TODO: Use 'load-compiled'. - (for-each primitive-load '#$actions))))) + (map (cut program-file "activate-service.scm" <>) gexps)) + + (program-file "activate.scm" + (with-imported-modules (source-module-closure + '((gnu build activation) + (guix build utils))) + #~(begin + (use-modules (gnu build activation) + (guix build utils)) + + ;; Make sure the user accounting database exists. If it + ;; does not exist, 'setutxent' does not create it and + ;; thus there is no accounting at all. + (close-port (open-file "/var/run/utmpx" "a0")) + + ;; Same for 'wtmp', which is populated by mingetty et + ;; al. + (mkdir-p "/var/log") + (close-port (open-file "/var/log/wtmp" "a0")) + + ;; Set up /run/current-system. Among other things this + ;; sets up locales, which the activation snippets + ;; executed below may expect. + (activate-current-system) + + ;; Run the services' activation snippets. + ;; TODO: Use 'load-compiled'. + (for-each primitive-load '#$actions))))) (define (gexps->activation-gexp gexps) "Return a gexp that runs the activation script containing GEXPS." diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm index 52bba3f3bf..52d5e1e1da 100644 --- a/guix/scripts/deploy.scm +++ b/guix/scripts/deploy.scm @@ -42,8 +42,6 @@ (define (show-help) (display (G_ "Usage: guix deploy [OPTION] FILE... Perform the deployment specified by FILE.\n")) - (display (G_ " - -s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\"")) (show-build-options-help) (newline) (display (G_ " @@ -65,8 +63,7 @@ Perform the deployment specified by FILE.\n")) %standard-build-options)) (define %default-options - `((system . ,(%current-system)) - (substitutes? . #t) + `((substitutes? . #t) (build-hook? . #t) (graft? . #t) (debug . 0) @@ -88,7 +85,6 @@ Perform the deployment specified by FILE.\n")) (set-build-options-from-command-line store opts) (for-each (lambda (machine) (info (G_ "deploying to ~a...") (machine-display-name machine)) - (parameterize ((%current-system (assq-ref opts 'system)) - (%graft? (assq-ref opts 'graft?))) + (parameterize ((%graft? (assq-ref opts 'graft?))) (run-with-store store (deploy-machine machine)))) machines))))