summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-03-15Recognize RISC-V compilation targets.stable-2.0Shea Levy1-0/+2
* 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>
2017-07-31put-bytevector: Allow start == bytevector length.Mark H Weaver1-1/+1
* libguile/r6rs-ports.c (scm_put_bytevector): When three arguments (port bv start) are provided, allow start to be equal to the length of the bytevector, resulting in a zero-length write.
2017-03-06Flush when getting string from r6rs string output portAndy Wingo2-1/+20
* module/rnrs/io/ports.scm (open-string-output-port): Calling the get-string proc should flush the buffer and reset the file position. * test-suite/tests/r6rs-ports.test ("8.2.10 Output ports"): Add tests. Thanks to Freja Nordsiek for the report. (cherry picked from commit e13cd5c77c030f22e3f5c27f15bb979bfda7d2ba)
2017-03-02Revert "build: Compress with lzip too."Andy Wingo1-1/+1
This reverts commit 89ce9fb31b00f1f243fe6f2450db50372cc0b86d. It was causing hydra builds to fail.
2017-03-01Fix (mkstemp! "XX" 0) errorsAndy Wingo1-0/+8
* libguile/filesys.c (scm_i_mkstemp): Validate "mode" argument as a string, and validate writability of template string early too. Thanks to Jean Louis for the bug report.
2017-03-01Remove extraneous debugging output in testAndy Wingo1-1/+0
* test-suite/standalone/test-scm-c-bind-keyword-arguments.c (missing_value_error_handler): Remove debugging write.
2017-03-01Disable REPL server tests if no threadsAndy Wingo1-1/+7
* test-suite/tests/00-repl-server.test (call-with-repl-server): The REPL server needs threads so don't bother testing if we have no threads. Also, prevent SIGPIPE from killing the parent process.
2017-03-01Update gitignore after Gnulib updateAndy Wingo1-0/+2
* .gitignore: Update.
2017-03-01Update Gnulib to v0.1-1157-gb03f418.Andy Wingo397-1104/+2004
2017-03-01Fix scm_init_stime for macOSAndy Wingo1-6/+1
* libguile/stime.c (scm_init_stime): Remove needless test of clock_getcpuclockid. Fixes build on macOS; thanks to Matt Wette for the report and fix.
2017-02-28Re-enable REPL server testsAndy Wingo1-1/+0
* test-suite/tests/00-repl-server.test: Revert unintended change to tests.
2017-02-28Better errors for odd-length keyword argsAndy Wingo8-91/+142
* libguile/vm-i-system.c (bind-kwargs): * libguile/vm.c (vm_error_kwargs_missing_value): * libguile/eval.c (error_missing_value) (prepare_boot_closure_env_for_apply): Adapt to mirror VM behavior. * libguile/keywords.c (scm_c_bind_keyword_arguments): Likewise. * module/ice-9/eval.scm (primitive-eval): Update to error on (foo #:kw) with a "Keyword argument has no value" instead of the horrible "odd argument list length". Also adapts to the expected args format for the keyword-argument-error exception printer in all cases. Matches 1.8 optargs behavior also. * test-suite/standalone/test-scm-c-bind-keyword-arguments.c (test_missing_value): (missing_value_error_handler): Update test. * test-suite/tests/optargs.test: Add tests.
2017-02-28Fix (* x -1) for GOOPS typesAndy Wingo1-15/+13
* libguile/numbers.c (scm_product): Only reduce (* x -1) to (- x) when X is a bignum. Fixes weirdness when X is not a number and instead multiplication should dispatch to GOOPS. Thanks to Alejandro Sanchez for the report.
2017-02-13build: Remove '--enable-error-on-warning' for 'make distcheck'.v2.0.14Ludovic Courtès1-2/+4
* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Remove --enable-error-on-warning and add --enable-deprecated.
2017-02-13Bump version number to 2.0.14.Ludovic Courtès1-1/+1
* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
2017-02-13Update 'NEWS'.Ludovic Courtès1-1/+21
2017-02-13doc: Describe -e (module) on equal footing with (@ ...).Arne Babenhauserheide2-8/+71
* 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-02-13i18n: 'number->locale-string' guesses the minimum number of decimals.Ludovic Courtès4-28/+44
This feature was removed by 4aead68cdb86ca60cc372f0cd558cadda90ddec5. * module/ice-9/i18n.scm (number-decimal-string): Rewrite the case where DIGIT-COUNT is not an integer. (number->locale-string): Always pass FRACTION-DIGITS to 'number-decimal-string'. * test-suite/tests/format.test ("~h localized number")["1234.5"] ["padding", "padchar"]: Remove decimal specifier. * test-suite/tests/i18n.test ("number->locale-string") ["fraction", * test-suite/tests/i18n.test ("format ~h")["12 345,678"]: Remove decimal specifier. Remove one decimal. * doc/ref/api-i18n.texi (Number Input and Output): Update 'number->locale-string' doc to mention the number of decimals.
2017-02-13i18n: Fix corner cases for monetary and number string conversions.Ludovic Courtès3-30/+88
Fixes <http://bugs.gnu.org/24990>. Reported by Martin Michel <dev@famic.de>. * module/ice-9/i18n.scm (integer->string, number-decimal-string): New procedures. (monetary-amount->locale-string): Use them instead of 'number->string' followed by 'string-split'. (number->locale-string): Likewise. * test-suite/tests/i18n.test ("number->locale-string")["fraction"]: Add second argument to 'number->locale-string'. ["fraction, 1 digit"]: Round up. ["fraction, 10 digits", "trailing zeros", "negative integer"]: New tests. * test-suite/tests/i18n.test ("format ~h"): Pass the number of decimals for ~h. ("monetary-amount->locale-string")["French"]: Always expect two decimals after the comma. ["one cent", "very little money"]: New tests. * test-suite/tests/format.test ("~h localized number")["1234.5"]: Specify the number of decimals explicitly. ["padding"]: Expect zero decimals. ["padchar"]: Ask for one decimal. ["decimals", "locale"]: Adjust rounding.
2017-02-13tests: Choose a more plausible US English locale name.Ludovic Courtès1-1/+1
* test-suite/tests/i18n.test (%american-english-locale-name): Change to en_US.utf8".
2017-02-12tests: Use 'pass-if-equal' for (ice-9 i18n) tests.Ludovic Courtès1-34/+40
* test-suite/tests/i18n.test ("number->locale-string") ("format ~h", "monetary-amount->locale-string"): Use 'pass-if-equal' instead of 'pass-if'.
2017-02-12i18n: Do not represent zero as "-0".Ludovic Courtès2-6/+18
Partly fixes <http://bugs.gnu.org/24990>. Reported by Martin Michel <dev@famic.de>. * module/ice-9/i18n.scm (monetary-amount->locale-string): Don't negate AMOUNT when it's zero. (number->locale-string): Likewise. * test-suite/tests/i18n.test ("number->locale-string")["positive inexact zero, 1 digit"]: New test. ("monetary-amount->locale-string")["positive inexact zero"]: New test.
2017-02-12Recognize sh3 as compilation targetsJohn Paul Adrian Glaubitz1-2/+2
* module/system/base/target.scm (cpu-endianness, triplet-pointer-size): Add case for "sh3". Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-02-12doc: Fix typo in site packages documentation.Georgi Kirilov1-1/+1
* doc/ref/scheme-using.texi (Installing Site Packages): Fix typo Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-02-12doc: Fix typo in keywords documentation.Georgi Kirilov1-1/+1
* doc/ref/api-data.texi (Keyword Read Syntax): Fix typo Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-02-11tests: Avoid statprof test failure on systems without 'setitimer'.Ludovic Courtès1-10/+11
Partly fixes <http://bugs.gnu.org/25463>. Reported by rennes@openmailbox.org. * test-suite/tests/statprof.test ("return values"): Wrap in 'when-implemented'.
2016-12-30psyntax: Generate identifiers in a deterministic fashion.Mark H Weaver5-47/+106
Fixes <http://bugs.gnu.org/20272>. * module/ice-9/boot-9.scm (module-generate-unique-id!) (module-gensym): New procedures. (module): Add 'next-unique-id' field. (the-root-module): Inherit 'next-unique-id' value from early stub. (make-module, make-autoload-interface): Adjust calls to module-constructor. * module/ice-9/psyntax.scm (gen-label, new-mark): Generate unique identifiers from the module name and the per-module unique-id. (build-lexical-var, generate-temporaries): Use 'module-gensym' instead of 'gensym'. * module/ice-9/psyntax-pp.scm: Regenerate. * module/language/tree-il/fix-letrec.scm (fix-letrec!): Use 'module-gensym' instead of 'gensym'. * module/system/base/syntax.scm (define-record): Likewise. (transform-record): Likewise. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2016-12-14build: Honor $SOURCE_DATE_EPOCH for the recorded timestamp.Ludovic Courtès1-2/+3
Reported by Jan Nieuwenhuizen <janneke@gnu.org> at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20272#36>. * libguile/Makefile.am (libpath.h): Honor 'SOURCE_DATE_EPOCH'.
2016-11-04tests: Avoid race condition in REPL server test.Ludovic Courtès1-2/+8
Fixes <http://bugs.gnu.org/24769>. Reported by Rob Browning <rlb@defaultvalue.org>. * test-suite/tests/00-repl-server.test ("simple expression"): Add call to 'select' before 'display'.
2016-11-04tests: Throw 'unresolved when the REPL server is too slow.Ludovic Courtès1-4/+5
* test-suite/tests/00-repl-server.test (call-with-repl-server): Use (usleep 100) instead of (sleep 1). Throw 'unresolved when TRIES is too high.
2016-10-28scandir: Avoid 'stat' calls on each entry.Ludovic Courtès1-32/+26
* module/ice-9/ftw.scm (scandir): Rewrite in terms of 'readdir'.
2016-10-12build: Compress with lzip too.v2.0.13Ludovic Courtès1-1/+1
* configure.ac: Add 'dist-lzip' Automake option.
2016-10-12build: Check for /gnu/store file names upon "make dist".Ludovic Courtès1-2/+12
* Makefile.am (assert-no-store-file-names): New rule, taken from Guix. (dist-hook): Depend on it.
2016-10-12Bump version number to 2.0.13.Ludovic Courtès1-2/+2
* GUILE-VERSION (GUILE_MICRO_VERSION): Increment. (LIBGUILE_INTERFACE_REVISION): Increment.
2016-10-12Update 'NEWS'.Ludovic Courtès1-7/+41
2016-10-12build: Avoid use of Bash's $(...) construct in 'configure'.Ludovic Courtès1-2/+4
This is a followup to be8be776df4dd77112b5d9b88610cc9b67a68645. * acinclude.m4 (GUILE_CHECK_GUILE_FOR_BUILD): Use backquotes instead of $(...).
2016-10-12tests: Add REPL server test for CVE-2016-8606.Ludovic Courtès2-0/+140
This is a followup to 08c021916dbd3a235a9f9cc33df4c418c0724e03. * test-suite/tests/00-repl-server.test: New file. * test-suite/Makefile.am (SCM_TESTS): Add it.
2016-10-11REPL Server: Guard against HTTP inter-protocol exploitation attacks.Mark H Weaver3-8/+201
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".
2016-10-11tests: Use the "normalized codeset" in locale names.Ludovic Courtès1-6/+6
* test-suite/tests/i18n.test (%french-locale-name) (%french-utf8-locale-name, %turkish-utf8-locale-name) (%german-utf8-locale-name, %greek-utf8-locale-name): Use the normalized codeset for ISO-8859-1 and UTF-8.
2016-10-11Treat 'SIG_IGN' as a pointer.Ludovic Courtès1-3/+7
* libguile/posix.c (scm_system_star): Cast 'SIG_IGN' to 'scm_t_uintptr_t' and use 'scm_from_uintptr_t'. This fixes an 'int-conversion' warning with GCC 6.2.
2016-10-11Add 'scm_to_uintptr_t' and 'scm_from_uintptr_t'.Ludovic Courtès3-1/+17
* libguile/numbers.h (scm_to_uintptr_t, scm_from_uintptr_t): New macros. * doc/ref/api-data.texi (Integers): Document them. * NEWS: Mention it.
2016-10-11Remove 'umask' calls from 'mkdir'.Ludovic Courtès3-19/+27
Fixes <http://bugs.gnu.org/24659>. * libguile/filesys.c (SCM_DEFINE): Remove calls to 'umask' when MODE is unbound; instead, use 0777 as the mode. Update docstring to clarify this. * doc/ref/posix.texi (File System): Adjust accordingly. * NEWS: Mention it.
2016-09-09Check for closed port in 'port-encoding' and 'set-port-encoding!'.Mark H Weaver1-2/+2
* libguile/ports.c (scm_port_encoding, scm_set_port_encoding_x): Use SCM_VALIDATE_OPPORT.
2016-09-09http: Do not use 'eq?' to compare characters in parse-request-uri.Mark H Weaver1-1/+1
* module/web/http.scm (parse-request-uri): Use 'eqv?' to compare characters.
2016-08-31Move system* to posix.c, impl on open-processAndy Wingo4-129/+75
* libguile/simpos.c: Trim includes. (scm_system_star): Move to posix.c. * libguile/simpos.h (scm_system_star): Remove. * libguile/posix.h (scm_system_star): Add. * libguile/posix.c (scm_system_star): Move here and implement in terms of open-process. This lets system* work on Windows. Inspired by a patch by Eli Zaretskii. (start_child): Exit with 127 if the command isn't found.
2016-08-11build: .x and .doc files depend on generated includes.Mark H Weaver1-5/+5
Fixes <https://bugs.gentoo.org/show_bug.cgi?id=590528>. * libguile/Makefile.am (BUILT_INCLUDES): New variable. (BUILT_SOURCES): Put .i and other generated .h to BUILT_INCLUDES. (DOT_X_FILES, EXTRA_DOT_X_FILES, DOT_DOC_FILES, EXTRA_DOT_DOC_FILES): Depend on $(BUILT_INCLUDES), in place of scmconfig.h which is included in $(BUILT_INCLUDES).
2016-08-11Revert "Snarfing .x depends on built headers"Mark H Weaver1-5/+5
This reverts commit edd6d6e2805894e21afe51276d1af65d5395180d. As reported at <https://bugs.gentoo.org/show_bug.cgi?id=590528#c10>, that commit failed to fix the bug. That commit was based on the mistaken belief that the make rule syntax ".c.x: $(BUILT_INCLUDES)" means the same as ".c.x:" but with the added prerequisites "$(BUILT_INCLUDES)". However, as explained in section 10.7 (Old-Fashioned Suffix Rules) of the GNU Make manual: Suffix rules cannot have any prerequisites of their own. If they have any, they are treated as normal files with funny names, not as suffix rules. Thus, the rule: .c.o: foo.h $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< tells how to make the file '.c.o' from the prerequisite file 'foo.h', and is not at all like the pattern rule: %.o: %.c foo.h $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< which tells how to make '.o' files from '.c' files, and makes all '.o' files using this pattern rule also depend on 'foo.h'.
2016-08-08Recognize alpha as compilation targetJames Clarke1-2/+2
* module/system/base/target.scm (cpu-endianness): Add case for "alpha". (triplet-pointer-size): Likewise.
2016-08-08Fix typo about variable definitionssirgazil1-2/+2
* doc/ref/api-binding.texi (Top Level Variable Definitions): Fix typo.
2016-08-08Documentation fixesEthan Stefan Day3-15/+15
* doc/ref/api-compound.texi: * doc/ref/api-control.texi: * doc/ref/api-data.texi: Fix typos and clarify.