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

21330 commits

Author SHA1 Message Date
Ludovic Courtès
15a656a77a
guix: Run one cross-compilation build out-of-tree.
* .guix/manifest.scm (out-of-source-tree): New procedure.
(cross-builds): Use it.
2024-07-17 00:02:24 +02:00
Ludovic Courtès
c117f8edc4
build: Fix in-tree cross-compilation build.
Commit 57a889b728 fixed out-of-tree
cross-compilation builds but broke in-tree cross-compilation builds.
With this change, we should have both.

* libguile/Makefile.am (gen-scmconfig.$(OBJEXT)): Use ‘-iquote’ instead
of ‘-I’.
2024-07-17 00:00:00 +02:00
Rob Browning
ad1f56675b test-hashing: support 32-bit
* test-suite/standalone/test-hashing.c (test_hashing): add expected
value for 32-bit architectures.
2024-07-12 17:49:45 -05:00
Rob Browning
d99ae68f88 define-meta-command: mention effects of a missing category
module/system/repl/command.scm: add comment.
2024-07-12 17:49:45 -05:00
Maxim Cournoyer
522f368719 bug#71304: [PATCH] Add support for 'else' clause in R7RS cond-expand.
* module/ice-9/r7rs-libraries.scm (define-library)
<handle-cond-expand>: Add a pattern to match an 'else' clause.

Series-to: bug-guile@gnu.org
2024-07-01 23:38:01 +02:00
Andy Wingo
b2cc237a02 Fix distcheck problems with parallel tests
* test-suite/Makefile.am (EXTRA_DIST): Add (test-lib lib automake)
(TEST_LOG_DRIVER): Use srcdir.
2024-06-23 23:26:47 +02:00
Andy Wingo
b124f251fc Bump version to 3.0.10.
* GUILE-VERSION (GUILE_MICRO_VERSION):
(LIBGUILE_INTERFACE_CURRENT):
(LIBGUILE_INTERFACE_AGE): Bump.
2024-06-23 22:30:49 +02:00
Andy Wingo
c97d037cfa Add NEWS note about parallel tests
* NEWS: Add note.
2024-06-23 21:45:54 +02:00
Andy Wingo
b93dc62e03 Fix parallel test bug in r6rs-ports.test
* test-suite/tests/r6rs-ports.test (test-file): Use different file from
ports.test, to avoid problems during parallel tests.
2024-06-23 21:43:05 +02:00
Andy Wingo
1120efe375 Fix race in check-guile to make needless guile-procedures symlink
* check-guile.in (top_srcdir): Don't try to make guile-procedures.tx, as
this races with multiple checkers, and it's gross.
* meta/uninstalled-env.in (GUILE_DOCSTRINGS_PATH): Instead when
uninstalled, use this variable.
* module/ice-9/documentation.scm (documentation-files): Remove the
current directory from the search path for documentation files; this was
always a hack.  Instead allow GUILE_DOCSTRINGS_PATH to override the
built-in search path.
2024-06-23 11:13:18 +02:00
Andy Wingo
d7ed457620 Ensure the signal-delivery thread is completely stopped before fork
* libguile/scmsigs.c: Use raw pthread_create / pthread_join instead of
Guile's scm_spawn_thread, to ensure that the thread is entirely stopped
before a fork.
* libguile/scmsigs.h (scm_i_is_signal_delivery_thread): New internal
procedure, replacing a manual check against scm_i_signal_delivery_thread.
* libguile/threads.c: Use the new procedure.

Based on a patch by Rob Browning.  Thanks!
2024-06-21 11:11:46 +02:00
Rob Browning
0a8a1eb595 Document wait-condition-variable's spurious returns 2024-06-20 15:57:26 +02:00
Andy Wingo
2a4c095f79 Avoid stompling user TESTS_ENVIRONMENT var
* test-suite/standalone/Makefile.am (top_srcdir): Use
AM_TESTS_ENVIRONMENT.
2024-06-20 15:54:53 +02:00
Rob Browning
df04f5357a Switch to the preferred parallel automake test harness
Automake "strongly discourages" use of the serial driver, and switching
to the preferred parallel driver allows make -j4 check to run in about
half the time on a four core (not thread) host.

