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

20813 commits

Author SHA1 Message Date
Michael Gran
0bebd7a327 Adds automake option for subdirs
Automake warns about the lack of subdir-objects in AUTOMAKE_OPTIONS
because lightening is in a subdirectory of libguile.

* libguile/Makefile.am (AUTOMAKE_OPTIONS): add subdir-objects
2022-10-08 06:20:02 -07:00
Michael Gran
573e721293 autoupdate acinclude.m4
Autoconf's autoupdates replaces AC_TRY_CPP, AC_TRY_LINK,
AC_LANG_C

* acinclude (GUILE_READLINE, GUILE_STRUCT_UTIMBUF, UTIMBUF_NEEDS_POSIX):
  updated using autoupdate
2022-10-08 06:20:02 -07:00
Michael Gran
c0feb578fb Presumes signal handler return void
Since Guile requires a C99 compiler, we can rely on signal handlers
returning void, not int.

* configure.ac: remove AC_TYPE_SIGNAL
* libguile/scmsigs.c (SIGRETTYPE): remove SIGRETTYPE
  (take_signal): returns void
  (scm_sigaction_for_thread): presumes handlers return void
2022-10-08 06:20:02 -07:00
Michael Gran
52ea50e9c6 Modernizes labels-as-values.m4
labels-as-values.m4 uses deprecated AC_TRY_COMPILE and has
a K&R-type C function declaration

* m4/labels-as-values.m4: updated
2022-10-08 06:20:01 -07:00
Mike Gran
e75b13d18a Remove special logic for the obscure CMU C library's libc.h
* acinclude.m4 (GUILE_HEADER_LIBC_WITH_UNISTD): removed
* configure.ac: remove GUILE_HEADER_LIBC_WITH_UNISTD, don't check for libc.h
* libguile/filesys.c [LIBC_H_WITH_UNISTD_H]: remove libc.h inclusion
* libguile/posix.c [LIBC_H_WITH_UNISTD_H]: remove libc.h inclusion
2022-10-08 06:20:01 -07:00
Mike Gran
6bf4b89129 Presume time.h and sys/time.h don't conflict when included
Systems on which time.h and sys/time.h conflicted are obsolescent.

* configure.ac: remove AC_HEADER_TIME. remove conditional
  in tm.tm_gmtoff test.
* libguile/filesys.c [TIME_WITH_SYS_TIME]: remove conditional
* libguile/posix.c [TIME_WITH_SYS_TIME]: remove conditional

# Conflicts:
#	libguile/filesys.c
2022-10-08 06:20:00 -07:00
Mike Gran
dccc073a83 Presume ISO C90 functions are always available
* configure.ac: don't check for rename, setlocale, system, memcpy,
   and strcoll
* libguile/i18n.c [HAVE_SETLOCALE] (setlocale): remove static setlocale
    Don't use HAVE_SETLOCALE
* libguile/posix.c: include <locale.h>, remove HAVE_SETLOCALE
  (scm_setlocale): always include. remove HAVE_SETLOCALE
* libguile/simpos.c (scm_system): always include. remove HAVE_SYSTEM
2022-10-08 06:19:40 -07:00
Mike Gran
5cb6a0faae Presume ISO C90 headers are always available
This includes <assert.h>, <ctype.h>, <errno.h>, <float.h>, <iso646.h>,
<limits.h>, <locale.h>, <math.h>, <setjmp.h>, <signal.h>, <stdarg.h>,
<stddef.h>, <stdio.h>, <stdlib.h>, <string.h>, <time.h>, <wchar.h>,
and <wctype.h>.

* configure.ac: don't check for <limits.h>, <string.h>, <time.h>, <assert.h>.
   Remove AC_INCLUDES_DEFAULT macro
* libguile/bytevectors.c: include <limits.h>, remove HAVE_LIMITS_H
* libguile/filesys.c: include <string.h>, remove HAVE_STRING_H
* libguile/fports.c: include <string.h>, remove HAVE_STRING_H
* libguile/gen-scmconfig.c: remove HAVE_LIMITS_H, HAVE_TIME_H, STDC_HEADERS
    Remove SCM_HAVE_STDC_HEADERS
* libguile/hash.c: include <wchar.h>, remove HAVE_WCHAR_H
* libguile/net_db.c: include <string.h>, remove HAVE_STRING_H
* libguile/numbers.h: remove SCM_HAVE_STDC_HEADERS
* libguile/regex-posix.c: include <wchar.h>, remove HAVE_WCHAR_H
  (fixup_multibyte_match): always defined
  (scm_regexp_exec): use fixup_multibyte_match
* libguile/scmsigs.c: remove STDC_HEADERS
* libguile/socket.c: include <string.h>, remove HAVE_STRING_H
* test-suite/standalone/test-unwind.c: include <string.h>, remove HAVE_STRING_H
2022-10-08 06:16:35 -07:00
Mike Gran
ddd03c6123 Remove AC_HEADER_STDC from configure.ac
Requiring C99 implies standard headers are available

