From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: add command line option to quiet compiler messages Date: Sat, 23 Jul 2016 12:29:41 +0200 Message-ID: <87zip8tzoq.fsf@pobox.com> References: <20160713040806.GA13513@eros.local> <87k2go1qu1.fsf@pobox.com> <20160720064124.GA1213@eros.local> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1469269815 16215 80.91.229.3 (23 Jul 2016 10:30:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Jul 2016 10:30:15 +0000 (UTC) Cc: guile-devel@gnu.org To: Tobin Harding Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jul 23 12:30:03 2016 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bQuC2-0002Oi-VN for guile-devel@m.gmane.org; Sat, 23 Jul 2016 12:30:03 +0200 Original-Received: from localhost ([::1]:51266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQuC2-0003K1-4H for guile-devel@m.gmane.org; Sat, 23 Jul 2016 06:30:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQuBx-0003Jw-CA for guile-devel@gnu.org; Sat, 23 Jul 2016 06:29:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQuBt-0000N8-0f for guile-devel@gnu.org; Sat, 23 Jul 2016 06:29:56 -0400 Original-Received: from pb-sasl1.pobox.com ([64.147.108.66]:58833 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQuBs-0000MS-Ph for guile-devel@gnu.org; Sat, 23 Jul 2016 06:29:52 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id E2118204F8; Sat, 23 Jul 2016 06:29:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=7ZWkHwXUTSAmVd5atQZwwW2tqRU=; b=NubVnC VZ1vsQnN+V9O46Kt8uSTJ8gBmmNixtKjG0CQE7hWJh5T0ij2Pob0e6afANhAZaUu w7aL8zpIt7B0PSAQXqizKgAllDG9WiqSxNgry8xBwZ18t4zm8ilAjOJmsGMuC+od j8ZpWKu2WrVA21F7yOoP0SDtTYW6Aowes0xnc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=XVVRyQWMK0nIgTVw109QNyz9xFbJi03s um0JRd4qMCbdnBI9OBWW+Kiq9bBn42B581kcb+xQE2P2eTnPJ2hoi22b9ay8DfFT 849b6w1+/N1wTZdexrNNQ1V/K9MAmZis8XNTIxYxV+A+STFBlt6FfsZmn11mupy1 ya593kAN49w= Original-Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id CBEB9204F5; Sat, 23 Jul 2016 06:29:49 -0400 (EDT) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id CCF10204F4; Sat, 23 Jul 2016 06:29:48 -0400 (EDT) In-Reply-To: <20160720064124.GA1213@eros.local> (Tobin Harding's message of "Wed, 20 Jul 2016 16:41:24 +1000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Pobox-Relay-ID: 62175452-50C0-11E6-B2C5-C1836462E9F6-02397024!pb-sasl1.pobox.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.108.66 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:18600 Archived-At: Hi :) On Wed 20 Jul 2016 08:41, Tobin Harding writes: > On Thu, Jul 14, 2016 at 12:01:10PM +0200, Andy Wingo wrote: >> On Wed 13 Jul 2016 06:08, Tobin Harding writes: >> >> > While working on this I discovered that compile messages are output from two >> > separate places (load.c and boot-9.scm). Each file contains identical strings >> > for the messages. This goes against the rule of SPOT. >> >> Sadly it has to be like this for now. I do not have suggestions to fix >> it; it's gnarly. > > Ok, Will forget about this. I would love to know why though, solely out of interest. Guile needs the ability to detect when files are out of date very early in C, before any other Scheme file is loaded (compiled or not). We need to do it from Scheme too, as you see in this code. The natural thing would be to define primitives to emit the warnings in C and export them to Scheme (or vice versa) but that means that the primitive would then be in the default environment for everyone -- and we really don't want to add things to the default environment at this point, it creates maintenance hazards. So copying strings is the lesser evil in a way. >> Please resend without tabs, please. Thanks :) > > I'm not sure about this one. I manually put spaces in front of each line as > directed but it does not show up as a change in 'git diff'. Is the rest of the > patch correct in regards to Guile project tab/space guidelines. (I couldn't find > any such guideline, is there some specific Emacs setup I should be using for > Guile development?) Hum, I see that our .dir-locals.el is currently: ((nil . ((fill-column . 72) (tab-width . 8))) (c-mode . ((c-file-style . "gnu"))) (scheme-mode . ((indent-tabs-mode . nil) (eval . (put 'pass-if 'scheme-indent-function 1)) (eval . (put 'pass-if-exception 'scheme-indent-function 2)) (eval . (put 'pass-if-equal 'scheme-indent-function 2)) (eval . (put 'with-test-prefix 'scheme-indent-function 1)) (eval . (put 'with-code-coverage 'scheme-indent-function 1)) (eval . (put 'with-statprof 'scheme-indent-function 1)))) (emacs-lisp-mode . ((indent-tabs-mode . nil))) (texinfo-mode . ((indent-tabs-mode . nil) (fill-column . 72)))) But we are missing an (indent-tabs-mode . nil) in the c-mode part I think. That is the proper fix ;) In my emacs I customized the default indent-tabs-mode to nil globally; but that's a personal preference. > I've changed it to; > > --quiet inhibit informational compiler output, e.g name of > files being compiled > > Open to suggestions still. Unlike most programmers I find documenting > my work harder than writing the code :) Oh I entirely agree :) FWIW I think this is a fine description of the option. >> > + ((string=? arg "--quiet") >> > + (set! %quiet #t) >> > + (parse args out)) >> > + >> >> Probably %quiet should be a parameter, and unless we plan on using it >> for other purposes it should have a more specific name >> (%verbose-auto-compilation-messages or so; no idea). > > Could you clarify please, a parameter to what? See "Parameters" in the manual. They are dynamically scoped thread-local variables. >> Or, you could always just (current-warning-port (%make-void-port "w")); >> then the patch is super simple, no conditions needed. That is what I >> was originally thinking, but it has the disadvantage that you lose other >> uses of the current warning port, but maybe that's an advantage too. > > Won't we loose compiler warnings then? I did not want to inhibit those. Humm! Good point. But maybe some people want to silence those too? As far as documentation goes, the right place is the doc/ref/ directory, specifically doc/ref/guile-invoke.texi. I will apply your patch as-is once we have docs, unless we can figure out some more general "chattiness" or verbosity knob that makes sense for other messages that Guile issues. I suspect that the "real" solution for user code is to use a logging module that suits the user's needs, but for Guile we also have some needs that we should solve in a simple way. Could be that this patch is the one :) Thanks for your patience in contributing! Andy