* Makefile.am (TESTS, TESTS_ENVIRONMENT): run ./check-guile from
test-suite/, not here.
* check-guile.in: let test harness handle progress output.
* configure.ac (AM_INIT_AUTOMAKE): allow parallel testing.
* test-suite/Makefile.am (SCM_TESTS): remove non-tests.
(EXTRA_DIST): move non-tests here.
(TESTS): include SCM_TESTS (now driven from here).
(TEST_EXTENSIONS): allow customization for .scm and .test.
(TESTS_ENVIRONMENT): stop defining (user only).
(AM_TESTS_ENVIRONMENT): replaces TESTS_ENVIRONMENT; drop guile.
(SCM_LOG_COMPILER): run .scm tests via meta/guile.
(AM_SCM_LOG_FLAGS): keep --no-auto-compile for .scm tests.
(TEST_LOG_DRIVER): run .test tests via custom automake ./driver.
* test-suite/driver: add automake test driver.
2024-06-20 15:35:48 +02:00
Rob Browning
590eb72c69 guile-test: support automake parallel test harness via --trs-file
Support an optional --trs-file PATH argument that causes guile-test to
write the status information expected by the automake parallel test
harness to PATH.

In addition, when --trs-file is specified, suppress the final test
summary (via print-counts) since it would be repeated per-test-file when
running in parallel, the automake harness prints its own summary.

cf. https://www.gnu.org/software/automake/manual/html_node/API-for-Custom-Test-Drivers.html

* test-suite/guile-test (main): support --trs-file and --log-file.
* test-suite/test-suite/lib.scm: add count-summary-line.
* test-suite/test-suite/lib/automake.scm: add automake custom test driver.
2024-06-20 15:35:48 +02:00
Rob Browning
08285b6894 check-guile.in: exit 2 on errors and direct output to stderr
Return 2 rather than 1 for errors so that 1 will be available for any
future boolean tests (as with say grep).

Direct error message to stderr rather than stdout.

* check-guile.in: send error message to stderr and exit 2 (not 1).
2024-06-20 15:35:48 +02:00
Andy Wingo
d261308088 Attempt to fix distcheck
* libguile/Makefile.am (install-data-hook): Remove temp GDB file.
2024-06-20 15:25:23 +02:00
Andy Wingo
eb3db96ce0 Add thanks for v3.0.10
* NEWS: Update.
2024-06-20 14:56:36 +02:00
Andy Wingo
7401ca75b3 Add link to foreign functions from gsubr doc
* doc/ref/api-procedures.texi (Primitive Procedures): Add link.
2024-06-20 14:39:41 +02:00
Andy Wingo
7d2ef990a0 Update NEWS
* NEWS: Update.
2024-06-20 14:12:10 +02:00
Andy Wingo
305b2fa70c Add documentation on embedded procedure properties
* doc/ref/api-procedures.texi (Procedure Properties): Document inline
procedure properties.
2024-06-20 13:54:31 +02:00
Andy Wingo
8b324bef74 Remove dead code in resolve-interface
* module/ice-9/boot-9.scm (resolve-interface): Remove dead code.
2024-06-20 13:51:59 +02:00
Arsen Arsenović
ddc5e63b00 build: Use PKG_INSTALL_DIR
This allows users to adjust their pkg-config install location.

* configure.ac: Call PKG_INSTALLDIR.
* meta/Makefile.am (pkgconfigdir): Remove.  It will be defined
automatically by the PKG_INSTALLDIR invocation.
2024-06-18 16:12:11 +02:00
Maxim Cournoyer
4fe6d19a5b bug#71303: [PATCH] doc: Fix typo in PEG example.
* doc/ref/api-peg.texi (PEG API Reference): Fix typo in PEG example.
2024-06-18 10:36:50 +02:00
Ludovic Courtès
461ff313fa
Rewrite ‘get-bytevector-all’ in Scheme.
* libguile/r6rs-ports.c (get_bytevector_all_var): New variable.
(init_bytevector_io_vars): New function.
(scm_get_bytevector_all): Rewrite as a proxy to ‘get-bytevector-all’
from (ice-9 binary-port).
* module/ice-9/binary-ports.scm (get-bytevector-all): New procedure.
* NEWS: Update.

