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

18306 commits

Author SHA1 Message Date
Michael Gran
6d6bc013e1 Fix regression in 00-repl-server.test
* test-suite/tests/00-repl-server.test (call-with-repl-server): use provided?
2018-04-25 20:58:54 -07:00
Michael Gran
cd2d5a2500 Let suspendable ports' read-line handle alternate line endings
Handle CRLF, NEL, LS and PS to match the new C implementation.

* module/ice-9/suspendable-ports.scm (%read-line): handle alternate line endings
  (read-line): use new %read-line
2018-04-25 20:36:43 -07:00
Michael Gran
d5b48cb039 Don't presume sigset_t available in <signal.h>
In MinGW, sigset_t is not availab.e

* libguile/gen-scmconfig.c (SCM_HAVE_PTHREAD_SIGMASK): new conditional
* libguile/null-threads.h (scm_i_pthread_sigmask): now conditional on
    SCM_HAVE_PTHREAD_SIGMASK
2018-04-25 14:52:22 -07:00
Michael Gran
925485c276 typo, lost a parenthesis
* libguile/posix-w32.c (start_child): fix build regression
2018-04-19 17:10:52 -07:00
Michael Gran
d21e7074c7 make strftime compile with null threads
* libguile/stime.c (scm_strftime): use scm_i_pthread_mutex_lock
    instead of scm_pthread_mutex_lock
2018-04-19 17:09:38 -07:00
Michael Gran
016d8ba80d the repl server test requires AF_UNIX
* test-suite/tests/00-repl-server.test: quit if AF_UNIX is not defined
2018-04-19 13:25:00 -07:00
Michael Gran
57355ee431 posix.test should handle missing ttyname command
* test-suite/tests/posix.test ("ttyname"): handle undefined case
2018-04-19 13:23:12 -07:00
Michael Gran
b2a50874bb In win32, system* shouldn't launch shell when command not found
When system* was called to execute a script/excutable without args, if
that did not exist, it would launch an interactive session. Now it fails
with an error.

* libguile/posix-w32.c (start_child): return when cmd not found
* test-suite/tests/posix.test (system*): system* test should handle errors
2018-04-19 13:21:47 -07:00
Michael Gran
98f4024e0a test-unwind leaks a file descriptor
* test-suite/standalone/test-unwind.c (check_ports): explicitly close temp file
2018-04-18 08:58:42 -07:00
Michael Gran
0863e3d2fb test shouldn't presume UTF-8 can be installed
Add a skip to test-command-line-encoding if a UTF-8 locale wasn't installed.

* test/suite/standalone/test-command-line-encoding: modified
2018-04-18 06:25:54 -07:00
Michael Gran
124766916e test-foreign-object-c needs libgnu
With the last update of gnulib, test-foreign-object-c now needs libgnu
linked in.

* test-suite/standalone/Makefile.am
2018-04-18 06:22:30 -07:00
Michael Gran
eac111dde6 Wrong preprocessor test for include guard for sys/select.h
Should use #if SCM_HAVE_SYS_SELECT_H

* libguile/iselect.h: [SCM_HAVE_SYS_SELECT_H] guarde inclusion of sys/select.h
2018-04-18 06:20:31 -07:00
Michael Gran
6d325a7a27 simplify reading http headers using updated %read-line
%read-line can handle CRLF now.

* module/web/http.scm (read-header-line): modified
2018-04-17 17:36:55 -07:00
Michael Gran
77b33170f4 Let read-line handle alternate line endings
Adds CRLF, NEL, PS and LS as line endings. %read-line will return
these. In the case of CRLF, %read-line will return a string "\r\n"
as the line ending.

* libguile/rdelim.c (scm_read_line): handle more line delimiters
* test-suite/tests/rdelim.test ("two lines, split, CRLF"): new test
  ("two long lines, split, CRLF", "two lines, split, NEL"): new tests
  ("two lines, split, LS", "two lines, split, PS"): new tests
2018-04-17 08:22:18 -07:00
Michael Gran
34131e3ac5 ftw test should handle missing symlink procedure
Throw unresolved if symlink is not defined

