From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Baines Subject: bug#33470: [bug#34249] [PATCH] guix package: Avoid spinner at end of output. Date: Wed, 06 Feb 2019 13:16:23 +0000 Message-ID: <87o97p5a6w.fsf@cbaines.net> References: <20190129195031.21496-1-mail@cbaines.net> <20190129211645.08cdbd2d@scratchpost.org> <8736pbm6ac.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:53073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grN4c-0000nI-1o for bug-guix@gnu.org; Wed, 06 Feb 2019 08:17:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grN4a-0005YK-Nz for bug-guix@gnu.org; Wed, 06 Feb 2019 08:17:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34858) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1grN4Y-0005XW-MF for bug-guix@gnu.org; Wed, 06 Feb 2019 08:17:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1grN4Y-0002jF-I4 for bug-guix@gnu.org; Wed, 06 Feb 2019 08:17:02 -0500 Sender: "Debbugs-submit" Resent-To: bug-guix@gnu.org Resent-Message-ID: In-reply-to: <8736pbm6ac.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 34249-done@debbugs.gnu.org, 33470-done@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > 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=3D? 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") ins= tead. > > And to do that, you can use (erase-current-line port). > > Though actually I think this should be done in =E2=80=98print-build-event= =E2=80=99 in > (guix status). Probably something like the patch below, but I haven=E2= =80=99t > been able to quickly reproduce the initial problem. > > Could you give it a spin (ah ha!) and report back? > > If it doesn=E2=80=99t solve the issue, we should strace the thing to see = why it > keeps spinning after everything is =E2=80=9Cdone=E2=80=9D basically. > > Thanks, > Ludo=E2=80=99. > > 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 I've tried out the change you pushed here [1], and it looks good to me :) I can't see anything odd in the output now. 1: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D7473bce207af8463= 12d5167a398f5f20bbf3e896 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlxa3idfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XcCKg//UcAy3A+7uwHp/2CeCUdXeDldJWZhDeDIcIs+sw8dRbz49GCsyaWdZSDm +1qBkE3rB94dffrrcsZbnDQWYy8kM6QtDb4nU7dIz5lz5FVeU6oYwXihSpFEx3BK F4/gL+414ts9qonjJ+1bId+Mh0LEX6J0LosWvqwZfqgJVftsFMytoiPPsFyrZMzX UyONnu6kBewgv3LYVIp2XyHgTjPUUx6Pfbvj4d7UY9jzx4+O7iFx1pdesGMNaVlG g0Kcu0nrX1JpoLBbJ1SVfxdQ+1oyjgJFEtINmnlJC94WNeANi+l+hjpYUNXSmUPz ZEV8EDRWvFh4xm4RlWWMU/dblKkalu7qEItRYthA1nQgSfbEe0O2Dg7R17LMXd96 9ebwzSZ15CwpylU9e/b8Ga+tvTBJDthxZejs/YRWq0tYHTHdyrewz+A9PpMiw3Vb Bs8UTCaco+KwqDVf9Fk21WS+OhxSap9zum3rEG1IK9dBLq+wfv+IQSWFX4RNBpBu bhH/uHASLYoWMmf5FOhQrGlht91DUd859G+fEagaMUMJaxhtVjnGRi5/Ru3ZPHil AlXM6xfRZ2m9fJux/n76rtS6WNO9ZIWFpTsleFWh3gr9fFCQtrPYyjaWSRLNP/qa PzgX2TaoNxgcIFGq5GIyEtGbEhlAdF3Udqoap9pdZV+GCUkdOvY= =b28M -----END PGP SIGNATURE----- --=-=-=--