IRC channel logs

2023-10-24.log

back to list of logs

<tohoyn>daviid: there are source code files with same names in directories examples/adw-1/adw1-demo and examples/adw-1/adw1-demo/ui. Is this a bug?
<apteryx>guilers, if you too haven't see geiser-xref-callers or geiser-xref-callees returning any result, there's this issue: https://gitlab.com/emacs-geiser/guile/-/issues/35
<apteryx>you may want to share your experience or better yet, a reproducer.
<apteryx>haven't seen*
<apteryx>I'm experimenting for the first time with 'Guile Lib's logging library, and would have expected the following script stub to produce something to stderr and error out due to not being able to log ot the file under /var/log when run as my user: https://paste.debian.net/1296051/
<apteryx>none of the above happens: what I am doing wrong?
<apteryx>ah, forgot to call setup-logging ^^'
<apteryx>in main
<apteryx>works better now
<apteryx>how can I emulate Bash's: trap EXIT 'some command' in Guile? I've tried: (sigaction SIGTERM (lambda _ (shutdown-logging))) but it doesn't get called it seems
<apteryx>I want to ensure (shutdown-logging) gets run no matter how the script terminates
<old>apteryx: Even it the process crash?
<apteryx>yes, even if there's an exception
<apteryx>that's what "trap EXIT 'arbitrary commands'" does in Bash
<apteryx>perhaps it's best to wrap my main in dynamic-wind ?
<old>by crash I meant segfault
<old>but I guess that there is hook for on exit
<apteryx>yeah that's what I was looking for; maybe I should look at bash's sources
<apteryx>I wouldn't know how to do it in C either, which is what Guile emulates
<apteryx>shouldn't I be able to specify one or more argumens to a procedure defined as: (define (invoke command ...) [...]) ?
<apteryx>calling it with (invoke "command") complains about a wrong number of arguments
<apteryx>is there no longer any references to books from https://www.scheme.org/?
<apteryx>I think that's where I used to find 'The Scheme Programming Language'; it's still there but I see no links to it from the main page: https://www.scheme.com/tspl4/
<RhodiumToad>apteryx: inside a syntax-rules macro you can only use syntax. to use arbitrary procedures you need syntax-case macros instead
<RhodiumToad>apteryx: to have a variable number of args, use (define (invoke command . args) ...) or define*
<dsmith-work>sneek, botsnack
<sneek>:)
<dsmith-work>!uptime
<sneek>I've been a process for 7 days
<sneek>This system has been up 29 weeks, 3 days, 1 hour, 48 minutes
<dsmith-work>Tuesday greetings, Guilers
<apteryx>RhodiumToad: thanks! I settled for (invoke command . args), as done in (guix build utils)
<apteryx>should I worry about calling shutdown-logging at all on exiting my program, given Guile should flush and close all ports itself, right?
<RhodiumToad>it should (iirc, haven't checked) flush ports on a normal exit
<RhodiumToad>obviously if the process dies of a signal that won't happen
<apteryx>in any case there would never be any file descriptors leak?
<apteryx>so at worst we'd loose some log outputs when sending SIGKILL to the process, say?
<RhodiumToad>in posix-style OSes, closing file descriptors on exit is done by the OS
<RhodiumToad>(regardless of how the process died)
<RhodiumToad>you can't avoid losing unflushed log output on sigkill
<RhodiumToad>(which is one reason why stderr is usually used unbuffered by default)
<apteryx>RhodiumToad: hm, OK. So I'm not sure why doing any logging cleanup is necessary at all, as mentioned in (info "(guile-library)logging logger")
<apteryx>what's the recently introduced procedure to invoke a process without fork + exec?
<apteryx>it uses a new POSIX API, I think
<RhodiumToad>spawn
<apteryx>thanks
<RhodiumToad>"new" in that it has existed since 2001