* test-suite/tests/ftw.test (dangling symlink and lstat): modified
  (dangling symlink and stat): modified
  (file-system-tree test-suite): modified
  (symlink to directory): modified
2018-04-16 21:07:15 -07:00
Michael Gran
1405b76dbc ice-9 ftw: handle non-working inodes
* module/ice-9/ftw.scm (visited?-proc): accept filename for string hash
  (file-system-fold): use string hash if ino = 0
  (ftw): use new visited?-proc
* test-suite/tests/ftw.test (visited?-proc valid inodes): add filenames to visited?-proc calls
  (visited?-proc broken inodes): new tests
  (%top-srcdir): canonicalize-path
2018-04-16 20:57:12 -07:00
Michael Gran
5cad80262a ice-9 ftw: handle missing getuid and getgid
* module/ice-9/ftw.scm (getuid-or-false, getgid-or-false): new macros
  (stat-dir-readable?-proc): don't overwrite arguments
  (ftw, nftw): use new macros
* test-suite/tests/ftw.test (test-EACCES): don't presume getuid exists
2018-04-16 20:38:38 -07:00
Michael Gran
851c05a584 remove a re-definition of when/unless
They are now in core library.

* module/scripts/snarf-check-and-output-texi.scm (when, unless): removed
2018-04-16 19:19:24 -07:00
Michael Gran
7b6c483595 In libpath.h, use absolute paths on MinGW
* libguile/Makefile.am (libpath.h): convert msys paths to absolute paths
2018-04-16 19:06:31 -07:00
Michael Gran
82832992c4 Don't presume existence of sys/select.h in headers
* libguile/iselect.h: guard sys/select.h with winsock2.h as fallback
2018-04-16 10:31:42 -07:00
Michael Gran
dbc10620a4 SCM-to-C number conversion functions incorrect when SIZEOF_LONG != SIZEOF_SCM_T_BITS
* libguile/conv-integer.i.c (SCM_FROM_TYPE_PROTO, SCM_TO_TYPE_PROTO):
    prefer fixnum size to scm_t_bits size
* libguile/conv-uinteger.i.c (SCM_FROM_TYPE_PROTO, SCM_TO_TYPE_PROTO):
    prefer fixnum size to scm_t_bits size
2018-04-13 14:20:02 -07:00
Michael Gran
c56d2d1023 Fix binary output for mkstemp! on MinGW
* libguile/filesys.c (scm_i_mkstemp): Don't mask out O_BINARY flag
* test-suite/tests/posix.test ("binary mode-honored"): new test
2018-04-11 18:36:08 -07:00
Michael Gran
a2b20d8faf Use gnulib for getpagesize
* lib/Makefile.am: updated
* lib/getpagesize.c: new file
* lib/getpagesize.m4: new file
* lib/gnulib-cache.m4: updated
* lib/gnulib-comp.m4: updated
2018-04-10 16:36:12 -07:00
Michael Gran
ebfff0c6a9 Use gnulib for mktime
* lib/Makefile.am: updated
* m4/gnulib-cache.m4: updated
* m4/gnulib-comp.m4: updated
2018-04-10 16:30:54 -07:00
Michael Gran
c90b9cdf8e Use gnulib for gethostname
From gnulib-0.1 b03f418b

* lib/Makefile.am: updated
* lib/gethostname.c: new file
* lib/gethostname.m4: new file
* m4/gnulib-cache.m4: updated
* m4/gnulib-comp.m4: updated
2018-04-10 15:40:45 -07:00
Michael Gran
b9731ee5ee start_child should return pid_t
This is to make the definition and declaration agree.

* posix-w32.h: change return value of start_child to pid_t
2018-04-10 14:01:12 -07:00
Michael Gran
9bf1ae81e1 Conditionally include netinet/tcp.h
It is not present on MinGW.

* configure.ac: (AC_CHECK_HEADERS) add netinet/tcp.h
* socket.c: [HAVE_NETINET_TCP_H] conditionally include netinet/tcp.h
2018-04-10 12:19:38 -07:00
Arun Isaac
01f97cfc0a Fix minor typo in the PEG documentation.
* doc/ref/api-peg.texi (PEG Internals): Fix minor typo.

