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

26 commits

Author SHA1 Message Date
Matthew Wette
78e9e51065 Redirect diagnostice output messages (e.g., auto-compiling code) to a newly defined current-info-port, and add a command line argument -I' to set the current-info-port to a void-port. * libguile/ports.c: add cur_infoport_fluid, scm_current_info_port, scm_set_current_info_port; define default current-info-port to stderr * libguile/load.c(compiled_is_fresh,load_thunk_from_path, do_try_auto_compile,scm_sys_warn_auto_compilation_enabled, scm_primitive_load_path): direct output messages to current_info_port; was current_warning_port * libguile/init.c(scm_init_standard_ports): set default current_info_port * module/ice-9/ports.scm: define current-info-port and set-current-info-port * module/ice-9/command-line.scm(*usage*,compile-shell-switches): add argument -I' to silence diagnostics (or current-info-port to void-port) * doc/ref/guile-invoke.texi: add description for `-I' command argument 2024-10-12 13:16:25 +02:00
Andy Wingo
aa5455ea98 Bignums avoid both custom GMP allocator and finalizers
* libguile/deprecated.c (make_bignum): Move here from numbers.c, to
support scm_i_long2big etc.
(scm_i_big2dbl):
(scm_i_long2big):
(scm_i_ulong2big):
(scm_i_clonebig):
(scm_i_normbig): Deprecate.
(scm_install_gmp_memory_functions): Deprecate, happily!  SCM bignums now
have digits allocated inline with the bignum itself, so they are
completely transparent to the GC already.  The price is that if GMP ever
allocates digits via the MPZ API, those digits then have to be copied
back into managed memory.  But we avoid having to install finalizers and
we avoid having to muck with GMP's allocator.
* libguile/numbers.c (scm_from_mpz): Use scm_integer_from_mpz.
(scm_init_numbers): Never muck with GMP's allocators.
* doc/ref/guile-invoke.texi (Environment Variables): Remove note about
GUILE_INSTALL_GMP_MEMORY_FUNCTIONS.
* meta/build-env.in: No need to set GUILE_INSTALL_GMP_MEMORY_FUNCTIONS.
2022-01-13 09:37:17 +01:00
Andy Wingo
534dd35a3c Allow users to force gmp to use libgc
* doc/ref/guile-invoke.texi (Environment Variables): Document
GUILE_INSTALL_GMP_MEMORY_FUNCTIONS.
* libguile/numbers.c (scm_init_numbers): Use environment variable.
2021-04-26 22:27:22 +02:00
Andy Wingo
aaa8f201e9 Update reference for GUILE_EXTENSIONS_PATH
* NEWS: Update.
* doc/ref/guile-invoke.texi (Environment Variables): Add entry.
2021-03-04 21:54:08 +01:00
Andy Wingo
c23fe0ec5a Document JIT environment variables
* doc/ref/guile-invoke.texi (Environment Variables): Remove
  GUILE_STACK_SIZE which is no longer needed, and document some JIT
  debugging environment variables.
* doc/ref/vm.texi (Why a VM?, Just-In-Time Native Code): Update and link
  to environment variables documentation.
2019-12-11 21:55:49 +01:00
Andy Wingo
b634071dd4 Add R7RS documentation and --r7rs command-line option
* doc/ref/Makefile.am: Add r7rs.texi.
* doc/ref/guile-invoke.texi (Command-line Options): Document --r7rs.
* doc/ref/guile.texi (Guile Modules): Link to R7RS.
* doc/ref/intro.texi (Guile and Scheme): Update for R7RS support.
* doc/ref/r7rs.texi: New file.
* doc/ref/scheme-intro.texi (Guile Scheme): Update for R7RS.
* module/ice-9/command-line.scm (*usage*, compile-shell-switches): Add
  --r7rs option.
2019-11-17 15:30:59 +01:00
Andy Wingo
afcc22f639 Add --r6rs command-line option
* doc/ref/guile-invoke.texi (Command-line Options): Document --r6rs.
* doc/ref/r6rs.texi (R6RS Incompatibilities): Mention that --r6rs calls
  install-r6rs!.
* module/ice-9/command-line.scm (*usage*, compile-shell-switches):
  Implement --r6rs.
2019-09-25 22:08:12 +02:00
Andy Wingo
b2c0e01bb4 Update effective version to 3.0
* GUILE-VERSION: Bump version to 2.3.0, and effective version to 3.0.
* .gitignore:
* README:
* doc/guile.1:
* doc/ref/api-evaluation.texi:
* doc/ref/api-options.texi:
* doc/ref/guile-invoke.texi:
* doc/ref/libguile-foreign-objects.texi:
* doc/ref/libguile-parallel.texi:
* doc/ref/srfi-modules.texi: Update to 3.0.
* libguile/_scm.h (SCM_OBJCODE_MAJOR_VERSION):
(SCM_OBJCODE_MINIMUM_MINOR_VERSION, SCM_OBJCODE_MINOR_VERSION): Bump
bytecode version for fallback path.
* libguile/loader.c: Update to avoid loading version 2.2 bytecode
files.
* meta/guile-3.0-uninstalled.pc.in:
* meta/guile-3.0.pc.in: Rename.
* module/system/vm/assembler.scm (*bytecode-major-version*):
(*bytecode-minor-version*): Write the new bytecode version.
2017-05-22 14:15:40 +02:00
Arne Babenhauserheide
1026a76830 doc: Describe -e (module) on equal footing with (@ ...).
* doc/ref/guile-invoke.texi, doc/ref/scheme-scripts.texi:
describe the -e (module) shorthand as on equal footing with (@ ...)

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-03-01 21:17:44 +01:00
Mark H Weaver
402162cfcf REPL Server: Guard against HTTP inter-protocol exploitation attacks.
Reported by Christopher Allan Webber <cwebber@dustycloud.org>
Co-authored-by: Ludovic Courtès <ludo@gnu.org>

This commit adds protection to Guile's REPL servers against HTTP
inter-protocol exploitation attacks, a scenario whereby an attacker can,
via an HTML page, cause a web browser to send data to TCP servers
listening on a loopback interface or private network.  See
<https://en.wikipedia.org/wiki/Inter-protocol_exploitation> and
<https://www.jochentopf.com/hfpa/hfpa.pdf>, The HTML Form Protocol
Attack (2001) by Tochen Topf <jochen@remote.org>.

Here we add a procedure to 'before-read-hook' that looks for a possible
HTTP request-line in the first line of input from the client socket.  If
present, the socket is drained and closed, and a loud warning is written
to stderr (POSIX file descriptor 2).

* module/system/repl/server.scm: Add 'maybe-check-for-http-request'
to 'before-read-hook' when this module is loaded.
(with-temporary-port-encoding, with-saved-port-line+column)
(drain-input-and-close, permissive-http-request-line?)
(check-for-http-request, guard-against-http-request)
(maybe-check-for-http-request): New procedures.
(serve-client): Use 'guard-against-http-request'.
* module/system/repl/coop-server.scm (start-repl-client): Use
'guard-against-http-request'.
* doc/ref/guile-invoke.texi (Command-line Options): In the description
of the --listen option, make the security warning more prominent.
Mention the new protection added here.  Recommend using UNIX domain
sockets for REPL servers.  "a path to" => "the file name of".
2017-03-01 20:13:13 +01:00
Andy Wingo
a5b5cb422e Merge commit '8cf2a7ba74' 2015-01-22 13:24:30 +01:00
Ludovic Courtès
7e466e0265 doc: Tell when 'GUILE_INSTALL_LOCALE' first appeared.
* doc/ref/guile-invoke.texi (Environment Variables): Add footnote about
  the Guile version where 'GUILE_INSTALL_LOCALE' appeared.
2014-12-02 21:25:56 +01:00
Andy Wingo
7affd3141b Merge commit '40a723a922' 2014-02-07 15:26:18 +01:00
Mark H Weaver
40a723a922 Remove outdated documentation of LTDL_LIBRARY_PATH.
* doc/ref/guile-invoke.texi (Environment Variables): Remove
  documentation of 'LTDL_LIBRARY_PATH'.
2014-02-05 23:40:25 -05:00
Andy Wingo
f88e9510f0 Use version 2.2 in manual examples
* doc/ref/api-evaluation.texi (Load Paths):
* doc/ref/api-options.texi (Build Config):
* doc/ref/guile-invoke.texi (Environment Variables):
* doc/ref/libguile-parallel.texi (Parallel Installations): Use 2.2 in
  examples, rather than 2.0.
2013-11-28 10:57:42 +01:00
Mark H Weaver
f6f4feb0a2 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	GUILE-VERSION
	libguile/array-map.c
	libguile/fports.h
	libguile/gc.h
	libguile/inline.h
	libguile/ports.c
	libguile/ports.h
	libguile/print.c
	libguile/r6rs-ports.c
	libguile/read.c
	test-suite/tests/00-socket.test
2013-04-14 02:48:33 -04:00
Ludovic Courtès
004094d378 doc: Document `--language'.
* doc/ref/guile-invoke.texi (Command-line Options): Document `--language'.
2013-04-06 13:07:01 +02:00
Mark H Weaver
86cf4773ff Merge remote-tracking branch 'origin/stable-2.0' 2013-03-30 22:56:27 -04:00
Mark H Weaver
b05257b923 Add -C command-line option to adjust %load-compiled-path.
* module/ice-9/command-line.scm (compile-shell-switches):
  Implement -C option.
  (*usage*): Add -C option.

* doc/ref/guile-invoke.texi (Command-line Options): Add docs.
2013-03-30 22:49:46 -04:00
Mark H Weaver
26d148066f Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	configure.ac
	libguile/deprecated.c
	libguile/deprecated.h
	libguile/filesys.h
	libguile/fluids.c
	libguile/fports.c
	libguile/gc.c
	libguile/guile.c
	libguile/numbers.c
	libguile/objcodes.c
	libguile/r6rs-ports.c
	libguile/smob.c
	libguile/socket.c
	libguile/threads.h
	module/language/scheme/decompile-tree-il.scm
	module/language/tree-il/peval.scm
	test-suite/tests/syncase.test
2013-03-28 05:09:53 -04:00
Stefan Israelsson Tampe
aab9d46c83 add GUILE_STACK_SIZE environment variable
* libguile/vm.c (initialize_default_stack_size): New helper.
  (scm_bootstrap_vm): Call initialize_default_stack_size.

* doc/ref/guile-invoke.texi (Environment Variables): Add docs.

Based on a patch by Stefan Israelsson Tampe.
2013-03-07 14:25:36 +01:00
Ludovic Courtès
7f893030ab Install the current locale if GUILE_INSTALL_LOCALE is nonzero.
* libguile/guile.c (get_integer_from_environment)
  (should_install_locale): New functions.
  (main): Add `setlocale' call.

