unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Zefram <zefram@fysh.org>
Cc: 22905@debbugs.gnu.org
Subject: bug#22905: GUILE_INSTALL_LOCALE produces unavoidable noise
Date: Tue, 09 Aug 2016 19:39:50 +0200	[thread overview]
Message-ID: <87ziollu3d.fsf@pobox.com> (raw)
In-Reply-To: <20160808210229.GH24721@fysh.org> (zefram@fysh.org's message of "Mon, 8 Aug 2016 22:02:29 +0100")

On Mon 08 Aug 2016 23:02, Zefram <zefram@fysh.org> writes:

> Andy Wingo wrote:
>>Serious question tho: what sort of back-compatibility can there be with
>>a Guile that only supports latin-1 strings?
>
> I'd expect that almost any program that runs on Guile 1.8 ought to be
> portable, with only minimal modifications, to later versions of Guile.

I'm with you :)  We did (and do) our best but some problems remain.  I'm
not sure which ones are incidental and which ones are essential.
Probably some are essential though and need to be minimized and then
documented.

> The particular problem that arises is that a possible form for a
> warning-muffling switch would be a command-line switch that goes on the
> #! line.  Any new switch of that nature wouldn't be recognised by Guile
> 1.8, and would cause an error when attempting to run the program on 1.8.

Just thinking out loud here, what about something like:

#!/bin/sh
export FOO=bar
exec guile $0 "$@"
!#

Various FOO=bar things that could work for you:

  LC_ALL=C
  GUILE_INSTALL_LOCALE=0

It doesn't work if you run "guile myscript.scm" but it would work as a
./myscript.scm.

>>How would this work?
>
> I imagine a builtin function that returns a truth value saying whether
> the Guile framework has emitted a warning before running the program.
> Suppose it's called "program-running-with-unclean-output".  Then those
> who particularly want clean output can write something like
>
>     (when (program-running-with-unclean-output)
>       (error "can't run after warnings"))
>
> This doesn't avoid the warning appearing, but does avoid treating a
> run marred by the warning as a successful program run.  The program's
> checking code can easily be made portable back to Guile versions lacking
> the new function, by using cond-expand, false-if-exception, or other
> metaprogramming facilities.

This is certainly possible to do.  Actually I would guess that this
works:

  (setlocale LC_ALL "")

E.g.

$ GUILE_INSTALL_LOCALE=1 LC_ALL=sadfadf guile -c '(setlocale LC_ALL "")'
guile: warning: failed to install locale
Backtrace:
In ice-9/boot-9.scm:
 157: 7 [catch #t #<catch-closure 24c1900> ...]
In unknown file:
   ?: 6 [apply-smob/1 #<catch-closure 24c1900>]
In ice-9/boot-9.scm:
  63: 5 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 4 [eval # #]
In unknown file:
   ?: 3 [call-with-input-string "(setlocale LC_ALL \"\")" ...]
In ice-9/command-line.scm:
 180: 2 [#<procedure 24d2400 at ice-9/command-line.scm:175:6 (port)> #<input: string 2271680>]
In unknown file:
   ?: 1 [eval (setlocale LC_ALL "") #<directory (guile-user) 24b4c60>]
   ?: 0 [setlocale 6 ""]

ERROR: In procedure setlocale:
ERROR: In procedure setlocale: Invalid argument

Does any of this work for you?

Andy





  reply	other threads:[~2016-08-09 17:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04 14:13 bug#22905: GUILE_INSTALL_LOCALE produces unavoidable noise Zefram
2016-08-07 21:58 ` Andy Wingo
2016-08-07 23:00   ` Zefram
2016-08-08 20:17     ` Andy Wingo
2016-08-08 21:02       ` Zefram
2016-08-09 17:39         ` Andy Wingo [this message]
2016-08-09 19:26           ` Zefram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ziollu3d.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=22905@debbugs.gnu.org \
    --cc=zefram@fysh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).