Signed-off-by: Mark H Weaver <mhw@netris.org>
2018-03-16 00:15:12 -04:00
Mark H Weaver
6d9c6833e7
Fix a few typos in the manual.
Fixes <https://bugs.gnu.org/30276>.
Reported by Matt Wette <matt.wette@gmail.com>.

* doc/ref/api-macros.texi (Macro Expansion)
doc/ref/vm.texi (Procedure Call and Return Instructions): Fix typos.
2018-03-16 00:09:26 -04:00
Mark H Weaver
b56e084c77
Fix eta-conversion edge cases in peval.
Fixes <https://bugs.gnu.org/29520>.
Reported by Stefan Israelsson Tampe <stefan.itampe@gmail.com>.

* module/language/tree-il/peval.scm (peval)[lift-applied-lambda]: Before
performing eta-conversion, check that the variable(s) passed to the
inner 'apply' are not referenced from the inner lambda, and that the
number of required arguments would not be reduced by the conversion.
2018-03-15 23:22:26 -04:00
Shea Levy
08bb462836
Recognize RISC-V compilation targets.
* module/system/base/target.scm (cpu-endianness): Add case for "riscv" variants.

Signed-off-by: Shea Levy <shea@shealevy.com>
Signed-off-by: Mark H Weaver <mhw@netris.org>
2018-03-15 23:15:44 -04:00
Ludovic Courtès
3986053959 srfi-18: 'thread-sleep!' timeout-as-a-number is relative.
This is a followup to <https://bugs.gnu.org/29704>.

* module/srfi/srfi-18.scm (thread-sleep!): When TIMEOUT is a number,
keep it as-is.
* test-suite/tests/srfi-18.test ("thread sleep with number"): Pass 0 as
the timeout.
("thread sleeps fractions of a second"): Pass 0.5 as the timeout.
2018-02-16 15:29:35 +01:00
Ludovic Courtès
2c7b350f93 srfi-18: When timeout is a number, it's a relative number of seconds.
Fixes <https://bugs.gnu.org/29704>.
Reported by David Beswick <dlbeswick@gmail.com>.

* module/srfi/srfi-18.scm (timeout->absolute-time): New procedure.
(mutex-lock!): Use it in 'thread:lock-mutex' call.
(mutex-unlock!): Use it.
* test-suite/tests/srfi-18.test ("mutex-lock! returns false on timeout")
("mutex-lock! returns true when lock obtained within timeout")
("recursive lock waits")
("mutex unlock is false when condition times out"): Adjust cases where
the 'timeout' parameter is a number so that it's a relative number.
2018-02-16 15:29:35 +01:00
Ludovic Courtès
9417fdb80f doc: Fix typo about SRFI-4 syntax.
Reported by Matt Wette <matt.wette@gmail.com>.
Fixes <https://bugs.gnu.org/29910>.

* doc/ref/api-data.texi (Array Syntax): Fix typo.
2018-02-16 15:29:35 +01:00
Ludovic Courtès
7ade0485af build: Use 'sed' invocation compatible with BSD sed.
Fixes <https://bugs.gnu.org/30011>.
Reported by ilove zfs <ilovezfs@icloud.com>.

* libguile/Makefile.am (INSTANTIATE): Move '-i' first.
2018-02-16 15:29:35 +01:00
Ludovic Courtès
f390afa0cc 'select' returns empty sets upon EINTR and EAGAIN.
Fixes <https://bugs.gnu.org/30368>.