Reported-by: Christopher Baines <mail@cbaines.net>
2024-06-16 15:05:09 +02:00
Andy Wingo
434fe2b4aa Merge branch 'callr-fix3' into 'main'
Fix some problems with callr and calli.

See merge request wingo/lightening!19
2024-06-03 13:43:19 +00:00
Ludovic Courtès
27feb2bfd3
wisp: Use uninterned symbols instead of UUIDs.
As suggested in
<https://lists.gnu.org/archive/html/guile-devel/2023-06/msg00008.html>.

* module/language/wisp.scm (wisp-uuid): Remove.
(repr-quote, repr-unquote, repr-quasiquote, repr-unquote-splicing)
(repr-syntax, repr-unsyntax, repr-quasisyntax, repr-unsyntax-splicing):
Turn into uninterned symbols.
(line-continues?, chunk-ends-with-period,
line-code-replace-inline-colons): Adjust comparisons accordingly.
(wisp-replace-paren-quotation-repr)[pred]: New procedure.
Use it to compare against the various ‘repr-’ values.
(wisp-make-improper)[dot?]: New procedure.
Use it to compare against ‘repr-dot’.
2024-06-01 11:50:16 +02:00
Ludovic Courtès
37f9fd865a
Update NEWS. 2024-06-01 11:50:16 +02:00
Arne Babenhauserheide
dce65edbaf
Add language/wisp, Wisp tests, and SRFI-119 documentation
* doc/ref/srfi-modules.texi (srfi-119): add node
* module/language/wisp.scm: New file.
* module/language/wisp/spec.scm: New file.
* test-suite/tests/srfi-119.test: New file.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-06-01 11:50:16 +02:00
Ludovic Courtès
7b92b22899
Don’t rely on integer wrapping in ‘scm_gc_register_allocation’.
* libguile/gc.c (scm_gc_register_allocation): Simplify condition.
2024-06-01 11:50:16 +02:00
Rob Browning
779a83d9c6 make-foreign-object-type: add #:super to provide superclasses
* module/system/foreign-object.scm (make-foreign-object-type): allow
specification of superclasses via #:super.
2024-05-17 12:53:39 -05:00
Daniel Llorens
34c13e7d94 Update NEWS. 2024-05-13 10:09:40 +02:00
Ludovic Courtès
f36342f9aa
guix: Use non-deprecated package name.
* .guix/modules/guile-package.scm (guile)[native-inputs]: Use
‘texlive-scheme-basic’ instead of the deprecated ‘texlive-base’.
2024-05-06 11:51:53 +02:00
Juliana Sims
a222503a89
Second argument of ‘unread-string’ is optional.
Fixes <https://bugs.gnu.org/67063>.

* doc/ref/api-io.texi (Venerable Port Interfaces): Bring unread-string
procedure documentation in line with other procedures in the section.
* libguile/ports.c (scm_unread_string): Make port argument optional.
* test-suite/tests/ports.test: Test unread-char and unread-string
without ports.
* NEWS: Update.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-05-06 11:51:53 +02:00
Michael Käppler
80d4055e42
Fix error messages containing format strings
The builtin primitive procedure `error` takes an optional message and
a list of arguments to include into the error message.
These args are formatted with `~S` and appended to the error message, so
that an example call of

`(error "Wrong argument: " 42)`

results in the output

"Wrong argument: 42"

If format strings occur in the message itself, however, they are
escaped. Thus a call like

`(error "Wrong argument: ~a" 42)`

is rendered as

"Wrong argument: ~a 42"

