From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Zefram Newsgroups: gmane.lisp.guile.bugs Subject: bug#22905: GUILE_INSTALL_LOCALE produces unavoidable noise Date: Fri, 4 Mar 2016 14:13:34 +0000 Message-ID: <20160304141334.GC7946@fysh.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1457100862 13659 80.91.229.3 (4 Mar 2016 14:14:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Mar 2016 14:14:22 +0000 (UTC) To: 22905@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Mar 04 15:14:14 2016 Return-path: Envelope-to: guile-bugs@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 1abqUd-0006Ra-Kk for guile-bugs@m.gmane.org; Fri, 04 Mar 2016 15:14:11 +0100 Original-Received: from localhost ([::1]:41347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abqUZ-00049z-NV for guile-bugs@m.gmane.org; Fri, 04 Mar 2016 09:14:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abqUV-00049r-Mb for bug-guile@gnu.org; Fri, 04 Mar 2016 09:14:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abqUU-0004Wd-P1 for bug-guile@gnu.org; Fri, 04 Mar 2016 09:14:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abqUU-0004WZ-Kw for bug-guile@gnu.org; Fri, 04 Mar 2016 09:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1abqUU-0006Uh-HP for bug-guile@gnu.org; Fri, 04 Mar 2016 09:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Zefram Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 04 Mar 2016 14:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22905 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.145710082824934 (code B ref -1); Fri, 04 Mar 2016 14:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Mar 2016 14:13:48 +0000 Original-Received: from localhost ([127.0.0.1]:60934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1abqUG-0006U6-8W for submit@debbugs.gnu.org; Fri, 04 Mar 2016 09:13:48 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33699) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1abqUF-0006Tv-6H for submit@debbugs.gnu.org; Fri, 04 Mar 2016 09:13:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abqU9-0004V3-4R for submit@debbugs.gnu.org; Fri, 04 Mar 2016 09:13:42 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:33349) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abqU9-0004Uz-1U for submit@debbugs.gnu.org; Fri, 04 Mar 2016 09:13:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abqU7-000444-TH for bug-guile@gnu.org; Fri, 04 Mar 2016 09:13:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abqU6-0004Ue-TO for bug-guile@gnu.org; Fri, 04 Mar 2016 09:13:39 -0500 Original-Received: from river6.fysh.org ([2001:41d0:d:20da::2]:51582 helo=river.fysh.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abqU6-0004UR-Mf for bug-guile@gnu.org; Fri, 04 Mar 2016 09:13:38 -0500 Original-Received: from zefram by river.fysh.org with local (Exim 4.80 #2 (Debian)) id 1abqU2-0007fz-Vg; Fri, 04 Mar 2016 14:13:34 +0000 Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7977 Archived-At: GUILE_INSTALL_LOCALE=1 breaks some of the robustness of non-locale-using programs, marring their stderr output if the environment's locale settings are faulty. Suppose you have a program written in Guile Scheme that doesn't use any locale facilities. To be portable to the GUILE_INSTALL_LOCALE=1 situation (which the documentation threatens will become the default in Guile 2.2), it must be prepared to start up with some locale already selected, and reconfigure from there as required. Being a conscientious programmer, you are of course willing to add the (setlocale LC_ALL "C") and whatever other invocations are required to recover the non-locale state. But then this situation arises: $ LANG=wibble GUILE_INSTALL_LOCALE=1 guile-2.0 -c '(setlocale LC_ALL "C") (write "hi") (newline)' guile: warning: failed to install locale "hi" The warning shown goes to the program's stderr. It does not come from the program's setlocale call, which is succeeding and would signal a perfectly ordinary (catchable) exception if it failed. The warning comes from the implicit setlocale call triggered by GUILE_INSTALL_LOCALE=1, before the program gains control. As far as I can see, there is no way for the program to prevent the failing setlocale attempt or to muffle the warning. Or even to detect that this has happened. Guile should not be saying anything on the program's stderr. This is damaging the program's visible behaviour, and making it impossible to effectively port non-locale programs to new Guile versions. If Guile must attempt this implicit setlocale and continue to run the program if it fails, then it needs to keep quiet about the failure. This is no disadvantage to a program that actually wants to use the environmental locale, because the program is free to call (setlocale LC_ALL "") itself and handle its failure in whatever manner it finds appropriate. Indeed, any such program predating Guile 2.0 must already be performing that call itself, because the implicit setlocale didn't occur then. The same for any program portable to pre-2.0 Guiles. And on Guile 2.0+ such a program still really needs to perform the call itself, because it can't predict how GUILE_INSTALL_LOCALE will be set in the environment, so still can't rely on the implicit setlocale happening. However, if it is deemed to be essential that Guile attempt the implicit setlocale and gripe about its failure, then the message should not precede or otherwise mix with the actual program run. The message should be emitted *instead of* running the program, declaring the absolute incompatibility of the Guile framework with this environmental condition. -zefram