bug#68703: update to lightning.texi to work w/ texi2any --pdf (with patch)

2024-01-24 Thread Matt Wette
The following changes to libguile/lightening/lightning.texi will allow 
it to be used with texi2any --pdf:


--- lightning.texi    2022-06-20 07:44:21.159880656 -0700
+++ lightning.texi-fixed    2024-01-24 12:07:27.621547717 -0800
@@ -83,22 +83,12 @@
 @ifnottex
 @node Top
 @top @lightning{}
-
-@iftex
-@macro comma
-@verbatim{|,|}
-@end macro
-@end iftex
-
-@ifnottex
-@macro comma
-@verb{|,|}
-@end macro
 @end ifnottex

 This document describes @value{TOPIC} the @lightning{} library for
 dynamic code generation.

+@ifnottex
 @menu
 * Overview::    What GNU lightning is
 * Installation::    Configuring and installing GNU lightning
--- lightning.texi	2022-06-20 07:44:21.159880656 -0700
+++ lightning.texi-fixed	2024-01-24 12:07:27.621547717 -0800
@@ -83,22 +83,12 @@
 @ifnottex
 @node Top
 @top @lightning{}
-
-@iftex
-@macro comma
-@verbatim{|,|}
-@end macro
-@end iftex
-
-@ifnottex
-@macro comma
-@verb{|,|}
-@end macro
 @end ifnottex
 
 This document describes @value{TOPIC} the @lightning{} library for
 dynamic code generation.
 
+@ifnottex
 @menu
 * Overview::What GNU lightning is
 * Installation::Configuring and installing GNU lightning


bug#68504: [PATCH] Add copy-on-write support to scm_copy_file.

2024-01-24 Thread Tomas Volf
On 2024-01-24 11:26:56 +0100, Ludovic Courtès wrote:
>
> The patch looks great (and very useful) to me, modulo one issue:
>
> > -SCM_API SCM scm_copy_file (SCM oldfile, SCM newfile);
> > +SCM_API SCM scm_copy_file (SCM oldfile, SCM newfile, SCM rest);
>
> Since this is a public interface, we cannot change this function’s
> signature during the 3.0 stable series.
>
> Thus, I would suggest keeping the public ‘scm_copy_file’ unchanged and
> internally having a three-argument variant.  The Scheme-level
> ‘copy-file’ would map to that three-argument variant.  (See how
> ‘scm_pipe’ and ‘scm accept’ as examples.)

That is a very good point, which I did not realize at all.  Thanks to the
examples you provided, it was not that hard to do (well, assuming I did it
right).

> Could you send an updated patch?

Done.  However now that I read it after myself, I overlooked this occurrence of
scm_copy_file in the commit message:

This commit adds support for this feature into our
copy-file (scm_copy_file) procedure.  Same as `cp', it defaults to

So I just sent v3 right after v2, sorry for the noise, should have been more
careful.

>
> BTW, copyright assignment to the FSF is now optional but encouraged.
> Please see
> .

Since it is optional, I will currently opt into not doing the assignment, I do
not like the concept that much.  I will try to find time to actually form an
opinion based on facts.

Have a nice day,
Tomas

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.


signature.asc
Description: PGP signature


bug#68504: [PATCH v3] Add copy-on-write support to scm_copy_file.

2024-01-24 Thread Tomas Volf
On modern file-systems (BTRFS, ZFS) it is possible to copy a file using
copy-on-write method.  For large files it has the advantage of being
much faster and saving disk space (since identical extents are not
duplicated).  This feature is stable and for example coreutils' `cp'
does use it automatically (see --reflink).