* doc/ref/guile-invoke.texi (Environment Variables): Add documentation.
2013-03-07 10:48:44 +01:00
Mark H Weaver
bd31bce6ac Add parse-path-with-ellipsis, and use it for GUILE_LOAD_PATH et al.
* libguile/load.c (scm_ellipsis): New Variable.
  (scm_parse_path_with_ellipsis): New procedure.
  (scm_init_load): Initialize 'scm_ellipsis'.
  (scm_init_load_path): Use 'scm_parse_path_with_ellipsis' to
  handle GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH.

* libguile/load.h (scm_parse_path_with_ellipsis): Add prototype.

* doc/ref/guile-invoke.texi (Environment Variables):
  doc/ref/api-evaluation.texi (Load Paths): Add documentation.
  Correct description of default load path to reflect reality.
  Remove 'GUILE_LOAD_PATH' from the concept index; it is already
  in the variable index.  Add cross references between these two
  sections of the manual.
2012-11-28 21:58:05 -05:00
Andy Wingo
925172cf52 add current-filename, add-to-path, add-to-load-path
* module/ice-9/boot-9.scm (current-filename, add-to-path)
  (add-to-load-path): New syntaxen.

* doc/ref/api-evaluation.texi (Loading): Move load-path related
  procedures to a new section:
  (Load Paths): Hither.  Document add-to-path and add-to-load-path.

