From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 0/5] Automake custom test driver using SRFI-64. Date: Sat, 02 Apr 2016 15:22:25 +0200 Message-ID: <877fgggn72.fsf@gnu.org> References: <1458776330-5005-1-git-send-email-mthl@gnu.org> <87fuv5kq85.fsf@gnu.org> <871t6ol1i5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amLVa-0003s6-Ip for guix-devel@gnu.org; Sat, 02 Apr 2016 09:22:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amLVV-0006uZ-JE for guix-devel@gnu.org; Sat, 02 Apr 2016 09:22:34 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amLVV-0006uV-Fy for guix-devel@gnu.org; Sat, 02 Apr 2016 09:22:29 -0400 In-Reply-To: <871t6ol1i5.fsf@gnu.org> (Mathieu Lirzin's message of "Sat, 02 Apr 2016 12:59:46 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mathieu Lirzin Cc: guix-devel@gnu.org Mathieu Lirzin skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Mathieu Lirzin skribis: >> >>> It is possible to directly checkout 'origin/wip-check' branch to review= these >>> patches. Thanks. >>> >>> Mathieu Lirzin (5): >>> tests: Silence %cpio-program. >>> build: Add a Guile custom test driver using SRFI-64. >>> tests: Silence guix-daemon. >>> tests: Silence %have-nix-hash?. >>> tests: Silence tar. >> >> I=E2=80=99m looking at it now. My first question is whether we could av= oid >> silencing everything? >> >> I guess I got used to having an extra .log file containing =E2=80=9Cnois= e=E2=80=9D, in >> addition to the well-formatted .log file, and it=E2=80=99s proved useful= on a >> few occasions. > > Indeed, that would be great and desirable to have all the extra > information in the log file. 'build-aux/test-driver' achieves it by > simply forking and redirecting stdout and stderr to the log file, like > this: > > # Test script is run here. > "$@" >$log_file 2>&1 > estatus=3D$? > > I don't know if it is possible to replicate a redirection of all the > error noises without forking the process. for now I am using something > similar to this: > > (let ((log (open-output-file "tests/foo.log"))) > (parameterize ((current-output-port log) > (current-error-port log) > (current-warning-port log)) > (load-from-path "tests/foo.scm") > ...)) > > But for example if tests/foo.scm calls =E2=80=98system=E2=80=99, the outp= ut will be > displayed to the terminal not to the log file. Do you know a way to fix > that? Indeed, I=E2=80=99ve thought about it, but in fact most or all of the =E2= =80=9Cuseful noise=E2=80=9D happens via =E2=80=98current-output-port=E2=80=99 and =E2=80= =98current-error-port=E2=80=99, so we=E2=80=99re not losing much. If we want a 100% solution that works with child processes (like =E2=80=98cpio=E2=80=99), we should redirect the underlying file descriptors= instead of the ports: (let ((log (open-output-file "tests/foo.log" "w0"))) ;unbuffered (redirect-port (current-output-port) log) (redirect-port (current-error-port) log) ;; =E2=80=A6 ) I haven=E2=80=99t tried, but it should do the job. (If it doesn=E2=80=99t,= =E2=80=98close-fdes=E2=80=99 + =E2=80=98dup2=E2=80=99 would certainly work.) If you take this route, then the patches that silence =E2=80=98cpio=E2=80= =99 and =E2=80=98nix-hash=E2=80=99 are probably no longer needed. Up to you! Thanks, Ludo=E2=80=99.