* GUILE_QUIET: need help with redirection
@ 2024-10-06 14:13 Matt Wette
2024-10-06 17:29 ` tomas
0 siblings, 1 reply; 5+ messages in thread
From: Matt Wette @ 2024-10-06 14:13 UTC (permalink / raw)
To: guile-devel
Hi All,
I'm working on an update to guile to output some messages (e.g.,
auto-compile) to a new
`current-info-port', which is set to stderr by default. I also added
update to output the
welcome message, ending in "Enter `,help' for help.". However, this
breaks the
`00-repl-server' test which is looking for that message. The test forks
guile and closes stderr,
so it won't see the message ordinarily. I tried to fix by setting
`current-info-port' to
`current-output-port'. But that does not work. I now see the
welcome message printed to
the screen during the test. I guess the message is sitting in the
stderr output buffer before
the fork happens. So, options are:
1) Leave welcome message as is, going to stdout.
2) Find a way to make 00-repl-server.test work.
3) Initialize current-info-port to stdout (ugly)
4) Add some other hook in system/repl/common.scm(repl-welcome) to deal
with it (ugly)
Any ideas?
Matt
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: GUILE_QUIET: need help with redirection
2024-10-06 14:13 GUILE_QUIET: need help with redirection Matt Wette
@ 2024-10-06 17:29 ` tomas
2024-10-06 17:37 ` Matt Wette
2024-10-06 19:57 ` Dr. Arne Babenhauserheide
0 siblings, 2 replies; 5+ messages in thread
From: tomas @ 2024-10-06 17:29 UTC (permalink / raw)
To: Matt Wette; +Cc: guile-devel
[-- Attachment #1: Type: text/plain, Size: 1550 bytes --]
On Sun, Oct 06, 2024 at 07:13:02AM -0700, Matt Wette wrote:
> Hi All,
>
> I'm working on an update to guile to output some messages (e.g.,
> auto-compile) to a new
> `current-info-port', which is set to stderr by default. I also added
> update to output the
> welcome message, ending in "Enter `,help' for help.". However, this breaks
> the
> `00-repl-server' test which is looking for that message. The test forks
> guile and closes stderr,
> so it won't see the message ordinarily. I tried to fix by setting
> `current-info-port' to
> `current-output-port'. But that does not work. I now see the welcome
> message printed to
> the screen during the test. I guess the message is sitting in the stderr
> output buffer before
> the fork happens. So, options are:
> 1) Leave welcome message as is, going to stdout.
> 2) Find a way to make 00-repl-server.test work.
> 3) Initialize current-info-port to stdout (ugly)
> 4) Add some other hook in system/repl/common.scm(repl-welcome) to deal with
> it (ugly)
>
> Any ideas?
Hm. Tough question. I think what the test reminds us of is that
your default above (stderr) is a backward-incompatible change,
so I'd be very coutious about that. Who knows whose's code this
might break (besides the test).
So leaving `current-info-port' at stdout as default seems the
safest bet.
Perhaps a command-line option to set `current-info-port' to one
of several useful values (i.e. stderr, but also a void port)
might be helpful.
Cheers
--
t
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: GUILE_QUIET: need help with redirection
2024-10-06 17:29 ` tomas
@ 2024-10-06 17:37 ` Matt Wette
2024-10-06 17:51 ` tomas
2024-10-06 19:57 ` Dr. Arne Babenhauserheide
1 sibling, 1 reply; 5+ messages in thread
From: Matt Wette @ 2024-10-06 17:37 UTC (permalink / raw)
To: tomas; +Cc: guile-devel
On 10/6/24 10:29 AM, tomas@tuxteam.de wrote:
> On Sun, Oct 06, 2024 at 07:13:02AM -0700, Matt Wette wrote:
>> Hi All,
>>
>> I'm working on an update to guile to output some messages (e.g.,
>> auto-compile) to a new
>> `current-info-port', which is set to stderr by default. I also added
>> update to output the
>> welcome message, ending in "Enter `,help' for help.". However, this breaks
>> the
>> `00-repl-server' test which is looking for that message. The test forks
>> guile and closes stderr,
>> so it won't see the message ordinarily. I tried to fix by setting
>> `current-info-port' to
>> `current-output-port'. But that does not work. I now see the welcome
>> message printed to
>> the screen during the test. I guess the message is sitting in the stderr
>> output buffer before
>> the fork happens. So, options are:
>> 1) Leave welcome message as is, going to stdout.
>> 2) Find a way to make 00-repl-server.test work.
>> 3) Initialize current-info-port to stdout (ugly)
>> 4) Add some other hook in system/repl/common.scm(repl-welcome) to deal with
>> it (ugly)
>>
>> Any ideas?
> Hm. Tough question. I think what the test reminds us of is that
> your default above (stderr) is a backward-incompatible change,
> so I'd be very coutious about that. Who knows whose's code this
> might break (besides the test).
>
> So leaving `current-info-port' at stdout as default seems the
> safest bet.
>
> Perhaps a command-line option to set `current-info-port' to one
> of several useful values (i.e. stderr, but also a void port)
> might be helpful.
Thanks. All the other internal redirections to info-port in guile
are formerly to stderr. This is the one case where the
redirection is formerly stdout. So, I don't like using stdout for
the exact reason you state above: it is not backward compatible.
Matt
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: GUILE_QUIET: need help with redirection
2024-10-06 17:37 ` Matt Wette
@ 2024-10-06 17:51 ` tomas
0 siblings, 0 replies; 5+ messages in thread
From: tomas @ 2024-10-06 17:51 UTC (permalink / raw)
To: Matt Wette; +Cc: guile-devel
[-- Attachment #1: Type: text/plain, Size: 855 bytes --]
On Sun, Oct 06, 2024 at 10:37:38AM -0700, Matt Wette wrote:
[...]
> Thanks. All the other internal redirections to info-port in guile
> are formerly to stderr. This is the one case where the
> redirection is formerly stdout. So, I don't like using stdout for
> the exact reason you state above: it is not backward compatible.
Oh, you mean the welcome message was going directly to stdout, while
info-port was always going to stderr?
I see. Perhaps we need yet another port, say `greeting-port' (or even
`welcome-port', although that would sound too whimsical to me [1]),
which would go by default to stdout and can be redirected as needed?
Sounds a bit heavy-handed, but would tick all backwards-compat boxes.
Cheers
[1] Whimsical names, like ice-9 or car come back to haunt you,
10 or 50 years later.
--
tomás
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: GUILE_QUIET: need help with redirection
2024-10-06 17:29 ` tomas
2024-10-06 17:37 ` Matt Wette
@ 2024-10-06 19:57 ` Dr. Arne Babenhauserheide
1 sibling, 0 replies; 5+ messages in thread
From: Dr. Arne Babenhauserheide @ 2024-10-06 19:57 UTC (permalink / raw)
To: tomas; +Cc: Matt Wette, guile-devel
[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]
<tomas@tuxteam.de> writes:
> On Sun, Oct 06, 2024 at 07:13:02AM -0700, Matt Wette wrote:
>> 1) Leave welcome message as is, going to stdout.
>> 2) Find a way to make 00-repl-server.test work.
>> 3) Initialize current-info-port to stdout (ugly)
>> 4) Add some other hook in system/repl/common.scm(repl-welcome) to deal with
>> it (ugly)
>>
>> Any ideas?
>
> Hm. Tough question. I think what the test reminds us of is that
> your default above (stderr) is a backward-incompatible change,
> so I'd be very coutious about that. Who knows whose's code this
> might break (besides the test).
I think the test can be a warning that there may be applications which
expect the welcome text to see that Guile is ready. So I agree that we
should not break that.
The use-case of this change is to silence the welcome messages, so just
-I (without argument) could also mean that the greeting message is not
shown.
Or we could use the GUILE_QUIET environment variable for that (as in my
original patch).
Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-10-06 19:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-06 14:13 GUILE_QUIET: need help with redirection Matt Wette
2024-10-06 17:29 ` tomas
2024-10-06 17:37 ` Matt Wette
2024-10-06 17:51 ` tomas
2024-10-06 19:57 ` Dr. Arne Babenhauserheide
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).