* libguile/filesys.c (scm_select): Clear READ_SET, WRITE_SET, and
EXCEPT_SET when RV < 0.
2018-02-16 15:29:35 +01:00
Andy Wingo
07b7490f73 Sync IP before allocating closures
* libguile/vm-engine.c (vm_engine): Sync IP before allocating closures.
2018-01-26 09:49:00 +01:00
Ludovic Courtès
a1793bc904 Revert "Honor '%fresh-auto-compile'."
This reverts commit 83d4c4d622,
which came from a misunderstanding.
2018-01-15 23:17:24 +01:00
Ludovic Courtès
d01e0b084e No tabs in C code.
* .dir-locals.el (c-mode): Set 'indent-tabs-mode' to nil in C.
2018-01-11 15:25:17 +01:00
Ludovic Courtès
cc8f41e7d8 Make sure the return value of 'scm_crypt' is always initialized.
* libguile/posix.c (scm_crypt): Always initialize 'ret'; error out even
when ERR is zero.
2018-01-10 16:19:09 +01:00
Ludovic Courtès
988aa29238 compile: Load language modules upfront.
Fixes a bug whereby "guild compile --target=arm-linux-gnueabihf
--from=elisp ... language/elisp/boot.el" would fail with an exception
from 'load-thunk-from-memory' while trying to load (language elisp spec)
from the guile-being-compiled instead of using that of the
guile-for-build.

The problem did not manifest with --from=scheme because (language scheme
spec) happened to be already loaded before we had changed %load-path.

* module/scripts/compile.scm (compile): Add calls to 'lookup-language'.
2017-12-22 17:00:33 +01:00
Ludovic Courtès
deef64a739 'load-thunk-from-memory' reports the correct error.
Previously 'load-thunk-from-memory' would often throw to 'system-error'
when passed an incorrect ELF file, leading to incorrect error messages.

* libguile/loader.c (load_thunk_from_memory): Reset 'errno' when
'check_elf_header' returns non-NULL.
* test-suite/tests/vm.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add it.
2017-12-22 11:40:27 +01:00
Ludovic Courtès
6d391bf1a4 Fix 'crypt' deadlock upon error.
* libguile/posix.c (scm_crypt): Take 'scm_i_misc_mutex' right before
calling 'crypt'.  Move 'SCM_SYSERROR' call after 'scm_dynwind_end'.
* test-suite/tests/posix.test ("crypt"): New test prefix.
2017-12-22 11:12:57 +01:00
Ludovic Courtès
2c7d6031f3 doc: Update LALR URL.
Reported by Chris Vine <vine35792468@gmail.com>.

* doc/ref/api-lalr.texi (LALR(1) Parsing): Update URL.
2017-12-14 10:18:23 +01:00
Andy Wingo
edd9727935 Bump version for Guile 2.2.3.
* GUILE-VERSION (GUILE_MICRO_VERSION, LIBGUILE_INTERFACE_CURRENT)
  (LIBGUILE_INTERFACE_AGE): Increment.
2017-12-01 11:58:15 +01:00
Andy Wingo
ca4d16c7dc Update NEWS for 2.2.3
* NEWS: Update.
2017-12-01 11:34:58 +01:00
Andy Wingo
19c0e30243 Avoid generating arity-adapting zero-value conts where possible
* module/language/tree-il/compile-cps.scm (adapt-arity, convert): Avoid
  generating arity-adapting continuations for nullary continuations.
2017-12-01 11:01:39 +01:00
Andy Wingo
83042571c1 Avoid generating arity-adapting continuations if not needed
* module/language/tree-il/compile-cps.scm (adapt-arity): Allow k to be
  $kargs for the 1-valued case.
  (convert): For single-valued continuations where the definition is
  clearly single-valued, avoid making a needless $kreceive and extra
  "rest" binding that will just be filled with () and have to be
  eliminated later.
2017-11-30 18:32:35 +01:00
Andy Wingo
3e6857a535 -O1 disables call precoloring
* module/language/cps/compile-bytecode.scm (compile-function)
  (emit-bytecode):
* module/language/cps/slot-allocation.scm (allocate-slots):
* module/language/cps/optimize.scm (cps-default-optimization-options):
  Allow the "lazy vars" optimization, a form of slot precoloring, to be
  disabled.  It will be disabled at -O0 or -O1, to speed compilation
  times.
2017-11-30 17:02:27 +01:00
Andy Wingo
bb77c0f537 Improve CSE complexity
* module/language/cps/cse.scm (compute-available-expressions):
  (compute-equivalent-subexpressions): Improve algorithmic complexity of
  CSE by pre-computing the labels whose reads are clobbered by a label's
  writes.
2017-11-30 13:10:03 +01:00