* configure.ac: remove AC_HEADER_STDC
2022-10-08 06:16:34 -07:00
Mike Gran
c8a10a47fc Remove obsolete macro AM_PROG_CC_C_O in configure script
It has been replaced by new functionality in AC_PROG_CC

* configure.ac: remove AM_PROG_CC_C_O
2022-10-08 06:16:34 -07:00
Mike Gran
a0d19cba69 Use autoconf's ability to choose the latest version of C
Modern AC_PROG_CC will add flags to enable C11 when necessary.

* configure.ac: remove AC_PROG_CC_C99, rely on updated AC_PROG_CC
2022-10-08 06:16:33 -07:00
Mike Gran
7a87a42cbc Presume const is always available
* configure.ac (AC_C_CONST): removed
2022-10-08 06:16:33 -07:00
Mike Gran
02bdbacc8d Update libtool initialization in configure script
* configure.ac (AC_LIBTOOL_WIN32_DLL, AC_LIBTOOL_DLOPEN): removed
  (AC_PROG_LIBTOOL): removed
  (LT_INIT): added
2022-10-08 06:16:32 -07:00
Daniel Llorens
584ba588e5 Test for out of range depth in fluid-ref*
Test for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58154, which was
fixed in c0004442b7.
2022-10-03 12:19:58 +02:00
Mike Gran
45cc892fe3 Modifies command line quoting in c-api.test
On MinGW, 'system' uses a non-posix shell that does not handle
apostrophe as a quoting character. For this test, quoting a command-line
with double quotes allows it to be run with both /bin/sh and cmd.exe.

* test-suite/tests/c-api.test (egrep): use double quotes when
  quoting command line
2022-10-02 07:30:48 -07:00
Mike Gran
f5c064576d Avoids deprecated egrep in c-api.test
The standalone egrep script has been deprecated by GNU grep.
'grep -E' is the suggested replacement.

