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

20412 commits

Author SHA1 Message Date
Andy Wingo
d3ce4a6a5f Fix typo for guile-system-extensions-path
* module/system/foreign-library.scm (guile-system-extensions-path): Fix
  typo.
2021-01-29 21:07:07 +01:00
Andy Wingo
9e6ac923bf Replace libltdl with raw dlopen, dlsym
* NEWS: Update.
* am/bootstrap.am (SOURCES):
* module/Makefile.am (SOURCES): Add system/foreign-library.scm.
* configure.ac: Replace ltdl check with -ldl check.
* libguile/dynl.c: Rewrite to just expose core dlopen / dlsym / etc to a
  helper Scheme module.
  (scm_dynamic_link, scm_dynamic_pointer, scm_dynamic_function)
  (scm_dynamic_object_p, scm_dynamic_call): Rewrite in terms of (system
  foreign-library).
* libguile/extensions.c (load_extension): Avoid scm_dynamic_call.
* module/system/foreign-library.scm: New file.
* module/oop/goops.scm (<dynamic-object>): Hackily export
  <foreign-library> instead of a class here.
* doc/ref/api-foreign.texi (Foreign Function Interface): Rewrite to only
  document the new interfaces.  Eventually we will deprecate
  dynamic-link and friends.
* doc/ref/guile.texi (API Reference): Move Foreign Objects after Foreign
  Function Interface.  Seems there should be some closer relationship
  but this will do for now.
* doc/ref/tour.texi (Putting Extensions into Modules):
* doc/ref/libguile-parallel.texi (Parallel Installations): Update for
  rename of Modules and Extensions to Foreign Extensions.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_dynamic_unlink): Deprecate.
* libguile/guile.c: Remove ltdl include.
* test-suite/tests/foreign.test: Update tests to use new API, and update
  error expectations.
2021-01-29 16:12:22 +01:00
Mike Gran
480d86df68 strptime test shouldn't presume that initial whitespace is ignored
As far as I can tell, ignoring initial whitespace is not required by POSIX.

* test-suite/tests/time.test (strptime tests):
2021-01-23 12:35:01 -08:00
Mike Gran
d6afb41192 don't test crypt if not present
* test-suite/tests/posix.test (crypt):  throw unsupported if crypt not presetnt
2021-01-23 12:10:22 -08:00
Mike Gran
cdcdd29e8e socket test should not throw unresolved outside of a test
* test-suite/tests/00-socket.test: don't throw at top level
2021-01-23 10:00:07 -08:00
Michael Gran
54fe8e83d9 add test for setsockopt
* test-suite/tests/00-socket.test (setsockopt AF_INET): new test
2021-01-23 09:54:59 -08:00
Michael Gran
75b0db1a28 getsockopt may return garbage for parameters < sizeof(int)
Uninitialized variable.

* libguile/socket.c (scm_getsockopt): zeroize arguments before use
2021-01-21 19:35:15 -08:00
Michael Gran
91d4d31184 socket test should not throw unresolved outside of a test
* test-suite/tests/00-socket.test: don't throw unresolved outside of a
    test
2021-01-21 15:35:53 -08:00
Michael Gran
c65154ac69 avoid a ports test when fcntl is not provided
* test-suite/tests/ports.test (non blocking I/O): disable test when fcntl
    is not provided
2021-01-21 15:35:43 -08:00
Michael Gran
9baa2e9e58 standalone tests require libgnu on DLL-based platforms
* test-suite/standalone/Makefile.am (test_conversion_LDADD): add libgnu
  (test_scm_to_latin1_string_LDADD): add libgnu
  (test_scm_values_LDADD): add libgnu
  (test_scm_c_bind_keyword_arguments): add libgnu
  (test_srfi_4_LDADD): add libgnu
  (libtest_extensions_la_LIBADD): add libgnu
  (test_with_guile_module_LDADD): add libgnu
  (test_scm_with_guile_LDADD): add libgnu
  (test_scm_spawn_thread_LDADD): add libgnu
  (test_pthread_create_LDADD): add libgnu
  (test_pthread_create_secondary_LDADD): add libgnu
  (test_smob_mark_LDADD): add libgnu
  (test_smob_mark_race_LDADD): add libgnu
2021-01-21 15:35:34 -08:00
Michael Gran
efecac1c7d skip version test if git-version-gen can't compute version from git
This might occur due to a shallow git clone.

* test-suite/tests/version.test: throw unsupported if version is unknown
2021-01-21 15:35:09 -08:00
Michael Gran
449b9bd5e1 in null threads, don't define sigmask stub when pthread_sigmask does not exist
* libguile/gen-scmconfig.c (main) [HAVE_PTHREAD_SIGMASK]: new output
    define SCM_HAVE_PTHREAD_SIGMASK
