summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Presume ISO C90 functions are always availableMike Gran2022-10-144-21/+5
| | | | | | | | | | * 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
* Presume ISO C90 headers are always availableMike Gran2022-10-1412-70/+21
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove AC_HEADER_STDC from configure.acMike Gran2022-10-141-1/+0
| | | | | | Requiring C99 implies standard headers are available * configure.ac: remove AC_HEADER_STDC
* Remove obsolete macro AM_PROG_CC_C_O in configure scriptMike Gran2022-10-141-3/+0
| | | | | | It has been replaced by new functionality in AC_PROG_CC * configure.ac: remove AM_PROG_CC_C_O
* Use autoconf's ability to choose the latest version of CMike Gran2022-10-141-12/+4
| | | | | | 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
* Presume const is always availableMike Gran2022-10-141-2/+0
| | | | * configure.ac (AC_C_CONST): removed
* Update libtool initialization in configure scriptMike Gran2022-10-141-4/+1
| | | | | | * configure.ac (AC_LIBTOOL_WIN32_DLL, AC_LIBTOOL_DLOPEN): removed (AC_PROG_LIBTOOL): removed (LT_INIT): added
* doc: Document how (ice-9 format) replaces 'format'.Jean Abou Samra2022-10-122-1/+18
| | | | | | | * doc/ref/misc-modules.texi (Formatted Output): Add paragraph. * module/ice-9/format.scm: Add comment. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* Define SO_RCVTIMEO and SO_SNDTIMEO.Christopher Baines2022-10-122-0/+46
| | | | | | | | | | | | | These are important for reliable networking, since they prevent network operations from hanging indefinitely. * libguile/socket.c (scm_init_socket): Define SO_RCVTIMEO and SO_SNDTIMEO. (scm_getsockopt, scm_setsockopt): Include SO_RCVTIMEO and SO_SNDTIMEO in docstring and handle them. * doc/ref/posix.texi (Network Sockets and Communication): Document them. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Update reference to the GNU Coding Standards.Daniel Llorens2022-10-121-3/+2
|
* Test for out of range depth in fluid-ref*Daniel Llorens2022-10-031-0/+4
| | | | | Test for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58154, which was fixed in c0004442b7691f59a0e37869ef288eb26382ad9e.
* Modifies command line quoting in c-api.testMike Gran2022-10-021-1/+1
| | | | | | | | | 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
* Avoids deprecated egrep in c-api.testMike Gran2022-10-021-2/+2
| | | | | | | 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
* srfi-35: Fix expansion of 'condition' for compound conditions.Ludovic Courtès2022-10-012-5/+19
| | | | | | | * 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.
* doc: Fix typo in 'coverage-data->lcov' example.Antoine Kalmbach2022-10-011-1/+1
| | | | | | | * doc/ref/api-coverage.texi (Code Coverage): Close PORT, not FILE, in the example. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* doc: Fix typo under "CPS Soup".Fulbert2022-10-011-1/+1
| | | | | | | * 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>
* doc: Clarify reference to (sxml transform) module.Fulbert2022-10-011-8/+8
| | | | | | | | * 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>
* Baseline compiler no longer crashes on (not (list 1 2)).Ludovic Courtès2022-10-013-2/+12
| | | | | | | | | | 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.
* Finalization thread exits when it gets EOF on its pipe.Ludovic Courtès2022-10-011-3/+6
| | | | | | | | 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.
* Fix doc for string args to error C APIDaniel Llorens2022-09-301-7/+7
|
* Fix bad arguments to range_error() in numbers.cDaniel Llorens2022-09-301-2/+2
| | | | Fixes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58154. Ouch.
* in ftw test, skip EACCESS test on MinGWMike Gran2022-09-201-3/+9
| | | | | | | | 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
* in ftw test, don't presume symlink is definedMike Gran2022-09-201-34/+40
| | | | | | * test-suite/tests/ftw.test (dangling symlink and lstat) (dangling symlink and stat, symlink to directory): skip if symlink undefined
* When fork unavailable, skip standalone tests that require itMichael Gran2022-09-202-1/+7
| | | | | | | MinGW is missing fork. * test-suite/standalone/test-close-on-exec: modified * test-suite/standalone/test-signal-fork: modified
* test-suite: Remove obsolete use of 'debug-enable'.Ludovic Courtès2022-09-191-3/+2
| | | | * test-suite/guile-test (enable-debug-mode): Remove 'debug-enable' call.
* 'pipe' now takes an optional 'flags' parameter.Ludovic Courtès2022-09-196-9/+110
| | | | | | | | | | | | | This is the same strategy as used for the 'accept4' bindings introduced in 6e0965104c579431e5a786b60e1a964a112c73b8. * 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.
* string-fun: Fix typojgart2022-09-171-1/+1
|
* 'primitive-load' opens files with O_CLOEXEC.Ludovic Courtès2022-09-072-2/+4
| | | | | | | | Fixes <https://bugs.gnu.org/57567>. * libguile/load.c (scm_primitive_load): Add "e" flag to 'scm_open_file_with_encoding' argument. * NEWS: Update.
* Add support for "e" flag (O_CLOEXEC) to 'open-file'.Ludovic Courtès2022-09-075-2/+59
| | | | | | | | | * 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.
* doc: Add documentation of the "b" flag to 'open-file'.Ludovic Courtès2022-09-071-0/+4
| | | | | * doc/ref/api-io.texi (File Ports): Add documentation of the "b" flag, taken from the 'open-file' docstring.
* In curried definitions, move docstrings to outermost lambdaJean Abou Samra2022-08-292-34/+86
| | | | | | | 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
* Properly display locations in "source vector" form.Andrew Whatson2022-08-261-6/+13
| | | | | | | | 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.
* doc: Add car+cdr examplejgart2022-08-111-0/+7
|
* 'system*' can no longer close file descriptor 2.Ludovic Courtès2022-08-052-4/+17
| | | | | | | | | | 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.
* Update NEWS.Ludovic Courtès2022-08-041-0/+2
| | | | * NEWS: Update.
* web: 'tls-wrap' retries handshake upon non-fatal errors.Ludovic Courtès2022-08-041-15/+21
| | | | | | | | | | 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.
* web: Do not wrap TLS port on GnuTLS >= 3.7.7.Ludovic Courtès2022-08-041-55/+55
| | | | | | | | | | | | | | 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'.
* Check for gperf at configure timeDaniel Llorens2022-08-021-14/+22
| | | | | | | 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.
* Update NEWS.Ludovic Courtès2022-07-041-0/+10
| | | | * NEWS: Update.
* Define IPPROTO_IPV6 and IPV6_V6ONLY.Ludovic Courtès2022-07-042-0/+18
| | | | | * libguile/socket.c (scm_init_socket): Define IPPROTO_IPV6 and IPV6_V6ONLY. * doc/ref/posix.texi (Network Sockets and Communication): Document them.
* Define IN6ADDR_ANY and IN6ADDR_LOOPBACK.Ludovic Courtès2022-07-042-1/+18
| | | | | * libguile/socket.c (scm_init_socket): Define IN6ADDR_ANY and IN6ADDR_LOOPBACK. * doc/ref/posix.texi (Network Address Conversion): Document them.
* web: Don't hide missing data in the chunked input port.Christopher Baines2022-07-043-10/+36
| | | | | | | | | | | | | | | | | 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>
* web: Handle ending CRLF (\r\n) for chunked input and output ports.Christopher Baines2022-07-042-3/+4
| | | | | | | | | | | | | | | | | 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>
* web: send capitalized authorization header schemeAleix Conchillo Flaqué2022-07-042-5/+20
| | | | | | | | | | | * 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>
* Update NEWS.Ludovic Courtès2022-06-161-0/+17
| | | | * NEWS: Update.
* Add missing #:modules argument for coverage-data->lcov.Jessica Tallon2022-06-161-3/+9
| | | | | | | | | | | | | 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>
* Allow null bytes in UNIX sockets.Liliana Marie Prikler2022-06-162-10/+89
| | | | | | | | | | | | | | | | | | | | | | 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>
* Allow empty vendor string in GNU target triplets.Taylor R Campbell2022-06-162-2/+11
| | | | | | | | | | | | | | | | | NetBSD and pkgsrc have been using an empty vendor string since the mid-'90s, such as x86_64--netbsd. pkgsrc has been carrying around a workaround just the guile build for a long time. (Before that, NetBSD omitted the vendor altogether, so if x86_64 existed then it might have been `x86_64-netbsd', but that caused more problems.) This change makes Guile accept an empty vendor string so workarounds are no longer necessary. * module/system/base/target.scm (validate-target): Allow empty vendor string in GNU target triplets. * test-suite/tests/cross-compilation.test ("cross-compilation"): Add tests for "x86_64--netbsd". Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* Allow (library ...) form in cond-expand inside R7RS define-library.Mihail Iosilevich2022-06-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Guile (3.0.8) reports a compilation error when cond-expand tries to check existence of a missing library: scheme@(guile-user)> (define-library (test) (cond-expand ((library (scheme sort)) (import (scheme sort))))) While compiling expression: no code for module (scheme sort) It looks like bug #40252 was not fully eliminated. Also, (library ...) cannot handle module names like (srfi 1), though (import (srfi 1)) works fine. For example, this code fails: scheme@(guile-user)> (define-library (test) (cond-expand ((library (srfi 1)) (import (srfi 1))))) While compiling expression: In procedure symbol->string: Wrong type argument in position 1 (expecting symbol): 1 There are probably other cases when (library ...) and (import ...) does not work identically: (library ...) uses resolve-interface while (import ...) uses resolve-r6rs-interface. This patch fixes both issues. * module/ice-9/r7rs-libraries.scm (define-library): Replace 'resolve-interface' call by 'resolve-r6rs-interface', wrapped in 'cond-expand'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* 'module-define!' honors the 'module' parameter.Ludovic Courtès2022-06-161-2/+2
| | | | | * module/ice-9/boot-9.scm (module-define!): In 'module-add!' call, pass MODULE rather than (current-module).