* test-suite/tests/c-api.test (egrep): replace egrep with grep -E
2022-10-02 07:23:52 -07:00
Ludovic Courtès
3ed7673ac0 srfi-35: Fix expansion of 'condition' for compound conditions.
* module/srfi/srfi-35.scm (condition): Use 'make-exception' instead of
'make-compound-condition', which is unbound in this module.
* test-suite/tests/srfi-35.test ("syntax")["compound condition,
hygienic macro expansion"]: New test.
2022-10-01 18:04:16 +02:00
Antoine Kalmbach
78c7772eb7 doc: Fix typo in 'coverage-data->lcov' example.
* doc/ref/api-coverage.texi (Code Coverage): Close PORT, not FILE, in
the example.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-01 16:00:05 +02:00
Fulbert
b16dbb14bc doc: Fix typo under "CPS Soup".
* doc/ref/compiler.texi (CPS Soup) : fix small typo in doc (closing
paren out of @code{} tag).

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-01 16:00:05 +02:00
Fulbert
6c4738ee4c doc: Clarify reference to (sxml transform) module.
* doc/ref/sxml.texi (7.21.4 Transforming SXML): Adds a mention to the
module to be imported for the procedures introduced in this section of
the documentation..

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-10-01 16:00:05 +02:00
Ludovic Courtès
e2797f529b Baseline compiler no longer crashes on (not (list 1 2)).
Fixes <https://bugs.gnu.org/58217>.

* module/language/tree-il/compile-bytecode.scm (canonicalize)
[finish-conditional](predicate?): Do not assume 'lookup-primitive'
returns true.
* test-suite/tests/compiler.test ("regression tests")
["(not (list 1 2))"]: New test.
2022-10-01 16:00:05 +02:00
Ludovic Courtès
df86a2a8c8 Finalization thread exits when it gets EOF on its pipe.
Avoids spurious "error in finalization thread: Success" messages when
the finalization pipe gets closed.

* libguile/finalizers.c (finalization_thread_proc): Return when 'data.n'
is zero.
2022-10-01 16:00:05 +02:00
Daniel Llorens
d1a4b101bf Fix doc for string args to error C API 2022-09-30 12:04:15 +02:00
Daniel Llorens
c0004442b7 Fix bad arguments to range_error() in numbers.c
Fixes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58154. Ouch.
2022-09-30 12:02:12 +02:00
Mike Gran
426ed4068a in ftw test, skip EACCESS test on MinGW
MinGW ACL-based permissions don't follow POSIX standard, so
'chmod' has unexpected behavior.

* test-suite/tests/ftw.test (mingw?): new define
  ("file system fold: EACCES"): skip test on MinGW
2022-09-20 19:50:14 -07:00
Mike Gran
775149f0f5 in ftw test, don't presume symlink is defined
* test-suite/tests/ftw.test (dangling symlink and lstat)
  (dangling symlink and stat, symlink to directory):
    skip if symlink undefined
2022-09-20 19:30:38 -07:00
Michael Gran
130463be2a When fork unavailable, skip standalone tests that require it
MinGW is missing fork.

* test-suite/standalone/test-close-on-exec: modified
* test-suite/standalone/test-signal-fork: modified
2022-09-20 15:09:35 -07:00
Ludovic Courtès
61393a5da6 test-suite: Remove obsolete use of 'debug-enable'.
* test-suite/guile-test (enable-debug-mode): Remove 'debug-enable' call.
2022-09-19 22:30:16 +02:00
Ludovic Courtès
1d313bf5f0 'pipe' now takes an optional 'flags' parameter.
This is the same strategy as used for the 'accept4' bindings introduced
in 6e0965104c.

* libguile/posix.c (scm_pipe): Rename to...
(scm_pipe2): ... this.  Add an optional 'flags' parameter and honor it.
(scm_pipe): Rewrite as a call to 'scm_pipe2'.
* libguile/posix.h (scm_pipe2): New declaration.
* test-suite/tests/posix.test ("pipe"): New tests.
* configure.ac: Look for 'pipe2'.
* NEWS: Update.
2022-09-19 22:30:16 +02:00
jgart
9592516bfa string-fun: Fix typo 2022-09-17 13:41:47 +02:00
Ludovic Courtès
0aa1a9976f 'primitive-load' opens files with O_CLOEXEC.
Fixes <https://bugs.gnu.org/57567>.

* libguile/load.c (scm_primitive_load): Add "e" flag to
'scm_open_file_with_encoding' argument.
* NEWS: Update.
2022-09-07 18:00:30 +02:00
Ludovic Courtès
a356ceebee Add support for "e" flag (O_CLOEXEC) to 'open-file'.
* libguile/fports.c (scm_i_mode_to_open_flags): Add 'e' case.
(scm_open_file_with_encoding): Document it.
* test-suite/standalone/test-close-on-exec: New file.
* test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add it.
* doc/ref/api-io.texi (File Ports): Document it.
* NEWS: Update.
2022-09-07 18:00:30 +02:00
Ludovic Courtès
3cd4881504 doc: Add documentation of the "b" flag to 'open-file'.
* doc/ref/api-io.texi (File Ports): Add documentation of the "b" flag,
taken from the 'open-file' docstring.
2022-09-07 18:00:30 +02:00
Jean Abou Samra
61d8dab8ea In curried definitions, move docstrings to outermost lambda
This makes the docstring attached to the curried function being defined
rather than the result of its application until a function that runs the
body is obtained, fixing
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50068
2022-08-29 11:45:39 +02:00
Andrew Whatson
eb5ecf4944 Properly display locations in "source vector" form.
Locations are stored in tree-il records in "source vector" form, but
`location-string' was rendering these as <unknown-location>.

* module/system/base/message.scm (location-string): Support locations
passed as a file/line/column vector.
2022-08-26 12:34:39 +02:00
jgart
c746586de3 doc: Add car+cdr example 2022-08-11 13:31:48 +02:00
Ludovic Courtès
56b1ea9002 'system*' can no longer close file descriptor 2.
Fixes <https://bugs.gnu.org/55596>.
Reported by Hugo Nobrega <hugonobrega@ic.ufrj.br>
and Jack Hill <jackhill@jackhill.us>.

* libguile/posix.c (start_child): Close OUT only if it's greater than 2.
* test-suite/tests/posix.test ("system*")["exit code for nonexistent file"]
["https://bugs.gnu.org/55596"]: New tests.
2022-08-05 14:20:51 +02:00
Ludovic Courtès
01e960edea Update NEWS.
* NEWS: Update.
2022-08-04 16:01:55 +02:00
Ludovic Courtès
317b06bf86 web: 'tls-wrap' retries handshake upon non-fatal errors.
Fixes <https://bugs.gnu.org/49223>.
Reported by Domagoj Stolfa <ds815@gmx.com>.

Backport of Guix commit b36267b1d96ac344d2b42c9822ce04b4c3117f85.

* guix/build/download.scm (tls-wrap): Retry up to 5 times when
'handshake' throws a non-fatal error.
2022-08-04 15:59:23 +02:00
Ludovic Courtès
c01ca10b3f web: Do not wrap TLS port on GnuTLS >= 3.7.7.
The custom input/output port wrapping the TLS session record port would
introduce overhead, and it would also prevent its uses in a non-blocking
context--e.g., with Fibers.  The port close mechanism added in GnuTLS
3.7.7 allows us to get rid of that wrapper.

Backported from Guix commit dd573ceea73295c7a872088ecd91e5f0fd74bf2b.

* web/client.scm (wrap-record-port-for-gnutls<3.7.7): New procedure,
with code formerly in 'tls-wrap'.
(tls-wrap): Check for 'set-session-record-port-close!' and use it when
available; otherwise call 'wrap-record-port-for-gnutls<3.7.7'.
2022-08-04 15:59:23 +02:00
Daniel Llorens
50d4b50203 Check for gperf at configure time
Edited Arne Babenhauserheide's patch
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51129;att=0;filename=0001-autoconf-Check-for-gperf-if-running-from-git.patch;msg=5.

Fixes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51129.
2022-08-02 15:08:57 +02:00
Ludovic Courtès
8c976c6a1f Update NEWS.
* NEWS: Update.
2022-07-04 11:52:14 +02:00
Ludovic Courtès
abd39f3328 Define IPPROTO_IPV6 and IPV6_V6ONLY.
* libguile/socket.c (scm_init_socket): Define IPPROTO_IPV6 and IPV6_V6ONLY.
* doc/ref/posix.texi (Network Sockets and Communication): Document them.
2022-07-04 11:49:31 +02:00
Ludovic Courtès
6da4be170a Define IN6ADDR_ANY and IN6ADDR_LOOPBACK.
* libguile/socket.c (scm_init_socket): Define IN6ADDR_ANY and IN6ADDR_LOOPBACK.
* doc/ref/posix.texi (Network Address Conversion): Document them.
2022-07-04 11:39:14 +02:00
Christopher Baines
baa1424335 web: Don't hide missing data in the chunked input port.
This port is of limited use if it cannot be used reliably. Rather than
behaving as if the input has finished when it ends unexpectedly, instead
raise an exception.

* module/web/http.scm (make-chunked-input-port): Raise an exception on
premature termination.
(&chunked-input-ended-prematurely): New exception type.
(chunked-input-ended-prematurely-error?): New procedure.
* test-suite/tests/web-http.test (pass-if-named-exception): Rename to
pass-if-named-exception.
(pass-if-named-exception): New syntax.
("Exception on premature chunk end"): New test for this behaviour.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-07-04 11:22:13 +02:00
Christopher Baines
9a3353a993 web: Handle ending CRLF (\r\n) for chunked input and output ports.
The chunked transfer encoding specifies the chunked body ends with
CRLF. This is in addition to the CRLF at the end of the last chunk, so
there should be CRLF twice at the end of the chunked body:

  https://datatracker.ietf.org/doc/html/rfc2616#section-3.6.1

* module/web/http.scm (make-chunked-input-port): Read two extra bytes at
the end of the chunked input.
(make-chunked-output-port): Write the missing \r\n when closing the
port.
* test-suite/tests/web-http.test (chunked encoding): Add missing \r\n to
test data.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-07-04 11:22:11 +02:00
Aleix Conchillo Flaqué
a84d8f6473 web: send capitalized authorization header scheme
* module/web/http.scm (write-credentials): capitalize authorization
header scheme. The standard allows the scheme to be case-insensitive,
however most libraries out there expect the scheme to be capitalized,
which is what it is actually used in RFC
docs (e.g. https://datatracker.ietf.org/doc/html/rfc7617#section-2). Some
libraries even reject lowercase scheme making Guile incompatible.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-07-04 11:16:36 +02:00
Ludovic Courtès
7e048c6c51 Update NEWS.
* NEWS: Update.
2022-06-16 10:06:32 +02:00
Jessica Tallon
4456245753 Add missing #:modules argument for coverage-data->lcov.
The code coverage function `coverage-data->lcov` has a documented
`modules` argument, however that was missing from the source. I have
added it so when supplied it only converts the coverage data for the
supplied modules. If not supplied it defaults the old behavour of
including all the modules currently loaded.

* module/system/vm/coverage.scm (coverage-data->lcov): Add #:modules
parameter and honor it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-06-16 10:01:06 +02:00
Liliana Marie Prikler
01b686b701 Allow null bytes in UNIX sockets.
The current socket address constructors all assume, that there are no
null bytes in the socket path.  This assumption does not hold in Linux,
which uses an initial null byte to demarcate abstract sockets and
ignores all further null bytes [1].

[1] https://www.man7.org/linux/man-pages/man7/unix.7.html

* libguile/sockets.c (scm_fill_sockaddr)[HAVE_UNIX_DOMAIN_SOCKETS]:
Use scm_to_locale_stringn to construct c_address.
Use memcpy instead of strcpy and calculate size directly instead of
using SUN_LEN.
(_scm_from_sockaddr): Copy the entire path up to the limits imposed by
addr_size.
* test-suite/tests/00-socket.test: ("make-socket-address"): Add case for
abstract unix sockets.
("AF_UNIX/SOCK_STREAM"): Add abstract socket versions of bind, listen,
connect and accept.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-06-16 09:54:29 +02:00