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
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
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
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
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
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.
* 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>
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.
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.
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'.
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.
* 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.
* 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.
* 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.
* 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.