* libguile/null-threads.h (scm_i_pthread_sigmask) [SCM_HAVE_PTHREAD_SIGMASK]:
    make inline function conditional on existence of pthread_sigmask
2021-01-21 15:34:03 -08:00
Michael Gran
d3f7a1d0b7 Need Guile and Windows types for the declarations posix-w32
* libguile/posix-w32.h: include scm.h and windows.h
2021-01-21 15:33:52 -08:00
Michael Gran
c5faaf50cf missing includes for list.h
* libguile/loader.c: include list.h
* libguile/stime.c: include list.h
2021-01-21 15:33:43 -08:00
Michael Gran
dd97382d9a test-foreign-object-c should link libgnu
For MinGW, the foreign object test requires stubs provided by libgnu

* test-suite/standalone/Makefile.am (test_foreign_object_c_LDADD): add libgnu
2021-01-21 15:33:06 -08:00
Michael Gran
93b8ab2994 for dynamic-link tests, mingw needs to link to msvcrt
* test-suite/standalone/test-ffi: link msvcrt for mingw
* test-suite/standalone/test-foreign-object-scm: link msvcrt for mingw
2021-01-21 15:32:45 -08:00
Michael Gran
0d80eb23e2 in command line encoding test don't presume extant UTF-8 locale
* test-suite/standalone/test-command-line-encoding: abort if
    locale is not UTF-8
2021-01-21 15:32:33 -08:00
Michael Gran
efb37b954e skip compile test when pause not available
* test-suite/standalone/test-guild-compile: abort if pause
    does not exist
2021-01-21 15:32:06 -08:00
Michael Gran
50da05835a for socket test, don't presume TMP is usable
* test-suite/tests/00-socket.test: don't abort when unable to change
    into tmpdir
2021-01-21 15:30:09 -08:00
Michael Gran
fe505e1a2a encoding test tries to delete a file that is not closed
On Windows, deleting a file on an open port does not succeed

* test-suite/tests/ports.test ("%default-port-encoding, wrong encoding"):
  ensure port is closed before deleting
2021-01-21 14:32:53 -08:00
Michael Gran
1a6eaba436 Use mkdtemp to simplify repl server test
* test-suite/tests/00-repl-server.test (make-tempdir): removed
  (call-with-repl-server): use mkdtemp instead of make-tempdir
2021-01-21 10:41:10 -08:00
Michael Gran
32bf48e4b7 Replace mutating mkdtemp! with non-mutating mkdtemp
* doc/ref/posix.texi: replace mkdtemp! and scm_mkdtemp_x documentation
    with documentation for mkdtemp and scm_mkdtemp
* libguile/filesys.c (scm_mkdtemp_x): procedure mkdtemp! removed
    (scm_mkdtemp): new procedure mkdtemp
* libguile/filesys.h: Remove declaration for scm_mkdtemp_x.  New declaration
    scm_mkdtemp.
* test-suite/tests/filesys.test: Remove mkdtemp! tests.  Add tests
    for mkdtemp.
2021-01-21 10:33:08 -08:00
Andy Wingo
c67cbc501f Replace stftime gnulib module with nstrftime
* lib/Makefile.am: Update to replace deprecated strftime module.
2021-01-21 11:15:08 +01:00
Andy Wingo
86e7a8b12b Update environ_locale_charset gnulib patch
* gnulib-local/lib/localcharset.c.diff: Update to apply to current
  gnulib.  Lots of code duplication now, but oh well.
* lib/localcharset.c (environ_locale_charset): Update.
* lib/iconv_open-solaris.h:
* lib/iconv_open-osf.h:
* lib/iconv_open-irix.h:
* lib/iconv_open-hpux.h:
* lib/iconv_open-aix.h: Regenerate with gperf 3.1.
2021-01-20 23:03:56 +01:00
Andy Wingo
a91b95cca2 Update Gnulib to v0.1-4379-g2ef5a9b4b
Also bump required autoconf version to 2.64, as required by Gnulib.
2021-01-20 23:03:56 +01:00
Michael Gran
758b31994c Fix incorrect docstring of mkdtemp!
* libguile/filesys.c (scm_mkdtemp_x): fix docstring
2021-01-19 15:06:57 -08:00
Michael Gran
d98e1d5e4f New procedure mkdtemp! to create unique temporary directory
* configure.ac (AC_CHECK_FUNCS): add mkdtemp! test
* doc/ref/posix.texi: document mkdtemp!
* libguile/filesys.c (scm_mkdtemp_x): new function
* libguile/filesys.h: new declaration for scm_mkdtemp_x
* test-suite/tests/filesys.test: add tests for mkdtemp!

