summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-03-23Windows 11: for fport input from the console, ignore terminal returnsHEADmainMichael Gran3-1/+63
There is an apparent bug in Windows 11 (not Windows 10) where, when reading from an fd backed by the Console, a single return character will always be available. * libguile/posix-w32.c (console_has_return_keyevent_w32): new procedure * libguile/posix-w32.h: declare console_has_return_keyevent_w32 * libguile/fports.c [__MINGW32__](fport_input_waiting): ignore return keyevent
2025-03-22Remove posix-w32 subsitutes that require access to process handlesMichael Gran3-1006/+26
Now that Guile uses the posix_spawn gnulib module, several of Guile's custom w32 functions substitutes no longer work. Some functions relied on populating and maintaining an internal PID-to-Handle database, which is no longer possible. kill, getpriority, setpriority, getaffinity and setaffinity are removed. waitpid is simplified and does not handle ENOHANG. * NEWS: updated * libguile/posix-w32.c (struct proc_record, find_proc, proc_handle): removed (record_proc, delete_proc, prepare_child_handle, compenv): removed (prepare_envblk, lookup_cmd, prepare_cmdline, start_child): removed (kill, getpriority, setpriority, sched_getaffinity): removed (sched_setaffinity): removed (waitpid): modified to just use _cwait. ENOHANG emlation removed. * libguile/posix-w32.h (CPU_ZERO, CPU_ISSET, CPU_SET, CPU_SETSIZE): removed (cpu_set_t, PRIO_PROCESS, PRIO_PGRP, PRIO_USER): removed (HAVE_START_CHILD, HAVE_KILL, HAVE_GETPRIORITY): removed (HAVE_SETPRIORITY, HAVE_SCHED_GETAFFINITY, HAVE_SCHED_SETAFFINITY): removed declarations for waitpid, start_child, kill, getpriority: removed declarations for setpriority, sched_getaffinity, sched_set_affinity: Removed
2025-03-22In piped_process, replace dprintf with more portable functionsMichael Gran1-2/+15
dprint is missing on many non-glic platforms * libguile/posix.c (piped_process): replace dprintf with sprintf+write
2025-03-22Allow piped-process and system* to exist when fork is undefinedMichael Gran2-5/+12
piped-process only uses fork to match legacy behavior, but on systems that never had fork, there is no need to match that behavior. piped-process and system* can be provided without fork. * libguile/posix.c (piped_process): allow function definition without HAVE_FORK, but stub out internal dummy process with HAVE_FORK (restore_sigaction, scm_dynwind_sigaction, scm_system_star): don't require HAVE_FORK (scm_init_popen): don't require HAVE_FORK (scm_init_posix): don't require HAVE_FORK to add posix feature or register popen extension
2025-03-22MinGW32: cast arguments to execvpMichael Gran1-1/+13
MinGW32's MSVCRT library requires strict casting for exec family functions * libguile/posix.c (scm_execl, scm_execlp, scm_execle) [__MINGW32__]: cast arguments
2025-03-22Add missing #include in syscalls.hMichael Gran1-0/+2
SCM_SYSCALL uses scm_async_tick. * libguile/syscalls.h: include async.h
2025-03-22Add replacement for missing getpagesize() on MINGWMichael Gran4-0/+21
* libguile/posix-w32.c (getpagesize_w32): new procedure * libguile/posix-w32.h: declaration of getpagesize_w32 * libguile/loader.c [__MINGW32__](scm_bootstrap_loader): use new procedure * libguile/vm.c [__MINGW32__](scm_i_vm_prepare_stack): use new procedure
2025-03-22Fix NEWS for load-foreign-libraryMichael Gran1-15/+15
NEWS update was in wrong location. This fixes news entry from 7b412940497394b0f73b29d8ceabf8312baf5cbe * NEWS: update
2025-03-22Improve DLL search strategy for load-foreign-libraryMichael Gran4-88/+325
The new non-libltdl foreign library loading algorithm from 3.0.6 fails to cover common cases regarding how libtool names and installs DLL files. Notably, it fails to recognize when libtool has added the major version number into the filename itself, such as libfoo-1.dll Also, it does not search in binary directories and the PATH for DLL files, where libtool is likely to install DLLs. This adds the option to search for dlls with major version numbers in the filename, and modifies the search strategy for DLL-using OSs to check bindir and PATH. For MSYS, libraries are installed with the 'msys-' prefix. So this modifies load-foreign-library to handle that prefix as well. It changes the #:rename-on-cygwin? option to #:host-type-rename? to better reflect that is works on both Cygwin and MSYS. Partially based on a patch by Hannes Müller. * NEWS: updated * doc/ref/api-foreign.texi: document updates to load-foreign-library and system-dll-path * module/system/foreign-library.scm (is-integer-string?): new utility function (dll-name-match?): new utility function (find-best-dll-from-matches): new utility function (dll-exists-with-version): new function that implements new dll search logic (file-exists-with-extension): add flag argument to allow new dll search (file-exists-in-path-with-extension): add flag argument to all new dll search (system-dll-path): new parameter (lib->msys): new helper function (load-foreign-library): add new optarg flag #:allow-dll-version-suffix? Pass new flag to library search functions. Implement new search strategy for #:search-system-paths? on DLL systems' replace #:rename-on-cygwin? with #:host-type-rename? Use that option to rename both MSYS and Cygwin libraries. (guile-system-extensions-path): prefer bindir to libdir on DLL systems * test-suite/tests/foreign.test ("dll-name-match?"): new test category ("find-best-dll-from-matches"): new test category ("lib->msys"): new unit tests
2025-03-22Cygwin/MSYS: 00-socket.test: abstract sockets are unsupportedMichael Gran1-0/+7
Binding to AF_UNIX abstract sockets is not supported on Cygwin and presumably MSYS as well. * test-suite/tests/00-socket.text ("AF_UNIX abstract"): throw unsupported on Cygwin and MSYS
2025-03-22ports.test: catch pipe errorsMichael Gran1-15/+16
Refactors a couple of the ports tests to catch errors in the test runner, so that the test suite will print ERROR on failure. * test-suite/tests/ports.test (pipe:write, pipe:read): modified
2025-03-22version.test: incorrect test logicMichael Gran1-5/+5
Since string-contains returns an integer on success, this test was reporting unresolved instead of pass on success. * test-suite/tests/version.test ("version reporting works"): fix boolean check logic
2025-03-21Provide ‘scm_i_is_finalizer_thread’ when building ‘--without-threads’.Ludovic Courtès1-1/+9
Fixes a regression in ‘--without-threads’ builds introduced in b8031fc9653a039c4ba8c07b93e649155351657a. * libguile/finalizers.c (scm_i_is_finalizer_thread) [!SCM_USE_PTHREAD_THREADS]: New function.
2025-03-20Replace "either" with "either array" in make-shared-array docsArun Isaac1-2/+2
* doc/ref/api-data.texi (Shared Arrays): Replace "either" with "either array" in make-shared-array documentation. Closes: 42228
2025-03-20Fix typo in transform-string docstringArun Isaac1-2/+2
* module/texinfo/string-utils.scm (transform-string): Replace "te" with "the" in docstring. Fixes: 42228
2025-03-20libguile/Makefile.am: move date -d arg before format stringRob Browning1-2/+2
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-20filesys.test: skip copy-file EACCES test when rootRob Browning1-7/+8
Accidentally omitted from b3b74771281dd3d59b2d082d5fee91b1b99b966b. * test-suite/tests/filesys.test: skip copy-file EACCES test when root.
2025-03-19filesys.c: Use scm_sendfile to copy filesTomas Volf2-10/+18
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-19Add missing, read-only, and typical copy-file testsRob Browning2-1/+46
* test-suite/guile-test: add call-with-temp-dir and exception-errno. * test-suite/tests/filesys.test: add further copy-file tests.
2025-03-18piped_process: silence spurious -Wmaybe-uninitialized warningsRob Browning1-2/+2
libguile/posix.c: initialize pipes to silence spurious warnings.
2025-03-18configure: add -Werror=array-bounds to CFLAGS when availableRob Browning2-0/+13
This would have prevented https://bugs.gnu.org/76907 * configure.ac: add -Werror=array-bounds to CFLAGS when available
2025-03-18Fixes potential buffer overflow in getsockopt for timevalsMichael Gran2-1/+4
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-06build: Mark JIT as supported on riscv64.Zheng Junjie1-4/+4
This is a followup to 5d3f561d7dbcee370dc764cd5ba4210c62ce13de. * acinclude.m4 (GUILE_ENABLE_JIT): Mark riscv64 as JIT available. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-03-02r6rs-ports.test: don't race with gc close in custom port testsRob Browning2-32/+48
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-02configure.ac: enable -ffat-lto-objects with -flto when availableRob Browning2-0/+21
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-02Note setlocale raises a system-error when locale doesn't existRob Browning1-0/+4
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-02Allow trailing "." in urlsDale P. Smith2-7/+20
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-02-28Update NEWS.Ludovic Courtès1-0/+2
* NEWS: Update for c1353972ee780f1996867fe97d0c143c59bb61ab.
2025-02-28Warn about mutation of ‘environ’ when multi-threaded.Olivier Dion2-12/+21
This is an amendment to 84bf84032208e21d20ad13f3033d4fca3a512014. 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-28Exclude the finalizer thread from the ‘all-threads’ result.Ludovic Courtès4-7/+34
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-28Remove lib/malloc/.dirstamp and register to .gitignore.Maxim Cournoyer2-1/+1
* lib/malloc/.dirstamp: Delete file. * .gitignore: Register. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28doc: Remove reference to long-gone tutorial.Morgan Smith1-4/+1
The tutorial was removed in commit f75c5849cdc6c863616facbb22b28d08da3fc09f. * doc/README: Remove reference to a tutorial that no longer exists Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28HACKING: Update mailing list URL.Morgan Smith1-1/+1
* HACKING: Update. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28doc: Remove all remaining references to GDS.Morgan Smith6-471/+0
This finished what this previous commit was meant to do: 767dbb1af30500cc0ad44d6bd0e0e179a1191ec6 * .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-28libguile/scm.h: Allow compilation with ‘-Werror=undef’.Hannes Müller2-2/+4
* libguile/scm.h: BUILDING_LIBGUILE is not always defined. This is signaled by -Werror=undef in code using libguile. This patch fixes commit dc3a3a84f908f4a16e95a2c3bb412861521960dc * NEWS: Update. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28Fix make-custom-port in case encoding is #fHannes Müller1-1/+1
* 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-28Add `LIB_GETRANDOM` to `Libs.private` in `.pc` filesWerner Lemberg4-8/+11
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-28doc: Update ‘release.org’.Ludovic Courtès1-33/+27
* doc/release.org: Update links to CI and the web site. Clarify what’s optional. Remove references to discontinued services.
2025-02-28srfi-19: Fix ~V converter in date->string.Tomas Volf3-5/+81
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-28Fix typos in comments.Tomas Volf5-5/+5
* 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-20Fix string-utf8-length to have unboxed representationAndy Wingo1-1/+1
* module/language/cps/utils.scm (primcall-raw-representations): Add string-utf8-length.
2025-01-29Merge remote-tracking branch 'lightening/main'Andy Wingo21-33/+4623
2025-01-29Merge branch 'main' into 'main'Andy Wingo10-20/+4009
RISC-V Support See merge request wingo/lightening!14
2025-01-29riscv: error if not little endianEkaitz Zarraga1-0/+5
2025-01-29riscv: float/double call convention implementationEkaitz Zarraga3-1/+64
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-29riscv: change stack alignment to 16Ekaitz Zarraga1-2/+2
2025-01-29riscv: fix hi20/lo12 calculations for negative numbersEkaitz Zarraga1-6/+7
2025-01-29riscv: better `movi`Ekaitz Zarraga1-21/+23
2025-01-29riscv: movi: use addiw in RV64Ekaitz Zarraga1-0/+4
2025-01-29riscv: movi: sign extend hiEkaitz Zarraga1-1/+1