Window's tmpnam expects that you will prepend it with the temporary
directory. Using _tempnam gives a path that is already prepended
with a temporary directory.
* NEWS: updated
* libguile/posix.c [_WIN32](scm_tmpnam): use _tempnam to create
a temporary filename
* test-suite/tests/posix.test ("tmpnam"): new test
On MINGW, and probably native Windows, closing a pipe does not
send SIGPIPE to a child process, so tests that need SIGPIPE to
close the child process are skipped.
* test-suite/tests/popen.test
("no duplicate", "open-process"): skip if SIGPIPE unsupported
* test-suite/tests/ports.test ("pipe: write"): modify to use and
awk script that terminates without SIGPIPE
* test-suite/tests/posix.test
("wc with stdin and stdout redirects"): skip if SIGPIPE unsupported
("awk with stdin and stdout redirects"): new test that doesn't require SIGPIPE
The GOOPS class precedence tests had been running in random order. This
sorts the tests before execution.
* test-suite/tests/goops.test ("class-precedence-list"): sort tests
For systems that do not have a posix shell.
* configure.ac (GUILE_TOOLS_EXE): new conditional
* libguile/Makefile.am (guile-tools)[GUILE_TOOLS_EXE]: new binary target
* libguile/guile-tools.c: new file
* meta/Makefile.am (guile.scm): new data
[!GUILE_TOOLS_EXE](install-exec-hook): don't alias guile-tools to guild
(CLEANFILES): add guild.exe
fr_FR was mostly being tested as an 8-bit locale. This changes
the tests to focus on fr_FR.utf8. But it adds a section for fr_FR 8-bit
currency. Divergence in vendor-supplied locales often occurs
in currency.
MINGW, which only handles 8-bit locales when using MSVCRT, was being tested
as if its 8-bit CP1252 locale was UTF-8. While the tests were included
as better than nothing, it is technically incorrect. These tests are
no longer run. Soon, Guile's MINGW build will link to UCRT, and it will
have UTF-8 locales.
The responses for some tests were modified to allow reasonable responses
from Cygwin/MSYS/MinGW locales and to skip on unreasonable responses.
* test-suite/tests/i18n.test (mingw?): rename to old-ms?
(old-ms?): new helper
(%french-locale-name): use platform's default 8-bit locale
(%french-utf8-locale-name, %turkish-utf8-locale-name, %german-utf8-locale-name)
(%greek-utf8-locale-name): don't use 8-bit locales on MINGW
("text collation (French)"): use utf-8
("locale-digit-grouping (French)"): use utf-8
(french-number-string=?): modify to make symmetric and to handle
U+2024 as a valid spacer
("French: integer", "negative integer" "fraction", "fraction, 1 digit"):
("French"): rename to "French UTF-8"
("French UTF-8: 12345.678", "Fraction"): use utf-8, allow U+2024
("French UTF-8: positive inexact zero"): expect euro sign
("French 8-bit"): new currency tests
Adds CRLF as a line ending. %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 CRLF line delimiter
* module/ice-9/suspendable-ports.scm (%read-line): modify to handle CRLF
line delimiter
(read-line): use modified %read-line
* test-suite/tests/rdelim.test ("two lines, split, CRLF"): new test
("two long lines, split, CRLF"): new test
* doc/ref/api-io.texi: update read-line documentation
On systems without SIGALRM, the other features of eval-in-sandbox
may still be useful. This adds the option to set #:time-limit to
#f to indicate no timeout.
* NEWS: updated
* module/ice-9/sandbox.scm (eval-in-sandbox): allow #:time-limit key
to be #f to disable time limit
* doc/ref/api-evaluation.texi (eval-in-sandbox): update documentation
* test-suite/tests/sandbox.scm ("eval-in-sandbox"): throw unsupported
if no SIGALARM
("eval-in-sandbox no timeout"): new tests for eval-in-sandbox
This variable will help indicate if, on Win32, the C library is
closer to C99 capable.
* libguile/posix.c (scm_init_posix): new define %UCRT
* test-suite/tests/i18n.test (old-ms?): use new define allow UTF-8
tests on MINGW
The line counter tests presumes newline-only line endings. Use binary
mode to avoid CRLF endings.
* test-suite/tests/ports.test ("line endings"): write test file in binary
mode
Guile has an enum scm_inline_gc_kind used to replace GC constants
that were private. Those defines were made public in 2015, so it
is should be safe to use them now.
Replace SCM_INLINE_GC_KIND_POINTERLESS with GC_I_PTRFREE.
Replace SCM_INLINE_GC_KIND_NORMAL with GC_I_NORMAL.
* libguile/gc-inline.h (scm_inline_gc_kind): remove type
(scm_inline_gc_alloc): kind argument is now int
(scm_inline_gc_malloc_pointerless): use GC_I_PTRFREE
(scm_inline_gc_malloc): use GC_I_NORMAL
* libguile/intrinsics.c (allocate_words_with_freelist): use GC_I_NORMAL
(allocate_pointerless_words): use GC_I_PTRFREE
For 64-bit Windows, there was an existing special setjmp handling
to avoid jumping into Guile frames. Expand this handling to 32-bit
Windows as well.
*
* libguile/posix-w32.c (mkdtemp): new win32 replacement procedure
* libguile/posix-w32.h: add declaration for mkdtemp
(HAVE_MKDTEMP): new define
* libguile/filesys.c: include posix-w32.h
FFS is missing on MINGW.
* libguile/lightening/lightening/x86-cpu.c
[__GNUC__ && _WIN32](USE_BUILTIN_FFS): new macro
(__ffs): wrapper function
(ffsw): use __ffs;
In the copy-file test, is uses call-with-input-file and get-string-all
to retrieve file contents. Since the file is not opened in binary mode,
CRLF line ending may be added when writing and then reading the string
back from the filesystem.
* test-suite/tests/filesys.test (normalize-newlines): new helper function
("copy file: copy-file dest content"): pass even if CRLF line endings
are added
("copy file: read only dest"): handle posibility of geteuid not
being defined
On Windows, a file needs to have write permission to be deleted.
This adds a helper to handle that case, but, is used generally.
* test-suite/tests/filesys.test (%delete-file): new helper function
Replace every delete-file call with %delete-file.
On Windows, open file ports cannot be deleted.
* test-suite/tests/ports.test ("relative canonicalization with common prefixes"):
close port before deletion
* test-suite/tests/posix.test (utime-unless-unsupported): take a port arg
("file port"): use new utime-unless-unsupported. Close port before deletion.
* test-suite/tests/filesys.test ("port representing a regular file"):
throw unsupported before creating file
open-pipe executes a shell command in a subprocess. This commit adds
the ability to modify the shell used for executing commands.
The default "/bin/sh -c" can be inspected and modified by the
new procedure-with-setter 'pipe-shell-command-transformer'.
This useful in MinGW since its "sh" is not in "/bin".
* module/ice-9/popen.scm (%command-transformer): new procedure
(pipe-shell-command-transformer): new procedure-with-setter
(open-pipe): use new command transformer
* doc/ref/posix.texi (open-pipe): mention pipe-shell-command-transformer
(pipe-shell-command-transformer): document new procedure
* test-suite/tests/popen.test ("pipe-shell-command-transformer"): new tests
Also, modify open-pipe shell for MinGW
* NEWS: updated
* test-suite/tests/ports.test (mingw?): new variable
Also, modify open-pipe shell for MinGW
* test-suite/tests/filesys.test (chmodat): some chmodat tests don't test if it
exists. Mark unwritable file writable before deleting.
("port representing a regular file"): reorder to avoid unclosed
port on exception.
For MinGW, there is a native signal function in UCRT. It handles
a limited set of signals.
* libguile/scmsigs.c (scm_sigaction_for_thread)[__MINGW32__]: removed
(scm_sigaction_for_thread)[!__MINGW32__]: use for MinGW as well.
For signals outside UCRT's native signal set, always return SIG_IGN.
After installing a signal handler, these are handled
* C-c
* kill -SIGINT <guile.exe-pid> (the wine process) works
these result in a direct terminate (or kill even?)
- kill <guile.exe-pid>
- wine cmd /c guile -c '(kill <guile-exe.pid> SIGINT)'
- wine cmd /c guile -c '(kill <guile-exe.pid> SIGTERM)'
* libguile/scmsigs.c (mingw_take_signal)[__MINGW32__]: New function.
install_mingw_take_signal)[__MINGW32__]: New function.
(scm_init_scmsigs)[__MINGW32__]: Use it.
On MinGW, port-read will block on sockets if no data is available.
Avoid blocking by using select first.
* module/ice-9/suspendable-ports.scm (read-bytes): For socket ports,
guard port-read with select.
On x86-64-MinGW the size of long is 4. As long is used for
SCM_FIXNUM_BIT, that would mean incompatible .go files, and waste of
cell space. So we would like to use long long, but the GMP interface
uses long.
To get around this, the x86-64-MinGW port now requires the use of
mini-GMP. Mini-GMP has been changed to use intptr_t and uintptr_t.
Likewise, "integers.{h,c}" and "numbers.{h,c}" now use intptr_t instead
of scm_t_inum or long, and uintptr_t instead of unsigned long.
* configure.ac: When x86_64-w64-mingw32, require mini-GMP.
* libguile/mini-gmp.h: Use intptr_t instead of long, uintptr_t instead
of unsigned long throughout.
* libguile/mini-gmp.c: Likewise.
* libguile/scm.h (SCM_INTPTR_T_BIT): New define.
* libguile/numbers.h (SCM_FIXNUM_BIT): Use it.
* libguile/numbers.c (L1, UL1): New macros. Use them thoughout instead
of 1L, 1UL.
(verify): Use SCM_INTPTR_T_BIT.
(verify): Use SCM_INTPTR_T_MAX and SCM_INTPTR_T_MIN.
(scm_from_inum): Remove macro.
Use intptr_t and uintptr_t instead of scm_t_inum or long, and unsigned
long.
* libguile/numbers.h (scm_from_intptr, scm_from_uintptr, scm_to_intptr,
scm_to_uintptr): New defines.
* libguile/integers.h: Use intptr_t and uintptr_t instead of scm_t_inum
and unsigned long.
* libguile/integers.c (L1) : New macro. Use it thoughout instead of 1L.
Use intptr_t and uintptr_t instead of long and unsigned long.
(long_magnitude): Rename to...
(intptr_t_magnitude): ...this. Use intptr_t, uintptr_t.
(negative_long): Rename to...
(negative_t_intptr): ...this. Use uintptr_t, INTPTR_MIN.
(inum_magnitude): Use intptr_t.
(ulong_to_bignum): Rename to...
(uintptr_t_to_bignum): ...this. Use uintptr_t.
(long_to_bignum): Rename to...
(intptr_t_to_bignum): ...this. Use intptr_t.
(long_to_scm): Rename to...
(intptr_t_to_scm): ...this. Use intptr_to_bignum.
(ulong_to_scm): Rename to...
(uintptr_t_to_scm): ...this. Use uintptr_to_bignum.
(long_sign): Rename to..
(intptr_t_sign): ...this. Use SCM_SIZEOF_INTPTR_T.
(bignum_cmp_long): Rename to...
(bignum_cmp_intptr_t): ...this. Use uintptr_t.
* libguile/array-map.c (array_compare): Use uintptr_t instead of
unsigned long and intptr_t instead of long.
* libguile/arrays.c (make-shared-array): Use ssize_t instead of long.
* libguile/bytevectors.c (is_signed_int32, is_unsigned_int32)
[MINGW32 && __x86_64__]: Use ULL.
(twos_complement): Use uintptr_t instead of unsigned long.
* libguile/hash.c (JENKINS_LOOKUP3_HASHWORD2): Likewise.
(narrow_string_hash, wide_string_hash, scm_i_string_hash,
scm_i_locale_string_hash, scm_i_latin1_string_hash,
scm_i_utf8_string_hash, scm_i_struct_hash, scm_raw_ihashq,
scm_raw_ihash): Use and return uintptr_t instead of unsigned long.
(scm_hashv, scm_hash): Use SCM_UINTPTR_T_MAX.
* libguile/hash.h (scm_i_locale_string_hash, scm_i_latin1_string_hash,
scm_i_utf8_string_hash): update prototypes.
* libguile/scmsigs.c (sigaction): Use intptr_t instead of long.
* libguile/strings.c (scm_i_make_symbol, (scm_i_c_make_symbol): Use
uintptr_t instead of unsigned long.
* libguile/strings.h (scm_i_make_symbol, (scm_i_c_make_symbol): Update
declacations.
* libguile/srfi-60.c: Use scm_to_uintptr, scm_from_intptr and variants
throughout.
* libguile/symbols.c (symbol-hash): Use scm_from_uintptr.
Co-authored-by: Mike Gran <spk121@yahoo.com>
Co-authored-by: Andy Wingo <wingo@pobox.com>
* libguile/posix-w32.c (canonicalize_device_name,
slashify_file_name): New static functions.
(canonicalize_file_name_mingw): Use them in new function.
* libguile/posix-w32.h (canonicalize_file_name_mingw): Declare it.
(canonicalize_file_name): New define.
* libguile/filesys.c[__MINGW32__]: Include posix-w32.h to use it.
* libguile/fports.c[__MINGW32__]: Likewise.