* doc/ref/api-debug.texi (Source Properties): Document
  current-source-location and current-filename.

* doc/ref/api-modules.texi:
* doc/ref/guile-invoke.texi:
* doc/ref/scheme-using.texi: Update @ref for Load Paths change.
2012-01-21 00:08:17 +01:00
Ludovic Courtès
c8286111e0 Clarify --debug' vs. --no-debug'.
* module/ice-9/command-line.scm (*usage*): Attempt to suggest that
  `--no-debug' doesn't inhibit debugging support.

* doc/ref/guile-invoke.texi (Command-line Options): Make it clear that
  `--no-debug' doesn't inhibit debugging support.  Reported by Manuel
  Serrano.
2011-09-09 00:05:42 +02:00
Mark Harig
94906b7541 better invocation documentation
* doc/ref/guile.texi (Programming in Scheme):
* doc/ref/scheme-scripts.texi (Guile Scripting): Moved "Invoking Guile"
  to its own file.

* doc/ref/guile-invoke.texi (Invoking Guile): Initial revision. This
  file contains the former section "Invoking Guile" that was included in
  the chapter "Programming in Scheme" as a subsection named
  "Command-line Options." It also includes a new subsection "Environment
  Variables," which describes those variables that can be set in the
  operating system before Guile is started and which affect Guile's
  run-time behavior.
2011-06-30 13:19:04 +02:00