From owner-freebsd-current@FreeBSD.ORG Thu Dec 19 00:38:12 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A4FFB2; Thu, 19 Dec 2013 00:38:12 +0000 (UTC) Received: from mail-lb0-x233.google.com (mail-lb0-x233.google.com [IPv6:2a00:1450:4010:c04::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A213170E; Thu, 19 Dec 2013 00:38:11 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id w7so159986lbi.24 for ; Wed, 18 Dec 2013 16:38:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=VtHPQGEEUrYXiWouE1HaFiwGe9gHdrK9nzTIFFeV300=; b=mUX2SJGqpN+eOOZhhb5bcp1rKNOE/VHkSu5DRNNM5CWWnSgNYC4R/eNzz2WfTx6MBY I+O/g02RV6sbEukUKzm5tElh+9AZwtC7MlcSoxxax3Kh5ufZZWNMdGoyzmyULywE5Rfo jK/V9bLteq6Gmt5tCwgnUB8GVMo0YDDHMmrHpYZiqCVTDjuIcyWHHV6jNx27XAoscxAm 5PbdbzGYeCMX1o+rWlzClVcqyeVABT8OvzVxzEgdPNn0K8rHeYEakbbJLZwuCrvcAoPs v+EI79oKQCINUvQ4TAskQycAW5Pa/RexssfHwDPCPcbSIOHiApfLFM04IrFkHlr6r55f dYQw== MIME-Version: 1.0 X-Received: by 10.152.87.211 with SMTP id ba19mr12529741lab.13.1387413489193; Wed, 18 Dec 2013 16:38:09 -0800 (PST) Sender: rizzo.unipi@gmail.com Received: by 10.114.175.180 with HTTP; Wed, 18 Dec 2013 16:38:09 -0800 (PST) In-Reply-To: References: <20131216184626.GA17125@onelab2.iet.unipi.it> Date: Thu, 19 Dec 2013 01:38:09 +0100 X-Google-Sender-Auth: cAXkxEcIIrrdyak96n7M8hBXa1g Message-ID: Subject: Re: RFC: less chatty system builds From: Luigi Rizzo To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: FreeBSD Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 00:38:12 -0000 On Mon, Dec 16, 2013 at 10:35 PM, Dimitry Andric wrote: > On 16 Dec 2013, at 19:46, Luigi Rizzo wrote: > > The following is a proof-of-concept patch to make system builds > > less chatty. > > > > It also has the nice side effect of showing more clearly > > which rules are used during the build and possibly help > > debugging the share/mk files and the individual Makefiles. > > > > The logic is the following: > > the environment/make variable SILENT (or any other name we may want > > to use; linux defaults to quiet mode and uses V=1 to be as verbose > > as we are), > > I cannot imagine I am the only one that dislikes Linux's approach of not > showing exactly what it is doing, so I have no objection, as long as it > is not the default. (I really hate having to hunt around for the magic > option to enable verbose output if I want to know how a program is > compiled...) > thanks for the feedback. Sure, default should remain unchanged per POLA. As for the 'magic option to enable verbose output', i think it is just a matter of being familiar with the specific system. We have far less mnemonic options in FreeBSD (MAKEOBJDIRPREFIX, KERNFAST) than the V=1 required by linux. > Also, if you want "silent" builds, you should use make -s instead. That > is much less chatty than (IMHO) useless "CC foo", "LD bar" messages. The issue with verbosity is that depending on the circumstances you need different levels. Definitely there must be something moving in all cases (progress bar or percentage or scrolling text); then in case of errors you may need to know the exact command line, perhaps with something more such as what rule was used etc; and maybe an intermediate output in other cases. Our default is extremely verbose, even without -v, as it shows the full command line for almost every command (the mk files have relatively few @ prefixes). It is extremely hard to spot warnings in the output. In fact, it is so verbose that make -v is very similar. The following is the output of "make toolchain" with and without -v > ls -l /tmp/build* -rw-r--r-- 1 luigi wheel 13058140 Dec 19 01:07 /tmp/build-gcc-v.out -rw-r--r-- 1 luigi wheel 12360113 Dec 19 01:23 /tmp/build-gcc.out > wc /tmp/build-gcc.out 24825 478479 12360113 /tmp/build-gcc.out > wc /tmp/build-gcc-v.out 57676 576964 13058140 /tmp/build-gcc-v.out as you can see the difference in size is only 10% (though there are twice as many lines). make -s as you suggest is more silent, but in some places it can be minutes between individual lines. Below is the output with a small modification to print a timestamp on each ECHODIR line: ... 00:02:18 ===> lib/clang (all) 00:02:18 ===> lib/clang/libclanganalysis (all) 00:02:59 ===> lib/clang/libclangarcmigrate (all) 00:04:54 ===> lib/clang/libclangast (all) 00:07:27 ===> lib/clang/libclangbasic (all) 00:07:40 ===> lib/clang/libclangcodegen (all) 00:10:16 ===> lib/clang/libclangdriver (all) 00:10:30 ===> lib/clang/libclangedit (all) 00:10:34 ===> lib/clang/libclangfrontend (all) 00:11:29 ===> lib/clang/libclangfrontendtool (all) 00:11:30 ===> lib/clang/libclanglex (all) 00:11:55 ===> lib/clang/libclangparse (all) 00:12:33 ===> lib/clang/libclangrewritecore (all) 00:12:36 ===> lib/clang/libclangrewritefrontend (all) 00:13:00 ===> lib/clang/libclangsema (all) 00:16:35 ===> lib/clang/libclangserialization (all) 00:17:19 ===> lib/clang/libclangstaticanalyzercheckers (all) 00:20:51 ===> lib/clang/libclangstaticanalyzercore (all) 00:22:36 ===> lib/clang/libclangstaticanalyzerfrontend (all) 00:22:47 ===> lib/clang/libllvmanalysis (all) ... (and we are not done yet)... The following patch might be of some help to indicate progress: Index: /home/luigi/FreeBSD/head/share/mk/sys.mk =================================================================== --- /home/luigi/FreeBSD/head/share/mk/sys.mk (revision 259578) +++ /home/luigi/FreeBSD/head/share/mk/sys.mk (working copy) @@ -84,12 +84,12 @@ CPP ?= cpp .if empty(.MAKEFLAGS:M-s) -ECHO ?= echo -ECHODIR ?= echo +ECHO ?= echo `date +%H:%M:%S ` +ECHODIR ?= echo `date +%H:%M:%S ` .else ECHO ?= true .if ${.MAKEFLAGS:M-s} == "-s" -ECHODIR ?= echo +ECHODIR ?= echo `date +%H:%M:%S ` .else ECHODIR ?= true .endif So coming back to my original proposal, I was suggesting the intermediate mode to give people a better idea of what is going on during the build, and make warnings and error messages stand out in the output. In any case, if anything like this is implemented, I would really prefer > something like CMake does, e.g. give you a percentage counter that > provides some information about how 'far' the build is progressing. > Sure it would be great to also have that (as another extreme, even less verbose than -s), but I believe it is impossible to implement it, because the build system has no idea of how big is the dependency tree without doing a full pass through it. (This apart from the obvious issue that it is time that matters, not the number of commands/targets). cheers luigi > > -Dimitry > > -- -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2211611 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+-------------------------------