This commit adds support for this feature into our copy-file procedure.
Same as `cp', it defaults to 'auto, meaning the copy-on-write is
attempted, and in case of failure the regular copy is performed.

No tests are provided, because the behavior depends on the system,
underlying file-system and its configuration.  That makes it challenging
to write a test for it.  Manual testing was performed instead:

$ btrfs filesystem du /tmp/cow*
 Total   Exclusive  Set shared  Filename
  36.00KiB36.00KiB   0.00B  /tmp/cow

$ cat cow-test.scm
(copy-file "/tmp/cow" "/tmp/cow-unspecified")
(copy-file "/tmp/cow" "/tmp/cow-always" #:copy-on-write 'always)
(copy-file "/tmp/cow" "/tmp/cow-auto" #:copy-on-write 'auto)
(copy-file "/tmp/cow" "/tmp/cow-never" #:copy-on-write 'never)
(copy-file "/tmp/cow" "/dev/shm/cow-unspecified")
(copy-file "/tmp/cow" "/dev/shm/cow-auto" #:copy-on-write 'auto)
(copy-file "/tmp/cow" "/dev/shm/cow-never" #:copy-on-write 'never)
$ ./meta/guile -s cow-test.scm

$ btrfs filesystem du /tmp/cow*
 Total   Exclusive  Set shared  Filename
  36.00KiB   0.00B36.00KiB  /tmp/cow
  36.00KiB   0.00B36.00KiB  /tmp/cow-always
  36.00KiB   0.00B36.00KiB  /tmp/cow-auto
  36.00KiB36.00KiB   0.00B  /tmp/cow-never
  36.00KiB   0.00B36.00KiB  /tmp/cow-unspecified

$ sha1sum /tmp/cow* /dev/shm/cow*
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow-always
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow-auto
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow-never
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow-unspecified
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /dev/shm/cow-auto
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /dev/shm/cow-never
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /dev/shm/cow-unspecified

This commit also adds to new failure modes for (copy-file).

Failure to copy-on-write when 'always was passed in:

scheme@(guile-user)> (copy-file "/tmp/cow" "/dev/shm/cow" #:copy-on-write 
'always)
ice-9/boot-9.scm:1676:22: In procedure raise-exception:
In procedure copy-file: copy-on-write failed: Invalid cross-device link

Passing in invalid value for the #:copy-on-write keyword argument:

scheme@(guile-user)> (copy-file "/tmp/cow" "/dev/shm/cow" #:copy-on-write 
'nevr)
ice-9/boot-9.scm:1676:22: In procedure raise-exception:
In procedure copy-file: invalid value for #:copy-on-write: nevr

* NEWS: Add note for copy-file supporting copy-on-write.
* configure.ac: Check for linux/fs.h.
* doc/ref/posix.texi (File System)[copy-file]: Document the new
signature.
* libguile/filesys.c (clone_file): New function cloning a file using
FICLONE, if supported.
(k_copy_on_write): New keyword.
(sym_always, sym_auto, sym_never): New symbols.
(scm_copy_file2): Renamed from scm_copy_file.  New #:copy-on-write
keyword argument.  Attempt copy-on-write copy by default.
(scm_copy_file): Call scm_copy_file2.
* libguile/filesys.h: Add scm_copy_file2 as SCM_INTERNAL.
---
v2: Introduce scm_copy_file2 in order to preserve backwards compatibility.

v3: Remove mention of scm_copy_file from the commit message.

 NEWS   |  9 +
 configure.ac   |  1 +
 doc/ref/posix.texi |  9 -
 libguile/filesys.c | 82 +++---
 libguile/filesys.h |  1 +
 5 files changed, 89 insertions(+), 13 deletions(-)

diff --git a/NEWS b/NEWS
index b319404d7..9147098c9 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,15 @@ definitely unused---this is notably the case for modules 
that are only
 used at macro-expansion time, such as (srfi srfi-26).  In those cases,
 the compiler reports it as "possibly unused".

+** copy-file now supports copy-on-write
+
+The copy-file procedure now takes an additional keyword argument,
+#:copy-on-write, specifying whether copy-on-write should be done, if the
+underlying file-system supports it.  Possible values are 'always, 'auto
+and 'never, with 'auto being the default.
+
+This speeds up copying large files a lot while saving the disk space.
+
 * Bug fixes

 ** (ice-9 suspendable-ports) incorrect UTF-8 decoding
diff --git a/configure.ac b/configure.ac
index d0a2dc79b..c46586e9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -418,6 +418,7 @@ AC_SUBST([SCM_I_GSC_HAVE_STRUCT_DIRENT64])
 #   sys/sendfile.h - non-POSIX, found in glibc
 #
 AC_CHECK_HEADERS([complex.h fenv.h io.h memory.h process.h \
+linux/fs.h \
 sys/dir.h sys/ioctl.h sys/select.h \
 sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h \
 sys/utime.h uni

bug#68504: [PATCH v2] Add copy-on-write support to scm_copy_file.

2024-01-24 Thread Tomas Volf
On modern file-systems (BTRFS, ZFS) it is possible to copy a file using
copy-on-write method.  For large files it has the advantage of being
much faster and saving disk space (since identical extents are not
duplicated).  This feature is stable and for example coreutils' `cp'
does use it automatically (see --reflink).

