1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00
Commit graph

21316 commits

Author SHA1 Message Date
Arun Isaac
117c398341 Fix typo in transform-string docstring
* module/texinfo/string-utils.scm (transform-string): Replace "te" with
"the" in docstring.

Fixes: 42228
2025-03-20 13:36:58 -05:00
Rob Browning
c6e0826667 libguile/Makefile.am: move date -d arg before format string
This fixes a problem on at least NetBSD.

* libguile/Makefile.am (libpath.h): move date -d argument before format
string.

Thanks to Thomas Klausner for reporting the problem and proposing the
fix.

Closes: 26121
2025-03-20 13:22:14 -05:00
Rob Browning
4527371d1b filesys.test: skip copy-file EACCES test when root
Accidentally omitted from b3b7477128.

* test-suite/tests/filesys.test: skip copy-file EACCES test when root.
2025-03-20 13:21:56 -05:00
Tomas Volf
4f39181b2f filesys.c: Use scm_sendfile to copy files
Use scm_sendfile instead of read-write loop.  This moves the work into
the kernel, improving performance.  This implements Ludovic's suggestion
from https://debbugs.gnu.org/68504

* libguile/filesys.c (scm_copy_file2): Use scm_sendfile.

[rlb@defaultvalue.org: add NEWS]
2025-03-19 21:25:40 -05:00
Rob Browning
b3b7477128 Add missing, read-only, and typical copy-file tests
* test-suite/guile-test: add call-with-temp-dir and exception-errno.
* test-suite/tests/filesys.test: add further copy-file tests.
2025-03-19 21:25:40 -05:00
Rob Browning
11b027d7e2 piped_process: silence spurious -Wmaybe-uninitialized warnings
libguile/posix.c: initialize pipes to silence spurious warnings.
2025-03-18 14:34:49 -05:00
Rob Browning
aeb89f6ad6 configure: add -Werror=array-bounds to CFLAGS when available
This would have prevented https://bugs.gnu.org/76907

* configure.ac: add -Werror=array-bounds to CFLAGS when available
2025-03-18 14:34:38 -05:00
Michael Gran
4af6331a65 Fixes potential buffer overflow in getsockopt for timevals
struct timeval is a possible return value of getsockopt (e.g. SO_RCVTIMEO
and SO_SNDTIMEO), but it is not included in the scm_t_getsockopt_result
union, which may then be too small (and is on Debian amd64).
* libguile/socket.c: add struct timeval to scm_t_getsockopt union

[rlb@defaultvalue.org: adjust commit message; add NEWS]

Closes: 76907
2025-03-18 12:24:31 -05:00
Zheng Junjie
402e0dfa33
build: Mark JIT as supported on riscv64.
This is a followup to 5d3f561d7d.

* acinclude.m4 (GUILE_ENABLE_JIT): Mark riscv64 as JIT available.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-03-06 17:28:18 +01:00
Rob Browning
5012581745 r6rs-ports.test: don't race with gc close in custom port tests
The tests share a "log" for custom port events and didn't always
explicitly close the test ports, so the close might come later, during
another test.  Change the tests to always close their ports immediately,
and clear the log after checking for expected "inter-test" events.

test-suite/tests/r6rs-ports.test: don't race with gc close in custom
port tests.
2025-03-02 14:44:53 -06:00
Rob Browning
d7475d4073 configure.ac: enable -ffat-lto-objects with -flto when available
Without -ffat-lto-objects libguile.a ends up with no symbols, visible
via "nm t libguile.a".
cf. https://lintian.debian.org/tags/no-code-sections.html

* configure.ac: enable -ffat-lto-objects with -flto when available.
2025-03-02 14:44:51 -06:00
Rob Browning
e1a6622b3b Note setlocale raises a system-error when locale doesn't exist
doc/ref/posix.texi: note setlocale raises a system-error when locale
doesn't exist