Adapted from a patch by Rob Browning.
2021-01-19 05:58:14 -08:00
Michael Gran
d60ff39105 Move declaration for scm_mkstemp to filesys.h
The underlying function was moved to filesys.c in
073167ef7b but the declaration didn't follow

* libguile/filesys.h: add declaration for scm_mkstemp
* libguile/posix.h: remove declaration for scm_mkstemp
2021-01-18 08:40:27 -08:00
Rob Browning
b5ecfdd061 Fix "display" typo in make-thread and begin-thread docs
* doc/ref/api-scheduling.texi (make-thread, begin-thread): fix "display"
  typo.
2021-01-17 13:25:42 -06:00
Rob Browning
d0d1f68794 scm_i_make_transcoded_port: fix mode for input/output ports
* libguile/r6rs-ports.c (scm_i_make_transcoded_ports): make sure to
  include SCM_RDNG for input/output ports.

Thanks to Göran Weinholt for reporting the problem.

Closes: 41045
2021-01-17 13:25:42 -06:00
Rob Browning
f1547e1d58 (scheme base) member: return #f, not (), for no match
* module/scheme/base.scm (member): Match the r7rs requirement, as assoc
  already does.

Thanks to Erik Dominikus for reporting the problem.

Closes: 43304
2021-01-17 13:25:40 -06:00
Asher Gordon
7a1cd29637 Replace a line which was accidentally removed.
The line, part of the sentence above it in a comment, was accidentally
removed in commit b8d757732f "Rationalize
include order in C files".

* libguile/guile.c: restore missing line.

[rlb@defaultvalue.org: augment commit message; add THANKS]

Closes: 42331
2021-01-17 13:15:58 -06:00
Rob Browning
859cd4eb9b doc: Fix composition describing scm_reverse_list_to_string
* libguile/srfi-13.c (scm_reverse_list_to_string): Replace string->list
  with list->string in the composition explaning how it works.  Thanks
  to Andrey Ivanov for reporting the problem.

Closes: 34457
2021-01-17 13:15:45 -06:00
Andy Wingo
55ebf1b84a Document new interfaces
* NEWS: Update.
* doc/ref/api-io.texi (Bytevector Ports): Add docs.
2021-01-12 12:24:59 +01:00
Andy Wingo
b2b1666d4c Document call-with-port
* doc/ref/api-io.texi (Ports): Add docs.
* doc/ref/r6rs.texi (rnrs io ports): Remove docs.
2021-01-12 12:21:15 +01:00
Andy Wingo
1820ed5121 Finish call-with-port cleanup
* module/rnrs/io/ports.scm (call-with-port): Remove local definition.
* module/system/repl/server.scm (system): Call-with-port is imported
  via (ice-9 ports).
2021-01-12 12:17:55 +01:00
Andy Wingo
0f42fef119 Add call-with-input-bytevector, call-with-output-bytevector
* module/ice-9/binary-ports.scm (call-with-input-bytevector):
  (call-with-output-bytevector): New functions.
* module/ice-9/iconv.scm: Remove superfluous copies of
  call-with-output-string* and call-with-output-bytevector*, now that
  the former closes the port and the latter exists.
  (call-with-encoded-output-string): Adapt.
* module/web/uri.scm: Use (ice-9 iconv) instead of local
  bytevector/string conversion procedures.
2021-01-12 12:09:19 +01:00
Andy Wingo
9fecf20fcf Close accumulating output ports after use
* module/ice-9/ports.scm (call-with-port): New procedure, from r7rs.
  (call-with-input-file, call-with-output-file): Refactor to use
  call-with-port.
  (call-with-output-string): Close the string after normal exit.
* module/scheme/base.scm (scheme): Re-export call-with-port from base.
2021-01-12 12:08:12 +01:00
Andy Wingo
a20ef7e769 Bump copyright years for user-visible copyright messages
* module/ice-9/command-line.scm (version-etc):
* module/scripts/compile.scm (show-version):
* module/system/repl/common.scm (*version*): Bump to 2021.
2021-01-07 13:00:46 +01:00
Andy Wingo
22a313b47e Bump version to 3.0.5
* GUILE-VERSION (GUILE_MICRO_VERSION): Bump.
2021-01-07 13:00:46 +01:00
Andy Wingo
ca025920e5 Update NEWS
* NEWS: Update.
2021-01-07 12:12:00 +01:00
Andy Wingo
74e69220ea Merge remote-tracking branch 'lightening/main' 2021-01-07 11:48:30 +01:00
Andy Wingo
bfba596dda Merge branch 'fix-shortening' into 'master'
Fix jmp-shortening on x86 when target within instruction.