This commit adds support for this feature into our
copy-file (scm_copy_file) procedure.  Same as `cp', it defaults to
'auto, meaning the copy-on-write is attempted, and in case of failure
the regular copy is performed.

No tests are provided, because the behavior depends on the system,
underlying file-system and its configuration.  That makes it challenging
to write a test for it.  Manual testing was performed instead:

$ btrfs filesystem du /tmp/cow*
 Total   Exclusive  Set shared  Filename
  36.00KiB36.00KiB   0.00B  /tmp/cow

$ cat cow-test.scm
(copy-file "/tmp/cow" "/tmp/cow-unspecified")
(copy-file "/tmp/cow" "/tmp/cow-always" #:copy-on-write 'always)
(copy-file "/tmp/cow" "/tmp/cow-auto" #:copy-on-write 'auto)
(copy-file "/tmp/cow" "/tmp/cow-never" #:copy-on-write 'never)
(copy-file "/tmp/cow" "/dev/shm/cow-unspecified")
(copy-file "/tmp/cow" "/dev/shm/cow-auto" #:copy-on-write 'auto)
(copy-file "/tmp/cow" "/dev/shm/cow-never" #:copy-on-write 'never)
$ ./meta/guile -s cow-test.scm

$ btrfs filesystem du /tmp/cow*
 Total   Exclusive  Set shared  Filename
  36.00KiB   0.00B36.00KiB  /tmp/cow
  36.00KiB   0.00B36.00KiB  /tmp/cow-always
  36.00KiB   0.00B36.00KiB  /tmp/cow-auto
  36.00KiB36.00KiB   0.00B  /tmp/cow-never
  36.00KiB   0.00B36.00KiB  /tmp/cow-unspecified

$ sha1sum /tmp/cow* /dev/shm/cow*
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow-always
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow-auto
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow-never
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow-unspecified
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /dev/shm/cow-auto
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /dev/shm/cow-never
4c665f87b5dc2e7d26279c4b48968d085e1ace32  /dev/shm/cow-unspecified

This commit also adds to new failure modes for (copy-file).

Failure to copy-on-write when 'always was passed in:

scheme@(guile-user)> (copy-file "/tmp/cow" "/dev/shm/cow" #:copy-on-write 
'always)
ice-9/boot-9.scm:1676:22: In procedure raise-exception:
In procedure copy-file: copy-on-write failed: Invalid cross-device link

Passing in invalid value for the #:copy-on-write keyword argument:

scheme@(guile-user)> (copy-file "/tmp/cow" "/dev/shm/cow" #:copy-on-write 
'nevr)
ice-9/boot-9.scm:1676:22: In procedure raise-exception:
In procedure copy-file: invalid value for #:copy-on-write: nevr

* NEWS: Add note for copy-file supporting copy-on-write.
* configure.ac: Check for linux/fs.h.
* doc/ref/posix.texi (File System)[copy-file]: Document the new
signature.
* libguile/filesys.c (clone_file): New function cloning a file using
FICLONE, if supported.
(k_copy_on_write): New keyword.
(sym_always, sym_auto, sym_never): New symbols.
(scm_copy_file2): Renamed from scm_copy_file.  New #:copy-on-write
keyword argument.  Attempt copy-on-write copy by default.
(scm_copy_file): Call scm_copy_file2.
* libguile/filesys.h: Add scm_copy_file2 as SCM_INTERNAL.
---
v2: Introduce scm_copy_file2 in order to preserve backwards compatibility.

 NEWS   |  9 +
 configure.ac   |  1 +
 doc/ref/posix.texi |  9 -
 libguile/filesys.c | 82 +++---
 libguile/filesys.h |  1 +
 5 files changed, 89 insertions(+), 13 deletions(-)

diff --git a/NEWS b/NEWS
index b319404d7..9147098c9 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,15 @@ definitely unused---this is notably the case for modules 
that are only
 used at macro-expansion time, such as (srfi srfi-26).  In those cases,
 the compiler reports it as "possibly unused".

+** copy-file now supports copy-on-write
+
+The copy-file procedure now takes an additional keyword argument,
+#:copy-on-write, specifying whether copy-on-write should be done, if the
+underlying file-system supports it.  Possible values are 'always, 'auto
+and 'never, with 'auto being the default.
+
+This speeds up copying large files a lot while saving the disk space.
+
 * Bug fixes

 ** (ice-9 suspendable-ports) incorrect UTF-8 decoding
diff --git a/configure.ac b/configure.ac
index d0a2dc79b..c46586e9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -418,6 +418,7 @@ AC_SUBST([SCM_I_GSC_HAVE_STRUCT_DIRENT64])
 #   sys/sendfile.h - non-POSIX, found in glibc
 #
 AC_CHECK_HEADERS([complex.h fenv.h io.h memory.h process.h \
+linux/fs.h \
 sys/dir.h sys/ioctl.h sys/select.h \
 sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h \
 sys/utime.h unistd.h utime.h pwd.h grp.h sys/utsname.h \
dif

bug#68505: [PATCH v2] Add more detailed instructions into the HACKING file.

2024-01-24 Thread Tomas Volf
Thank you for the review.

On 2024-01-24 11:18:27 +0100, Ludovic Courtès wrote:
> > +You can spawn a shell with all the required dependencies using GNU Guix
> > +by running the following command:
> > +
> > +guix shell -D -f guix.scm --pure
>
> I would suggest running:
>
>   guix shell -CP
>
> (Currently ‘README’ suggests ‘guix shell’.)
>
> The rationale is: it’s shorter, using a container avoids interference,
> and ‘-P’ works well with ‘config.cache’ & co. (because the cached file
> names then are $HOME/.guix-profile/…).
>
> WDYT?

Modified as agreed on irc.  I am not convinced on the -P, but I defer to your
judgment on this.

Have a nice day,
Tomas Volf

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.


signature.asc
Description: PGP signature


bug#68505: [PATCH v3] Add more detailed instructions into the HACKING file.

2024-01-24 Thread Tomas Volf
Until now, the ./meta/guile was not mentioned anywhere, and therefore it
was not obvious how to run the locally compiled Guile without installing
it.

While modifying the file, I took the liberty to also mention a bit about
compiling Guile using Guix.

Finally, the header lines where cleaned up, ensuring all of them end at
70 and have a leading space.

* HACKING (Hacking It Yourself): Add Guix instructions.  Add a note
about meta/guile script.
(Sample GDB Initialization File),
(Naming conventions): Clean up the header line.
---
v2:
Add note regarding JIT and GNU Hurd.  Add note regarding -fexcess-precision.
Add --disable-static and explain it.

v3:
Use -CP instead of --pure.

 HACKING | 38 --
 1 file changed, 36 insertions(+), 2 deletions(-)

diff --git a/HACKING b/HACKING
index 387643bf7..94fba199c 100644
--- a/HACKING
+++ b/HACKING
@@ -26,6 +26,40 @@ http://www.gnu.org/software/guile/mail/mail.html for more 
info.

 Hacking It Yourself ==

+You can spawn a shell with all the required dependencies using GNU Guix
+by running the following command:
+
+guix shell -D -f guix.scm --pure
+
+In this way, you can effortlessly compile Guile from the Git checkout
+with just these three lines:
+
+guix shell -CP -D -f guix.scm -- ./autogen.sh
+guix shell -CP -D -f guix.scm -- ./configure \
+--enable-mini-gmp --disable-static
+guix shell -CP -D -f guix.scm -- make
+
+Disabling of the static libraries is optional, but it does speed up the
+builds, and you are unlikely to need them for local development.
+
+  Note: Currently JIT causes Guile to crash in obscure ways on GNU Hurd,
+so on that platform you want to also pass the --disable-jit flag
+to the configure script.
+
+  Note: On any i*86 architecture, you also need to pass in the compiler
+flag -fexcess-precision=standard in order to get the test suite
+to pass.  That can be done by passing an additional argument to
+the configure script:
+ CFLAGS='-g -O2 -fexcess-precision=standard'
+
+Once that finishes, you can execute your newly compiled Guile using the
+./meta/guile script:
+
+$ guix shell -CP -D -f guix.scm -- ./meta/guile -v | head -n1
+guile (GNU Guile) 3.0.9.139-d7cf5-dirty
+
+For more manual approach, read on.
+
 When Guile is obtained from Git, a few extra steps must be taken
 before the usual configure, make, make install.  You will need to have
 up-to-date versions of the tools as listed below, correctly installed.
@@ -73,7 +107,7 @@ Here is the authoritative list of tool/version/platform 
tuples that
 have been known to cause problems, and a short description of the problem.


-Sample GDB Initialization File=
+Sample GDB Initialization File ===

 In GDB, you probably want to load the gdbinit file included with Guile,
 which defines a number of GDB helpers to inspect Scheme values.
@@ -215,7 +249,7 @@ The goal is to reduce (and over time, eliminate) spurious 
diffs.
 For Emacs users:
   (add-hook 'before-save-hook 'delete-trailing-whitespace)

-Naming conventions =
+Naming conventions ===

 We use certain naming conventions to structure the considerable number
 of global identifiers.  All identifiers should be either all lower
--
2.41.0





bug#68087: Signal handlers not called after ‘primitive-fork’

2024-01-24 Thread Ludovic Courtès
Ludovic Courtès  skribis:

> Fixes .
>
> * libguile/scmsigs.h (scm_i_signals_pre_fork, scm_i_signals_post_fork):
> New declarations.
> (scm_i_signal_delivery_thread): Change type to SCM..
> * libguile/threads.c (scm_all_threads): Adjust accordingly and exclude
> threads that have ‘t->exited’.  Access ‘thread_count’ after grabbing
> ‘thread_admin_mutex’.
> * libguile/posix.c (scm_fork): Add calls to ‘scm_i_signals_pre_fork’ and
> ‘scm_i_signals_post_fork’.
> * libguile/scmsigs.c (signal_delivery_thread): Close signal_pipe[0] upon
> exit and set it to -1.
> (once): New file-global variable, moved from…
> (scm_i_ensure_signal_delivery_thread): … here.
> (stop_signal_delivery_thread, scm_i_signals_pre_fork)
> (scm_i_signals_post_fork): New functions.
> * test-suite/standalone/test-sigaction-fork: New file.
> * test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add it.

Pushed as 5a8502a4946e8a5b5c40a127aa240fc6ad960d03.

Ludo’.





bug#68504: [PATCH] Add copy-on-write support to scm_copy_file.

2024-01-24 Thread Ludovic Courtès
Hi,

Tomas Volf <~@wolfsden.cz> skribis:

> On modern file-systems (BTRFS, ZFS) it is possible to copy a file using
> copy-on-write method.  For large files it has the advantage of being
> much faster and saving disk space (since identical extents are not
> duplicated).  This feature is stable and for example coreutils' `cp'
> does use it automatically (see --reflink).
>
> This commit adds support for this feature into our
> copy-file (scm_copy_file) procedure.  Same as `cp', it defaults to
> 'auto, meaning the copy-on-write is attempted, and in case of failure
> the regular copy is performed.
>
> No tests are provided, because the behavior depends on the system,
> underlying file-system and its configuration.  That makes it challenging
> to write a test for it.  Manual testing was performed instead:
>
> $ btrfs filesystem du /tmp/cow*
>  Total   Exclusive  Set shared  Filename
>   36.00KiB36.00KiB   0.00B  /tmp/cow
>
> $ cat cow-test.scm
> (copy-file "/tmp/cow" "/tmp/cow-unspecified")
> (copy-file "/tmp/cow" "/tmp/cow-always" #:copy-on-write 'always)
> (copy-file "/tmp/cow" "/tmp/cow-auto" #:copy-on-write 'auto)
> (copy-file "/tmp/cow" "/tmp/cow-never" #:copy-on-write 'never)
> (copy-file "/tmp/cow" "/dev/shm/cow-unspecified")
> (copy-file "/tmp/cow" "/dev/shm/cow-auto" #:copy-on-write 'auto)
> (copy-file "/tmp/cow" "/dev/shm/cow-never" #:copy-on-write 'never)
> $ ./meta/guile -s cow-test.scm
>
> $ btrfs filesystem du /tmp/cow*
>  Total   Exclusive  Set shared  Filename
>   36.00KiB   0.00B36.00KiB  /tmp/cow
>   36.00KiB   0.00B36.00KiB  /tmp/cow-always
>   36.00KiB   0.00B36.00KiB  /tmp/cow-auto
>   36.00KiB36.00KiB   0.00B  /tmp/cow-never
>   36.00KiB   0.00B36.00KiB  /tmp/cow-unspecified
>
> $ sha1sum /tmp/cow* /dev/shm/cow*
> 4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow
> 4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow-always
> 4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow-auto
> 4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow-never
> 4c665f87b5dc2e7d26279c4b48968d085e1ace32  /tmp/cow-unspecified
> 4c665f87b5dc2e7d26279c4b48968d085e1ace32  /dev/shm/cow-auto
> 4c665f87b5dc2e7d26279c4b48968d085e1ace32  /dev/shm/cow-never
> 4c665f87b5dc2e7d26279c4b48968d085e1ace32  /dev/shm/cow-unspecified
>
> This commit also adds to new failure modes for (copy-file).
>
> Failure to copy-on-write when 'always was passed in:
>
> scheme@(guile-user)> (copy-file "/tmp/cow" "/dev/shm/cow" #:copy-on-write 
> 'always)
> ice-9/boot-9.scm:1676:22: In procedure raise-exception:
> In procedure copy-file: copy-on-write failed: Invalid cross-device link
>
> Passing in invalid value for the #:copy-on-write keyword argument:
>
> scheme@(guile-user)> (copy-file "/tmp/cow" "/dev/shm/cow" #:copy-on-write 
> 'nevr)
> ice-9/boot-9.scm:1676:22: In procedure raise-exception:
> In procedure copy-file: invalid value for #:copy-on-write: nevr
>
> * NEWS: Add note for copy-file supporting copy-on-write.
> * configure.ac: Check for linux/fs.h.
> * doc/ref/posix.texi (File System)[copy-file]: Document the new
> signature.
> * libguile/filesys.c (clone_file): New function cloning a file using
> FICLONE, if supported.
> (k_copy_on_write): New keyword.
> (sym_always, sym_auto, sym_never): New symbols.
> (scm_copy_file): New #:copy-on-write keyword argument.  Attempt
> copy-on-write copy by default.
> * libguile/filesys.h: Update signature for scm_copy_file.

The patch looks great (and very useful) to me, modulo one issue:

> -SCM_API SCM scm_copy_file (SCM oldfile, SCM newfile);
> +SCM_API SCM scm_copy_file (SCM oldfile, SCM newfile, SCM rest);

Since this is a public interface, we cannot change this function’s
signature during the 3.0 stable series.

Thus, I would suggest keeping the public ‘scm_copy_file’ unchanged and
internally having a three-argument variant.  The Scheme-level
‘copy-file’ would map to that three-argument variant.  (See how
‘scm_pipe’ and ‘scm accept’ as examples.)

Could you send an updated patch?

BTW, copyright assignment to the FSF is now optional but encouraged.
Please see
.

Thanks,
Ludo’.





bug#68505: [PATCH v2] Add more detailed instructions into the HACKING file.

2024-01-24 Thread Ludovic Courtès
Hi,

Tomas Volf <~@wolfsden.cz> skribis:

> Until now, the ./meta/guile was not mentioned anywhere, and therefore it
> was not obvious how to run the locally compiled Guile without installing
> it.
>
> While modifying the file, I took the liberty to also mention a bit about
> compiling Guile using Guix.
>
> Finally, the header lines where cleaned up, ensuring all of them end at
> 70 and have a leading space.
>
> * HACKING (Hacking It Yourself): Add Guix instructions.  Add a note
> about meta/guile script.
> (Sample GDB Initialization File),
> (Naming conventions): Clean up the header line.
> ---
> v2:
> Add note regarding JIT and GNU Hurd.  Add note regarding -fexcess-precision.
> Add --disable-static and explain it.

Much welcome addition!

> +You can spawn a shell with all the required dependencies using GNU Guix
> +by running the following command:
> +
> +guix shell -D -f guix.scm --pure

I would suggest running:

  guix shell -CP

(Currently ‘README’ suggests ‘guix shell’.)

The rationale is: it’s shorter, using a container avoids interference,
and ‘-P’ works well with ‘config.cache’ & co. (because the cached file
names then are $HOME/.guix-profile/…).

WDYT?

Thanks,
Ludo’.





bug#68507: [PATCH] doc: Fix example in list-transduce example.

2024-01-24 Thread Ludovic Courtès
Hi,

Tomas Volf <~@wolfsden.cz> skribis:

> While the `.' might be correct from a grammatical point of view (I do
> not know), it turns the example into invalid scheme code, which is not
> ideal.  New users (like me) might try to copy the whole line and wonder
> why it does not work (like I did).  So delete it.
>
> * doc/ref/srfi-modules.texi (SRFI-171 General Discussion): Delete the
> trailing . from the example.

Applied, thanks!

Ludo’.





bug#63366: Docs: Revise or delete reference to “benevolent dictators” in Manual Introduction

2024-01-24 Thread Ludovic Courtès
Hi,

Sebastian Carlos  skribis:

> My suggestion is to delete the sentence altogether. I think the paragraph
> still makes sense without it, as the reader gets enough information to
> understand how Scheme differs from other programming languages.

I’ve (finally) removed that sentence.  Thanks!

Ludo’.