Some callers did not take this behavior into account, leading to
confusing error messages.
Changing the behavior of `error` to be
both backwards-compatible and accept also format strings inside messages
is not straightforward, because it would have to handle escaped `~`
characters as well. Therefore, fix `error` call sites using format
strings to use `format` before calling out to `error`.

The following files are affected:

* module/ice-9/format.scm (format)
* module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface)
* module/oop/goops.scm (make)
* module/srfi/srfi-37.scm (Comment at the beginning of file)
* module/system/base/compile.scm (call-once)
* module/system/repl/command.scm (break, tracepoint)
* module/system/repl/common.scm (repl-default-options)
* module/system/vm/traps.scm (arg-check, trap-at-source-location)

There are a couple of further call sites that were left unchanged,
either because they are using their own `error` procedure:

* module/ice-9/read.scm
* module/ice-9/command-line.scm

or are not referenced from other modules:

* module/system/base/lalr.upstream.scm:
* module/sxml/upstream/assert.scm:
* module/sxml/sxml-match.ss:

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-05-06 11:51:53 +02:00
Jonas Hahnfeld
57a889b728
build: Fix cross-compilation in out-of-tree-builds
gen-scmconfig.h is generated in libguile, not $(top_builddir).

* libguile/Makefile.am: Add '-I.' when compiling gen-scmconfig.o.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-05-06 11:51:53 +02:00
Jonas Hahnfeld
ebcc9d1e3a
build: Make sed invocation fully portable
Commit 08041d216f attempted to make the "invocation compatible with
BSD sed", but moving '-i' first does not solve the problem because
it still requires to pass an argument. Instead just redirect the
instantiated output into a temporary file and install that.

* libguile/Makefile.am: Remove '-i' from INSTANTIATE.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-05-06 11:51:53 +02:00
Morgan Smith
f27e8b855f
Fix typos throughout codebase.
* NEWS:
* doc/ref/api-control.texi:
* doc/ref/api-data.texi:
* doc/ref/api-debug.texi:
* doc/ref/api-deprecated.texi:
* doc/ref/api-evaluation.texi:
* doc/ref/api-foreign.texi:
* doc/ref/api-i18n.texi:
* doc/ref/api-io.texi:
* doc/ref/api-languages.texi:
* doc/ref/api-macros.texi:
* doc/ref/api-memory.texi:
* doc/ref/api-modules.texi:
* doc/ref/api-options.texi:
* doc/ref/api-peg.texi:
* doc/ref/api-procedures.texi:
* doc/ref/api-scheduling.texi:
* doc/ref/api-undocumented.texi:
* doc/ref/api-utility.texi:
* doc/ref/expect.texi:
* doc/ref/goops.texi:
* doc/ref/misc-modules.texi:
* doc/ref/posix.texi:
* doc/ref/repl-modules.texi:
* doc/ref/scheme-ideas.texi:
* doc/ref/scheme-scripts.texi:
* doc/ref/srfi-modules.texi:
* gc-benchmarks/larceny/dynamic.sch:
* gc-benchmarks/larceny/twobit-input-long.sch:
* gc-benchmarks/larceny/twobit.sch:
* libguile/gc.h:
* libguile/ioext.c:
* libguile/list.c:
* libguile/options.c:
* libguile/posix.c:
* libguile/threads.c:
* module/ice-9/boot-9.scm:
* module/ice-9/optargs.scm:
* module/ice-9/ports.scm:
* module/ice-9/pretty-print.scm:
* module/ice-9/psyntax.scm:
* module/language/elisp/parser.scm:
* module/language/tree-il/compile-bytecode.scm:
* module/srfi/srfi-37.scm:
* module/srfi/srfi-43.scm:
* module/statprof.scm:
* module/texinfo/reflection.scm:
* test-suite/tests/eval.test:
* test-suite/tests/fluids.test:
Fix typos.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-05-06 11:51:53 +02:00
Ludovic Courtès
5fcf6ff17a
Update NEWS. 2024-05-06 11:51:53 +02:00
Ludovic Courtès
4ae33f76d6
‘system*’ no longer changes SIGINT and SIGQUIT handlers.
Fixes <https://bugs.gnu.org/70144>.

