From patchwork Tue Jan 29 22:46:03 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: 921 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 804E516B12; Tue, 29 Jan 2019 22:47:16 +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 3BB5A16B0F for ; Tue, 29 Jan 2019 22:47:16 +0000 (GMT) Received: from localhost ([127.0.0.1]:56706 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goc9z-0005SM-S1 for patchwork@mira.cbaines.net; Tue, 29 Jan 2019 17:47:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goc9x-0005S0-HS for guix-patches@gnu.org; Tue, 29 Jan 2019 17:47:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goc9v-0003Of-Gl for guix-patches@gnu.org; Tue, 29 Jan 2019 17:47:13 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51665) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1goc9o-0003JB-GE for guix-patches@gnu.org; Tue, 29 Jan 2019 17:47:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1goc9o-0002pI-Ci for guix-patches@gnu.org; Tue, 29 Jan 2019 17:47:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34249] [PATCH] guix package: Avoid spinner at end of output. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 29 Jan 2019 22:47:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34249 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Danny Milosavljevic Received: via spool by 34249-submit@debbugs.gnu.org id=B34249.15488019708338 (code B ref 34249); Tue, 29 Jan 2019 22:47:04 +0000 Received: (at 34249) by debbugs.gnu.org; 29 Jan 2019 22:46:10 +0000 Received: from localhost ([127.0.0.1]:50945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1goc8w-0002A1-7M for submit@debbugs.gnu.org; Tue, 29 Jan 2019 17:46:10 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:34952) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1goc8s-00027J-F9; Tue, 29 Jan 2019 17:46:08 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id CD75C8F64; Tue, 29 Jan 2019 23:46: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 DsW5Ihxx24Wj; Tue, 29 Jan 2019 23:46:05 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id A6FC95E5A; Tue, 29 Jan 2019 23:46:04 +0100 (CET) From: Ludovic =?utf-8?q?Court=C3=A8s?= References: <20190129195031.21496-1-mail@cbaines.net> <20190129211645.08cdbd2d@scratchpost.org> Date: Tue, 29 Jan 2019 23:46:03 +0100 In-Reply-To: <20190129211645.08cdbd2d@scratchpost.org> (Danny Milosavljevic's message of "Tue, 29 Jan 2019 21:16:45 +0100") Message-ID: <8736pbm6ac.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (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: 33470@debbugs.gnu.org, 34249@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Danny Milosavljevic skribis: > Hi Christopher, >> diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm >> index a633d2ee6d..4db0e72e9b 100644 >> --- a/guix/scripts/package.scm >> +++ b/guix/scripts/package.scm >> @@ -159,6 +159,7 @@ hooks\" run when building the profile." >> (switch-symlinks profile (basename name)) >> (unless (string=? profile %current-profile) >> (register-gc-root store name)) >> + (display "\r") ; erase the spinner > > In order to actually erase it, might want to do (display "\r\x1b[K") instead. And to do that, you can use (erase-current-line port). Though actually I think this should be done in ‘print-build-event’ in (guix status). Probably something like the patch below, but I haven’t been able to quickly reproduce the initial problem. Could you give it a spin (ah ha!) and report back? If it doesn’t solve the issue, we should strace the thing to see why it keeps spinning after everything is “done” basically. Thanks, Ludo’. diff --git a/guix/status.scm b/guix/status.scm index e3375816c5..7a330525b0 100644 --- a/guix/status.scm +++ b/guix/status.scm @@ -465,8 +465,14 @@ addition to build events." (_ (spin! port)))))) - (unless print-log? - (display "\r" port)) ;erase the spinner + (define erase-current-line* + (if (isatty?* port) + (lambda (port) + (erase-current-line port) + (force-output port)) + (const #t))) + + (erase-current-line* port) ;clear the spinner (match event (('build-started drv . _) (let ((properties (derivation-properties