See merge request wingo/lightening!12
2021-01-07 10:05:57 +00:00
Andy Wingo
35cd7fac8b Fix jmp-shortening on x64 when target within instruction.
* lightening/x86.c (jit_try_shorten): If the address is within the
  last instruction, don't shorten.  If the intstruction is a jump, we
  could elide it entirely in some cases, but we don't know if the user
  captured the PC before calling jit_patch_here.  Better to leave this
  to the user.

Thanks to Helmut Eller for the bug report and test case in
https://gitlab.com/wingo/lightening/-/issues/17.
2021-01-07 11:04:17 +01:00
Andy Wingo
9d5978a756 New warnings: -Wuse-before-definition, -Wnon-idempotent-definition
* module/ice-9/boot-9.scm (%auto-compilation-options): Add
  use-before-definition and non-idempotent-definition.
* module/language/tree-il/analyze.scm (<use-before-def-info>): New
  analysis info.
  (make-use-before-definition-analysis): New function.
  (goops-toplevel-definition): Move down.
  (unbound-variable-analysis, macro-use-before-definition): Remove, as
  they are subsumed by use-before-def.  There are some deprecated
  bindings though.
  (make-analyzer): Rework to allow for use-before-def analysis to handle
  multiple
* module/system/base/message.scm (%warning-types): Add handlers for the
  new warning types.
* test-suite/tests/tree-il.test: Add tests.
* doc/ref/api-evaluation.texi (Compilation): Update.
2021-01-07 10:26:33 +01:00
Andy Wingo
64c89458e6 Fix source location bug for neoteric exprs introduced by refactoring
* libguile/read.c (scm_read_expression): Ungetc after capturing the
  column.
2020-09-10 22:11:34 +02:00
Andy Wingo
e9c5a1719b Move copy-tree to (ice-9 copy-tree); deprecate main binding
* doc/ref/api-data.texi (List Constructors):
* doc/ref/api-utility.texi (Copying): Update docs to mention module.
* libguile.h: Remove trees.h inclusion.
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  (DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Remove trees.c,
  trees.h, and related files.
* libguile/init.c (scm_i_init_guile): Remove trees.h and the
  scm_init_trees call.
* libguile/trees.c:
* libguile/trees.h: Remove.
* module/Makefile.am (SOURCES): Add ice-9/copy-tree.scm.
* module/ice-9/copy-tree.scm: New file.
* module/ice-9/deprecated.scm (copy-tree*): Export as copy-tree,
  proxying to (ice-9 copy-tree).
* module/system/repl/common.scm:
* module/web/client.scm:
* test-suite/tests/elisp.test:
* test-suite/tests/srfi-1.test:
* module/oop/goops/save.scm: Use (ice-9 copy-tree).
* test-suite/Makefile.am (SCM_TESTS): Add copy-tree.test.
* test-suite/tests/copy-tree.test: New file; test pulled from
  eval.test.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_copy_tree): Deprecate.
2020-09-10 21:57:21 +02:00
Andy Wingo
433b701a23 Update NEWS
* NEWS: Update.
* doc/ref/api-evaluation.texi (Scheme Read): Remove copy option.
2020-09-05 22:23:17 +02:00
Andy Wingo
6f6abb3bb5 Clean up srcprops implementation
* libguile/deprecated.c (scm_sym_copy, scm_make_srcprops): Deprecate.
* libguile/deprecated.h (scm_tc16_srcprops)
  (SCM_SOURCE_PROPERTY_FLAG_BREAK): Deprecate.
* libguile/private-options.h (SCM_COPY_SOURCE_P): Remove.
* libguile/read.c (struct t_read_opts, scm_read_options): Remove useless
  copy read option.
  (maybe_annotate_source): Change line and column to be tagged, and
  subtract off lookahead here.  Change all callers.
  (READ_OPTION_COPY_SOURCE_P): Remove, renumbering other options.
  (init_read_options): Remove copy option.
* libguile/srcprop.c: Change to put filename inline in source
  properties.  Update private implementation.
* libguile/srcprop.h (SCM_PROCTRACEP): Remove.  Unusable given that
  scm_sym_trace was undefined.
2020-09-03 22:55:08 +02:00
Andy Wingo
837580587b Tweak to initial heap size selection
* libguile/gc.c (DEFAULT_INITIAL_HEAP_SIZE): Bump a bit farther (2 MB on
  64-bit, 1 MB on 32-bit) as we now expand to this size instead of
  expanding by this amount.
  (scm_storage_prehistory): Expand to the initial heap size instead of
  expanding by the size.
2020-08-27 14:18:44 +02:00