From patchwork Sun Jul 14 13:23:06 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: 14641 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 A2BB517232; Sun, 14 Jul 2019 14:24:13 +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,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 0C27A17230 for ; Sun, 14 Jul 2019 14:24:10 +0100 (BST) Received: from localhost ([::1]:60476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmeU5-0006eh-CX for patchwork@mira.cbaines.net; Sun, 14 Jul 2019 09:24:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34433) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmeU2-0006eO-6N for guix-patches@gnu.org; Sun, 14 Jul 2019 09:24:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmeU0-0001OW-WD for guix-patches@gnu.org; Sun, 14 Jul 2019 09:24:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35174) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmeU0-0001OL-S0 for guix-patches@gnu.org; Sun, 14 Jul 2019 09:24:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmeTy-0002c5-H9 for guix-patches@gnu.org; Sun, 14 Jul 2019 09:24:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36555] [PATCH 1/2] guix system: Add 'reconfigure' module. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 14 Jul 2019 13:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36555 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) Received: via spool by 36555-submit@debbugs.gnu.org id=B36555.15631106039994 (code B ref 36555); Sun, 14 Jul 2019 13:24:02 +0000 Received: (at 36555) by debbugs.gnu.org; 14 Jul 2019 13:23:23 +0000 Received: from localhost ([127.0.0.1]:43994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmeTJ-0002b7-Ea for submit@debbugs.gnu.org; Sun, 14 Jul 2019 09:23:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmeTG-0002ao-DT for 36555@debbugs.gnu.org; Sun, 14 Jul 2019 09:23:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hmeTB-0000xl-2A; Sun, 14 Jul 2019 09:23:13 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=59958 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hmeTA-0006k9-Js; Sun, 14 Jul 2019 09:23:12 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= References: <87imsci9sj.fsf@sdf.lonestar.org> <87ef30i9fl.fsf@sdf.lonestar.org> <87y3129qsn.fsf@gnu.org> <87sgr9bziq.fsf@sdf.lonestar.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 26 Messidor an 227 de la =?utf-8?q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 14 Jul 2019 15:23:06 +0200 In-Reply-To: <87sgr9bziq.fsf@sdf.lonestar.org> (Jakob L. Kreuze's message of "Sat, 13 Jul 2019 13:44:13 -0400") Message-ID: <87pnmc7nt1.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 36555@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello! zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) skribis: > Ludovic Courtès writes: [...] >> Can we remove ‘with-output-to-string’? I’d rather see what’s going on. >> :-) >> >> If that’s too verbose, we can use ‘invoke/quiet’. > > I'm not too concerned with verbosity; rather, in the case for 'guix > deploy', the script's output mixes with the REPL output and that causes > 'remote-eval' to fail with a match error. I think it would be better to > continue using 'with-output-to-string', but to preseve its return value > so we can show it to the user from 'guix deploy' or 'guix system > reconfigure'. Users of 'guix deploy' would also be able to see the > script's output this way. Oh, I see. So in a way the problem is that ‘remote-eval’ doesn’t do anything sensible with the output and error ports of that remote evaluation. Ultimately we should probably fix (guix inferior) and (guix remote) so that stdout and stderr are properly transmitted. In the meantime, what about this patch? >> It seems that this sort-of inlines parts of ‘shepherd-service-upgrade’ >> but without traversing the service dependency graph to determine the >> compilete set of obsolete services, no? I feel that we should be >> reusing ‘shepherd-service-upgrade’ or similar bits. (I realize this is >> already in ‘master’ for ‘guix deploy’, but since this is going to be >> shared with ‘guix system’, we’d rather be extra cautious.) > > Does 'live-service-requirement' not encompass the full service > dependency graph? Regardless, I'll look into reusing > 'shepherd-service-upgrade' as it's well-testsed. ‘live-service-requirement’ gives you the graph of the currently loaded services, but you also need the target service graph to determine what to upgrade; that seems to be missing currently. Thanks, Ludo’. diff --git a/guix/remote.scm b/guix/remote.scm index e503c76167..8ada5c0957 100644 --- a/guix/remote.scm +++ b/guix/remote.scm @@ -76,8 +76,14 @@ result to the current output port using the (guix repl) protocol." (with-imported-modules (source-module-closure '((guix repl))) #~(begin (use-modules (guix repl)) - (send-repl-response '(primitive-load #$program) + + ;; We use CURRENT-OUTPUT-PORT for REPL messages, so redirect PROGRAM's + ;; output to CURRENT-ERROR-PORT so that it does not interfere. + (send-repl-response '(with-output-to-port (current-error-port) + (lambda () + (primitive-load #$program))) (current-output-port)) + (force-output)))) (define* (remote-eval exp session