Fixes a bug whereby ‘system*’ would change the handler of SIGINT and
SIGQUIT to SIG_IGN in a racy fashion, possibly competing with calls to
‘sigaction’ in Scheme in another thread.

This is a followup to 527c257d6e, which
witch to ‘posix_spawn’, ensuring signals are properly dealt with when
creating child processes.

* libguile/posix.c (restore_sigaction, scm_dynwind_sigaction): Remove.
(scm_system_star): Remove sigaction dynwind around call to
‘piped_process’.
* NEWS: Update.

Reported-by: Christopher Baines <mail@cbaines.net>
2024-05-06 11:51:52 +02:00
Andy Wingo
3b76a30e3c Tree-IL lowerer has #:dump-optimized-tree-il? option
* module/language/tree-il/optimize.scm (make-optimizer): If the keyword
argument #:dump-optimized-tree-il? is present, print the Tree-IL that
will be handed to the next compiler.  Also re-enable #:verify-tree-il?.
2024-04-23 13:06:34 +02:00
Andy Wingo
e2fad20257 Merge Lightening update branch 2024-04-22 15:18:57 +02:00
Andy Wingo
436a8b278b aarch64: Fix duplicate declaration 2024-04-22 15:14:13 +02:00
Andy Wingo
6b99eb5212 Fix compilation when SCM_I_PTHREAD_ONCE_INIT is not aggregate
* libguile/scmsigs.c (scm_i_signals_post_fork): It's possible for
SCM_I_PTHREAD_ONCE_INIT to be a braced initializer.  In that case when
this initializer is re-used as an assignment, it needs the type to
instead be treated as a C11 literal.  Fixes compilation on Mac OS.

Thanks to Tony Garnock-Jones for the patch.
2024-04-22 15:09:45 +02:00
Andy Wingo
57c5018b3a Merge remote-tracking branch 'lightening/main' 2024-04-22 15:05:46 +02:00
Andy Wingo
43262c0962 aarch64: Add support for LSE atomics
* lightening/aarch64-cpu.c (SWPAL, CASAL): New instructions.
(swap_atomic, cas_atomic): Use better instructions if we have LSE.
* lightening/aarch64.c (get_hwcap, jit_get_cpu): Arrange to detect LSE
availability on GNU/Linux and Darwin.

Based on a patch by Tony Garnock-Jones.  Thanks!
2024-04-22 15:03:01 +02:00
Tony Garnock-Jones
2c0126e3ef aarch64: Fix swap_atomic retry
* lightening/aarch64-cpu.c (swap_atomic): If the swap fails, and the dst
register was the same as the val, we would stomple val during the retry.
Fixes https://github.com/wingo/fibers/issues/83#issuecomment-2068847127.
2024-04-22 15:03:01 +02:00
Andy Wingo
d759faa27a Fix CI 2024-04-22 15:03:01 +02:00
Ludovic Courtès
112b617f59
linker: Create a sparse file only when writing to a file port.
Fixes a regression introduced in
4a0c2433d9: the strategy wouldn’t work
when writing to, say, a bytevector output port.

* module/system/vm/linker.scm (link-elf)[write-padding]: Reintroduce
loop for when PORT is not a file port.  Remove first argument.
2024-04-16 00:34:01 +02:00
Ludovic Courtès
696acfc9e5
‘seek’ now accepts ‘SEEK_DATA’ and ‘SEEK_HOLE’ where supported.
* libguile/ports.c (scm_seek): Let SEEK_DATA and SEEK_HOLE through.
(scm_init_ice_9_ports): Define ‘SEEK_DATA’ and ‘SEEK_HOLE’.
* module/ice-9/ports.scm: Export ‘SEEK_DATA’ and ‘SEEK_HOLE’ when
defined.
* test-suite/tests/ports.test ("size of sparse file")
("SEEK_DATA while on data", "SEEK_DATA while in hole")
("SEEK_HOLE while in hole"): New tests.
* NEWS: Update.
2024-04-15 19:58:25 +02:00