Thanks to Francesco P. Lovergine for suggesting the
addition (https://bugs.debian.org/1078681).
2025-03-02 14:33:30 -06:00
Dale P. Smith
29c27afe96 Allow trailing "." in urls
Fixes https://debbugs.gnu.org/53201

* module/web/uri.scm (valid-host?): Allow trailing "." in URLs
* test-suite/tests/web-uri.test: Add tests for trailing "."
2025-03-02 21:18:19 +01:00
Ludovic Courtès
5be5a10a8a
Update NEWS.
* NEWS: Update for c1353972ee.
2025-02-28 22:12:04 +01:00
Olivier Dion
7b7340b2d9
Warn about mutation of ‘environ’ when multi-threaded.
This is an amendment to 84bf840322.

The warning was only emitted for calling `environ', even if only reading
and no mutation occurred.

However, it is correct to read the environment in a multi-threaded
process.  It is however unsafe to mutate it.

The same logic also applies to `putenv'.

* libguile/posix.c
  (maybe_warn_about_environ_mutation): New private procedure ...
  (scm_environ): ... called here when mutating the environment ...
  (scm_putenv): ... and here.
* NEWS: Update.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 22:12:04 +01:00
Ludovic Courtès
b8031fc965
Exclude the finalizer thread from the ‘all-threads’ result.
Fixes <https://bugs.gnu.org/76343>.

Fixes a bug whereby “echo '(environ)' | guile” would wrongfully trigger
the multiple-thread warning.

* libguile/finalizers.c (finalizer_thread): New variable.
(finalization_thread_proc): Set it.
(scm_i_is_finalizer_thread): New function.
(run_finalization_thread): Clear FINALIZER_THREAD.
* libguile/finalizers.h (scm_i_is_finalizer_thread): New declaration.
* libguile/threads.c (scm_all_threads): Use it.
* NEWS: Update.

Reported-by: Simon Josefsson <simon@josefsson.org>
2025-02-28 22:12:03 +01:00
Maxim Cournoyer
75fd1d6434
Remove lib/malloc/.dirstamp and register to .gitignore.
* lib/malloc/.dirstamp: Delete file.
* .gitignore: Register.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 22:12:03 +01:00
Morgan Smith
a58c2d21f4
doc: Remove reference to long-gone tutorial.
The tutorial was removed in commit f75c5849cd.

* doc/README: Remove reference to a tutorial that no longer exists

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 22:12:03 +01:00
Morgan Smith
6ea7c858a6
HACKING: Update mailing list URL.
* HACKING: Update.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 22:12:03 +01:00
Morgan Smith
93119355b9
doc: Remove all remaining references to GDS.
This finished what this previous commit was meant to do:
767dbb1af3

* .gitignore: Remove "gds-test.debug" and "gds-test.transcript".
* doc/ref/Makefile.am (PICTURES): Remove "gds.eps", "gds.pdf", and "gds.txt".
* doc/ref/gds.dia:
* doc/ref/gds.eps:
* doc/ref/gds.pdf:
* doc/ref/gds.txt: Delete files

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 22:12:03 +01:00
Hannes Müller
ff4d79074c
libguile/scm.h: Allow compilation with ‘-Werror=undef’.
* libguile/scm.h: BUILDING_LIBGUILE is not always defined. This is
signaled by -Werror=undef in code using libguile. This patch fixes
commit dc3a3a84f9
* NEWS: Update.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 22:12:03 +01:00
Hannes Müller
5abb24efe4
Fix make-custom-port in case encoding is #f
* module/ice-9/custom-ports.scm (make-custom-port): Code fails if
(fluid-ref %default-port-encoding) returns #f. In fact this was the
case why readline support on MSYS2 failed for guile 3.0.10, ref.
https://github.com/msys2/MSYS2-packages/issues/5079
But later used canonicalize-encoding is prepared to handle #f for
encoding. So allow encoding to also handle this case.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 22:12:03 +01:00
Werner Lemberg
25c9440e4d
Add LIB_GETRANDOM to Libs.private in .pc files
The omission was discovered while cross-compiling LilyPond with mingw
11.0.1: without this addition, linking with libguile causes the error

  undefined reference to `BCryptGenRandom'

* meta/Makefile.am (dependency_substitutions): Add ‘LIB_GETRANDOM’.
* meta/guile-3.0-uninstalled.pc.in (Libs.private): Likewise.
* meta/guile-3.0.pc.in (Libs.private): Likewise.
* NEWS: Update.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 22:12:03 +01:00
Ludovic Courtès
b3a4dea943
doc: Update ‘release.org’.
* doc/release.org: Update links to CI and the web site.  Clarify what’s
optional.  Remove references to discontinued services.
2025-02-28 22:12:02 +01:00
Tomas Volf
c1353972ee srfi-19: Fix ~V converter in date->string.
The ~V is supposed to print ISO week number, not a week number.  This
commit fixes that.

* module/srfi/srfi-19.scm (date-week-number-iso): New procedure taken
  from the reference implementation.
  (directives)<#\V>: Use it.
* test-suite/tests/srfi-19.test ("date->string ~V"): Add tests taken
  from the reference test suite.
* doc/ref/srfi-modules.texi (SRFI-19 Date to string): Mention ISO-8601
  in description for ~V.

Fixes <https://bugs.gnu.org/74841>.
Edited by lloda <lloda@sarc.name>.
2025-02-28 10:28:06 +01:00
Tomas Volf
46a0ee7779 Fix typos in comments.
* module/sxml/xpath.scm: Fix typo in a comment.
* module/sxml/upstream/SXPath-old.scm: Same.
* doc/ref/sxml.texi (SXPath): Reflect in the documentation.
* doc/ref/texinfo.texi (string-utils): Fix same typo.
* module/texinfo/string-utils.scm (expand-tabs): Same.

Fixes <https://bugs.gnu.org/76621>.
Edited by lloda <lloda@sarc.name>.
2025-02-28 09:58:29 +01:00
Andy Wingo
c8a169d388 Fix string-utf8-length to have unboxed representation
* module/language/cps/utils.scm (primcall-raw-representations): Add
string-utf8-length.
2025-02-20 12:38:28 +01:00
Andy Wingo
5d3f561d7d Merge remote-tracking branch 'lightening/main' 2025-01-29 16:52:29 +01:00
Andy Wingo
d418f80803 Merge branch 'main' into 'main'
RISC-V Support

See merge request wingo/lightening!14
2025-01-29 15:43:49 +00:00
Ekaitz Zarraga
105a9c7958 riscv: error if not little endian 2025-01-29 14:53:04 +01:00
Ekaitz Zarraga
7c20ba7767 riscv: float/double call convention implementation
RISC-V uses a0-a7 registers for argument passing. Float/double arguments
use f0-f7 first and continue in a0-a7 if needed.

Once registers are consumed, stack is used.

This commit changes how lightening passes arguments in order to allow
this behavior.
2025-01-29 14:53:04 +01:00
Ekaitz Zarraga
ce8b8e4778 riscv: change stack alignment to 16 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
285cfd284a riscv: fix hi20/lo12 calculations for negative numbers 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
cbda249dc5 riscv: better movi 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
746660bf08 riscv: movi: use addiw in RV64 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
019cd02410 riscv: movi: sign extend hi 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
741af987a3 riscv: fix load size for ldxi instructions 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
33eddc7b62 riscv: simplify load from pool 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
8c7990d4a1 riscv: fix literal pool guard jump address calc 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
fb527804f9 riscv: add get_callr_temp 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
c6008fd0ab riscv: fix the B and J type size check 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
93380fc377 riscv: clean patch jumps 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
f6f2a757c3 riscv: don't pack veneers, use padding 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
76549a674a riscv: Pack the veneer struct 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
775d11b21e riscv: Add fence 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
3edd48b046 Fix CI 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
797fe5067c Add RISCV to CI and makefile 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
cbd72e71a7 RISC-V Support 2025-01-29 14:01:52 +01:00
Ekaitz Zarraga
23c4e36dca Makefile: RISCV support and optional vars
Optional variables are needed because the structure of the makefile
is prepared to run on Guix but Guix doesn't support RISCV yet, so it's
better to set them as optional and let the user decide how do they want
to compile this thing.
2025-01-29 14:01:52 +01:00
Andy Wingo
41a2a60fa1 Merge branch 'reinterpret' into 'main'
Add movr_f_i, movr_i_f, movr_d_l, movr_l_d

See merge request wingo/lightening!27
2025-01-29 11:17:25 +00:00