bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22905: GUILE_INSTALL_LOCALE produces unavoidable noise


From: Andy Wingo
Subject: bug#22905: GUILE_INSTALL_LOCALE produces unavoidable noise
Date: Tue, 09 Aug 2016 19:39:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

On Mon 08 Aug 2016 23:02, Zefram <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]