summaryrefslogtreecommitdiff
path: root/libguile/load.c
Commit message (Expand)AuthorAgeFilesLines
* Deprecate dynamic roots...* libguile/root.h: * libguile/root.c: Remove these files. * libguile/deprecated.h: * libguile/deprecated.c (scm_internal_cwdr, scm_call_with_dynamic_root) (scm_dynamic_root, scm_apply_with_dynamic_root): Deprecate. Remove all root.h usage, which was vestigial. * module/ice-9/serialize.scm: Use (current-thread) instead of (dynamic-root). Andy Wingo2016-11-211-1/+0
* Skip incompatible .go files...* libguile/load.c (load_thunk_from_path, try_load_thunk_from_file): New functions. (search_path): Simplify. (scm_primitive_load_path, scm_init_eval_in_scheme): Use the new functions to load compiled files. * module/ice-9/boot-9.scm (load-in-vicinity): Skip invalid .go files. Inspired by a patch from Jan Nieuwenhuizen <janneke@gnu.org>. Andy Wingo2016-06-121-62/+240
* Remove scm_puts_unlocked....* libguile/ports.h (scm_puts_unlocked): Remove. * libguile/ports.c (scm_puts): Replace implementation with scm_puts_unlocked's implementation. * libguile/arbiters.c: * libguile/backtrace.c: * libguile/bitvectors.c: * libguile/continuations.c: * libguile/deprecation.c: * libguile/dynl.c: * libguile/eval.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/fports.c: * libguile/frames.c: * libguile/guardians.c: * libguile/hashtab.c: * libguile/hooks.c: * libguile/load.c: * libguile/macros.c: * libguile/mallocs.c: * libguile/print.c: * libguile/programs.c: * libguile/promises.c: * libguile/smob.c: * libguile/srcprop.c: * libguile/srfi-14.c: * libguile/stackchk.c: * libguile/struct.c: * libguile/threads.c: * libguile/throw.c: * libguile/values.c: * libguile/variable.c: * libguile/vm.c: * libguile/weak-set.c: * libguile/weak-table.c: Use scm_puts instead of scm_puts_unlocked. Andy Wingo2016-04-261-13/+13
* load-path will skip over stale .go files and keep going...* libguile/load.c (compiled_is_fresh): Write warnings to warning port. Move up in the file. (search_path): Add ability to skip over matching files in the path that are stale, relative to some other corresponding file. (scm_search_path, scm_sys_search_load_path): Adapt to search_path changes. (do_try_auto_compile): Write status to warning port. (scm_primitive_load_path): Use new search_path ability to skip over stale files. Allows updates to source files to use freshly-compiled bootstrap files, when building Guile itself. Also allows simplification of fallback logic. (scm_init_eval_in_scheme): Skip stale eval.go files in the path. Andy Wingo2015-11-111-97/+100
* Merge commit 'fdd319e9bd4121d844662d3d8ccc69b462b60840'Andy Wingo2015-01-221-16/+13
|\
| * Reduce C heap allocations in 'search-path'....* libguile/load.c (scm_c_string_has_an_ext): Rename to... (string_has_an_ext): ... this. Add docstring. Change 'str' to be an SCM, and remove 'len' parameter. Change loop body to use 'scm_string_suffix_p'. (search_path): Update accordingly. Ludovic Courtès2014-11-011-16/+13
* | Merge commit 'a7bbba05838cabe2294f498e7008e1c51db6d664'Andy Wingo2015-01-221-14/+14
|\|
| * Use on-stack or GC-managed memory in 'search-path'....* libguile/load.c (stringbuf_free): Remove. (stringbuf_grow): Use 'scm_gc_malloc_pointerless' instead of 'scm_realloc'. (search_path): Use stack-allocated INITIAL_BUFFER instead of 'scm_malloc'. Remove use of 'stringbuf_free'. Ludovic Courtès2014-11-011-14/+14
* | Merge branch 'stable-2.0'...Conflicts: benchmark-suite/benchmarks/ports.bm libguile/async.h libguile/bytevectors.c libguile/foreign.c libguile/gsubr.c libguile/srfi-1.c libguile/vm-engine.h libguile/vm-i-scheme.c module/Makefile.am module/language/tree-il/analyze.scm module/language/tree-il/peval.scm module/scripts/compile.scm module/scripts/disassemble.scm test-suite/tests/asm-to-bytecode.test test-suite/tests/peval.test test-suite/tests/rdelim.test Mark H Weaver2014-09-301-11/+49
|\|
| * On MS-Windows, don't return file names with backslashes from search-path....* libguile/load.c (search_path): On MS-Windows, convert all backslashes to forward slashes if the file was found on PATH. Eli Zaretskii2014-08-151-1/+2
| * Fix problems with Windows file names that use backslashes....* libguile/load.c (scm_i_mirror_backslashes): New function. (scm_init_load_path): Call it to produce MS-Windows file names with forward slashes. (FILE_NAME_SEPARATOR_STRING): Define as "/" on all platforms. * libguile/load.h (scm_i_mirror_backslashes): Add prototype. * libguile/init.c (scm_boot_guile): Call scm_i_mirror_backslashes on argv[0]. * libguile/filesys.c (scm_getcwd): Call scm_i_mirror_backslashes on the directory name returned by getcwd. * test-suite/tests/ports.test ("file name separators"): New test. Eli Zaretskii2014-07-031-10/+47
* | Merge branch 'stable-2.0'...Conflicts: GUILE-VERSION NEWS guile-readline/ice-9/readline.scm libguile/async.c libguile/backtrace.c libguile/deprecated.h libguile/gc-malloc.c libguile/gdbint.c libguile/init.c libguile/ioext.c libguile/mallocs.c libguile/print.c libguile/rw.c libguile/scmsigs.c libguile/script.c libguile/simpos.c libguile/snarf.h libguile/strports.c libguile/threads.c libguile/vm-i-scheme.c libguile/vm-i-system.c module/srfi/srfi-18.scm test-suite/Makefile.am test-suite/standalone/test-num2integral.c Mark H Weaver2014-04-251-4/+1
|\|
| * Rely on Gnulib for <unistd.h>....* libguile/async.c: * libguile/backtrace.c: * libguile/error.c: * libguile/filesys.c: * libguile/fports.c: * libguile/gc-malloc.c: * libguile/gc.c: * libguile/gdbint.c: * libguile/init.c: * libguile/ioext.c: * libguile/load.c: * libguile/mallocs.c: * libguile/mkstemp.c: * libguile/ports.c: * libguile/posix.c: * libguile/r6rs-ports.c: * libguile/random.c: * libguile/rw.c: * libguile/scmsigs.c: * libguile/script.c: * libguile/simpos.c: * libguile/socket.c: * libguile/stime.c: * libguile/strports.c: * libguile/threads.c: Unconditionally include <unistd.h>. Mark H Weaver2014-02-271-4/+1
* | Merge branch 'stable-2.0'...Conflicts: module/system/vm/traps.scm test-suite/tests/peval.test Mark H Weaver2014-01-091-10/+5
|\|
| * scm_primitive_load: Simplify code using 'scm_open_file_with_encoding'....* libguile/load.c (scm_primitive_load): Use 'scm_open_file_with_encoding'. Mark H Weaver2014-01-081-10/+5
* | Remove private-gc.h...* libguile/simpos.c (scm_getenv_int): Move here, from gc.c. * libguile/private-gc.h: Remove, unused. * libguile/simpos.h: Move scm_getenv_int declaration here. * libguile/vm.c: * libguile/gc.c: Adapt scm_getenv_int users. * libguile/gc-malloc.c: * libguile/load.c: * libguile/script.c: Remove private-gc includes from non-users of scm_getenv_int. * libguile/Makefile.am: Adapt. Andy Wingo2013-11-281-1/+0
* | 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 Mark H Weaver2013-03-281-32/+95
|\|
| * add %site-ccache-dir...* libguile/load.h: * libguile/load.c (scm_sys_site_ccache_dir): New procedure. * doc/ref/scheme-using.texi (Installing Site Packages): * doc/ref/api-options.texi (Build Config): Add docs. Fixes bug 10326. Jason Earl2013-03-101-0/+13
| * fix compilation under mingw...* libguile/load.c (is_absolute_file_name, search_path): Fix compilation under mingw. Andy Wingo2013-03-071-7/+9
| * Use `scm_is_eq' in load.c....* libguile/load.c (is_file_name_separator): Use `scm_is_eq' instead of `=='. Ludovic Courtès2013-03-071-2/+2
| * load.c uses same logic as boot-9 for file names...* libguile/load.c (is_file_name_separator, is_drive_letter): (is_absolute_file_name): New helpers, like the ones in boot-9. Perhaps we should just define them in C. (search_path, scm_try_auto_compile, canonical_suffix): Rewrite using the new helpers. Andy Wingo2013-02-241-32/+80
| * Revert "detect and consume byte-order marks for textual ports"...This reverts commit b2cb557d75e4daf8c7c8cd43313f4cc51d9a3f1b, which was pushed accidentally. Andy Wingo2013-01-301-3/+0
| * detect and consume byte-order marks for textual ports...* libguile/ports.h: * libguile/ports.c (scm_consume_byte_order_mark): New procedure. * libguile/fports.c (scm_open_file): Call consume-byte-order-mark if we are opening a file in "r" mode. * libguile/read.c (scm_i_scan_for_encoding): Don't do anything about byte-order marks. * libguile/load.c (scm_primitive_load): Add a note about the duplicate encoding scan. * test-suite/tests/filesys.test: Add tests for UTF-8, UTF-16BE, and UTF-16LE BOM handling. Andy Wingo2013-01-301-0/+3
* | merge stable-2.0...There are some bugs with command-line handling that will be sorted out with the next commit. Andy Wingo2013-01-231-9/+13
|\|
| * fix try-module-autoload, which did not detect failure to find the file...* libguile/load.c (scm_primitive_load_path): If the second argument is a procedure, call it like a thunk. * doc/ref/api-evaluation.texi (Load Paths): Update docs. * module/ice-9/boot-9.scm (resolve-interface): Use `unless'. (try-module-autoload): Use the new primitive-load-path to detect failure to find an appropriate file. Fixes a bug reported by Diogo F. S. Ramos. Thanks to Noah Lavine for tracking it down. Andy Wingo2013-01-211-9/+13
* | Merge remote-tracking branch 'origin/stable-2.0'...Conflicts: GUILE-VERSION libguile/posix.c module/ice-9/eval.scm test-suite/tests/cse.test Mark H Weaver2013-01-071-2/+33
|\|
| * 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. Mark H Weaver2012-11-281-2/+33
* | Merge remote-tracking branch 'origin/stable-2.0'...Conflicts: GUILE-VERSION libguile/gc-malloc.c libguile/ports.c Andy Wingo2012-02-081-14/+14
|\|
| * Improve the usage of variable names in C docstrings....* libguile/alist.c: * libguile/array-map.c: * libguile/arrays.c: * libguile/bitvectors.c: * libguile/filesys.c: * libguile/foreign.c: * libguile/generalized-arrays.c: * libguile/hashtab.c: * libguile/ioext.c: * libguile/load.c: * libguile/numbers.c: * libguile/ports.c: * libguile/posix.c: * libguile/print.c: * libguile/procprop.c: * libguile/promises.c: * libguile/simpos.c: * libguile/socket.c: * libguile/srfi-1.c: * libguile/srfi-13.c: * libguile/srfi-14.c: * libguile/stacks.c: * libguile/stime.c: * libguile/strings.c: * libguile/struct.c: * libguile/symbols.c: * libguile/threads.c: * libguile/weak-table.c: * libguile/weak-vector.c: Make the variable names in the C docstrings more consistent. Replace a few instances of @var with @code when appropriate. Bake Timmons2012-02-021-2/+2
| * Fix search_path to fill stat_buf when given an absolute pathname...* libguile/load.c (search_path): When the provided 'filename' is an absolute pathname, perform a 'stat' on that pathname to fill the 'stat_buf'. Previously, 'stat_buf' was left uninitialized in this case, even though 'scm_primitive_load_path' assumes that 'stat_buf' will be filled. Update the header comment to explicitly specify that 'stat_buf' will be filled. Also 'goto end' in a few failure cases instead of replicating its code. Mark H Weaver2012-02-011-12/+12
* | Merge remote-tracking branch 'origin/stable-2.0'...Conflicts: libguile/__scm.h libguile/array-map.c libguile/procprop.c libguile/tags.h module/ice-9/deprecated.scm module/ice-9/psyntax-pp.scm module/ice-9/psyntax.scm test-suite/standalone/test-num2integral.c test-suite/tests/regexp.test Andy Wingo2012-01-101-4/+8
|\|
| * primitive-load returns the value(s) of the last expression...* libguile/load.c (scm_primitive_load): Return the values yielded from evaluating the last expression in the file. * test-suite/tests/load.test ("return value of `load'"): Add tests. Andy Wingo2012-01-091-4/+8
* | Merge remote-tracking branch 'origin/stable-2.0'...Conflicts: libguile/deprecation.c libguile/load.c libguile/print.c Andy Wingo2011-12-061-10/+10
|\|
| * warnings written to warning port...* libguile/deprecation.c (scm_c_issue_deprecation_warning): * libguile/load.c (auto_compile_catch_handler): (scm_sys_warn_auto_compilation_enabled, scm_primitive_load_path): * module/ice-9/boot-9.scm (warn, %load-announce, duplicate-handlers) (load-in-vicinity): * module/system/base/message.scm (warning): Write to the warning port. (*current-warning-port*): Alias the warning port. Andy Wingo2011-12-051-10/+10
* | Merge remote-tracking branch 'origin/stable-2.0'...Conflicts: configure.ac libguile/fluids.c libguile/gc.c libguile/gc.h libguile/objcodes.c libguile/procprop.c libguile/vm.c module/ice-9/psyntax-pp.scm module/ice-9/psyntax.scm Andy Wingo2011-12-011-2/+1
|\|
| * use new scm_make_fluid_with_default...* libguile/load.c (scm_init_load): * libguile/ports.c (scm_init_ports): * libguile/read.c (scm_init_read): Use scm_make_fluid_with_default. Andy Wingo2011-11-231-2/+1
* | locking for putc, puts...* libguile/ports.c (scm_putc, scm_puts): * libguile/ports.h (scm_putc_unlocked, scm_puts_unlocked): Separate into _unlocked and locked variants. Change all callers to use the _unlocked versions. Andy Wingo2011-11-081-12/+12
* | most uses of scm_from_locale_symbol become scm_from_utf8_symbol...* libguile/array-handle.c: * libguile/chars.c: * libguile/expand.c: * libguile/feature.c: * libguile/goops.c: * libguile/gsubr.c: * libguile/instructions.c: * libguile/load.c: * libguile/macros.c: * libguile/memoize.c: * libguile/modules.c: * libguile/options.c: * libguile/print.c: * libguile/smob.c: * libguile/snarf.h: Change most uses of scm_from_locale_symbol to scm_from_utf8_symbol, as the symbols really are not locale-dependent. Andy Wingo2011-10-251-1/+1
* | add SCM_{PACK,UNPACK}_POINTER...* libguile/tags.h (SCM_UNPACK_POINTER, SCM_PACK_POINTER): New macros. The old SCM2PTR and PTR2SCM were defined in such a way that round-tripping through a pointer could lose precision, even in the case in which you weren't interested in actually dereferencing the pointer, it was simply that you needed to plumb a SCM through APIs that take pointers. These new macros are more like SCM_PACK and SCM_UNPACK, but for pointer types. The bit representation of the pointer should be the same as the scm_t_bits representation. * libguile/gc.h (PTR2SCM, SCM2PTR): Remove support for (old) UNICOS pointers. We are going to try tagging the SCM object itself in the future, and I don't think that keeping this support is worth its cost. It probably doesn't work anyway. * libguile/backtrace.c: * libguile/bytevectors.c: * libguile/continuations.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/gc.h: * libguile/guardians.c: * libguile/hashtab.c: * libguile/load.c: * libguile/numbers.c: * libguile/ports.c: * libguile/smob.c: * libguile/strings.c: * libguile/symbols.c: * libguile/vm.c: * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-vector.c: Update many sites to use the new macros. Andy Wingo2011-10-241-4/+4
|/
* avoid duplicate stats when searching for files in a path...* libguile/load.c (search_path): Extract from scm_search_path, to give the caller the stat buffer of the found path. (scm_search_path, scm_sys_search_load_path): Adapt accordingly. (compiled_is_fresh): Take the stat buffers directly. (scm_primitive_load_path, scm_init_eval_in_scheme): Adapt to search_path / compiled_is_fresh changes to avoid duplicate states in search-path. Andy Wingo2011-08-031-112/+127
* fix unnecessary call to canonicalize_path in load-path fast case...* libguile/load.c (scm_primitive_load_path): Don't canonicalize the filename unless we need to look in the fallback path. Fixes a stat explosion; see http://savannah.gnu.org/bugs/?33815. Andy Wingo2011-08-031-6/+8
* add a site dir to %load-compiled-path...* libguile/Makefile.am (libpath.h): Define SCM_SITE_CCACHE_DIR. Defined as site-ccache/ instead of site/ccache/ to indicate that we don't expect further subdirectories, and also to avoid confusion about whether extensions/ is a site-specific or not. * libguile/load.c (scm_init_load_path): Add SCM_SITE_CCACHE_DIR to the default load-compiled path. Andy Wingo2011-07-211-1/+4
* fix generation of auto-compiled file names on mingw systems...* libguile/load.c (canonical_to_suffix, scm_primitive_load_path): * module/ice-9/boot-9.scm (load-in-vicinity): * module/system/base/compile.scm (compiled-file-name): If the canonical path of a file is a DOS-style path with a drive letter, turn it into a path suffix it by removing the colon and prefixing a "/". Inspired by a patch from Jan Nieuwenhuizen. Andy Wingo2011-06-301-2/+18
* %load-hook not just for primitive-load...* libguile/load.c (scm_primitive_load_path): * module/ice-9/boot-9.scm (load-in-vicinity): Call %load-hook as needed. Andy Wingo2011-06-301-0/+9
* better messages on failed autocompilation...* libguile/load.c (auto_compile_catch_handler): * module/ice-9/boot-9.scm (load-in-vicinity): Nicer messages when autocompilation fails. Andy Wingo2011-06-171-5/+18
* mingw: use $APPDATA as a possible root for cachedir....* libguile/load.c (scm_init_load_path) [MINGW32]: Fall back to using $LOCALAPPDATA or $APPDATA if $XDG_CACHE_HOME and $HOME aren't set. Jan Nieuwenhuizen2011-06-171-0/+6
* scm_is_false instead of == SCM_BOOL_F; also is_null, is_true, etc...* libguile/deprecation.c (scm_issue_deprecation_warning) * libguile/eval.c (CAPTURE_ENV): * libguile/goops.c (make_dispatch_procedure, make_class_from_symbol): (create_smob_classes): * libguile/guardians.c (finalize_guarded, scm_i_get_one_zombie): * libguile/hashtab.c (scm_fixup_weak_alist, scm_internal_hash_fold): * libguile/i18n.c (scm_nl_langinfo) * libguile/load.c (scm_primitive_load) * libguile/posix.c (scm_setrlimit) * libguile/socket.c (scm_to_sockaddr): * libguile/srcprop.c (scm_make_srcprops): Use scm_is_false / scm_is_true / scm_is_null instead of comparing against SCM_BOOL_F et al. Andy Wingo2011-05-131-1/+1
* add --fresh-auto-compile...* doc/ref/api-evaluation.texi (Compilation): Add discussion of --fresh-auto-compile. * doc/ref/scheme-scripts.texi (Invoking Guile): Add --fresh-auto-compile option. * NEWS: Add entry. * libguile/load.c: Define %fresh-auto-compile. (scm_primitive_load_path): Use it here. (scm_init_load_should_auto_compile): Init from GUILE_AUTO_COMPILE env var, with a value of "fresh". * module/ice-9/boot-9.scm (load-in-vicinity): Auto-compilation cache is stale if %fresh-auto-compile is true. * module/ice-9/command-line.scm (compile-shell-switches): Parse out --fresh-auto-compile. Andy Wingo2011-04-151-2/+25
* add packager info to %build-info...* libguile/load.c (init_build_info): Add packager, packager-version, and packager-bug-reports to %build-info, if they are available. Andy Wingo2011-04-141-0/+15
* Add `%auto-compilation-options', used by `compile-file' when auto-compiling....* module/ice-9/boot-9.scm (%auto-compilation-options): New variable. (load-in-vicinity): Honor it. * libguile/load.c (kw_opts, sym_compile_file, sym_auto_compilation_options): New variables. (do_try_auto_compile): Honor %AUTO-COMPILATION-OPTIONS. * module/system/repl/common.scm (repl-default-options): Have `compile-options' default to %AUTO-COMPILATION-OPTIONS. Ludovic Courtès2011-02-131-4/+24