guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-195-g1e56c


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-195-g1e56cff
Date: Fri, 15 Apr 2011 13:47:49 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=1e56cff2337d4f6b0a9f3363ea1cb3ac5287a6ed

The branch, stable-2.0 has been updated
       via  1e56cff2337d4f6b0a9f3363ea1cb3ac5287a6ed (commit)
      from  ee037cee3e3e545936e04e8bed3f7e0670a4ec11 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1e56cff2337d4f6b0a9f3363ea1cb3ac5287a6ed
Author: Andy Wingo <address@hidden>
Date:   Fri Apr 15 11:27:27 2011 +0200

    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.

-----------------------------------------------------------------------

Summary of changes:
 NEWS                          |    5 +++++
 doc/ref/api-evaluation.texi   |    9 +++++++++
 doc/ref/scheme-scripts.texi   |    5 +++++
 libguile/load.c               |   27 +++++++++++++++++++++++++--
 module/ice-9/boot-9.scm       |    3 ++-
 module/ice-9/command-line.scm |    8 +++++++-
 6 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index cd12f60..4f0c220 100644
--- a/NEWS
+++ b/NEWS
@@ -128,6 +128,11 @@ interpreted as starting an R6RS hex escape.  This is 
backward compatible
 because the symbol printer would never produce a "\x" before.  The
 printer also works better too.
 
+** Added --force-auto-compile option
+
+This allows a user to invalidate the auto-compilation cache.  It's
+usually not needed.  See "Compilation" in the manual, for a discussion.
+
 * Manual updates
 
 ** GOOPS documentation updates
diff --git a/doc/ref/api-evaluation.texi b/doc/ref/api-evaluation.texi
index 682e844..9430c74 100644
--- a/doc/ref/api-evaluation.texi
+++ b/doc/ref/api-evaluation.texi
@@ -586,6 +586,15 @@ computation are fulfilled by macros and closures. Of 
course one good
 counterexample is the REPL itself, or any code that reads expressions
 from a port.)
 
+Automatic compilation generally works transparently, without any need
+for user intervention.  However Guile does not yet do proper dependency
+tracking, so that if file @address@hidden uses macros from
address@hidden@var{b}.scm}, and @address@hidden changes, @address@hidden
+would not be automatically recompiled.  To forcibly invalidate the
+auto-compilation cache, pass the @code{--fresh-auto-compile} option to
+Guile, or set the @code{GUILE_AUTO_COMPILE} environment variable to
address@hidden (instead of to @code{0} or @code{1}).
+
 For more information on the compiler itself, see @ref{Compiling to the
 Virtual Machine}. For information on the virtual machine, see @ref{A
 Virtual Machine for Guile}.
diff --git a/doc/ref/scheme-scripts.texi b/doc/ref/scheme-scripts.texi
index 0ad1bec..c7d22a4 100644
--- a/doc/ref/scheme-scripts.texi
+++ b/doc/ref/scheme-scripts.texi
@@ -227,6 +227,11 @@ development.
 @item --auto-compile
 Compile source files automatically (default behavior).
 
address@hidden
+
address@hidden --fresh-auto-compile
+Treat the auto-compilation cache as invalid, forcing recompilation.
+
 @vnew{2.0}
 
 @item --no-auto-compile
diff --git a/libguile/load.c b/libguile/load.c
index 701b34b..b0137a1 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -210,6 +210,9 @@ static SCM *scm_loc_load_compiled_extensions;
 /* Whether we should try to auto-compile. */
 static SCM *scm_loc_load_should_auto_compile;
 
+/* Whether to treat all auto-compiled files as stale. */
+static SCM *scm_loc_fresh_auto_compile;
+
 /* The fallback path for auto-compilation */
 static SCM *scm_loc_compile_fallback_path;
 
@@ -824,6 +827,7 @@ SCM_DEFINE (scm_primitive_load_path, "primitive-load-path", 
0, 0, 1,
   if (scm_is_false (compiled_filename)
       && scm_is_true (full_filename)
       && scm_is_true (*scm_loc_compile_fallback_path)
+      && scm_is_false (*scm_loc_fresh_auto_compile)
       && scm_is_pair (*scm_loc_load_compiled_extensions)
       && scm_is_string (scm_car (*scm_loc_load_compiled_extensions)))
     {
@@ -857,6 +861,7 @@ SCM_DEFINE (scm_primitive_load_path, "primitive-load-path", 
0, 0, 1,
 
   if (!compiled_is_fallback
       && scm_is_true (*scm_loc_compile_fallback_path)
+      && scm_is_false (*scm_loc_fresh_auto_compile)
       && scm_is_pair (*scm_loc_load_compiled_extensions)
       && scm_is_string (scm_car (*scm_loc_load_compiled_extensions)))
     {
@@ -971,6 +976,8 @@ scm_init_load ()
     = SCM_VARIABLE_LOC (scm_c_define ("%compile-fallback-path", SCM_BOOL_F));
   scm_loc_load_should_auto_compile
     = SCM_VARIABLE_LOC (scm_c_define ("%load-should-auto-compile", 
SCM_BOOL_F));
+  scm_loc_fresh_auto_compile
+    = SCM_VARIABLE_LOC (scm_c_define ("%fresh-auto-compile", SCM_BOOL_F));
 
   the_reader = scm_make_fluid ();
   scm_fluid_set_x (the_reader, SCM_BOOL_F);
@@ -988,8 +995,24 @@ scm_init_load ()
 void
 scm_init_load_should_auto_compile ()
 {
-  *scm_loc_load_should_auto_compile =
-    scm_from_bool (scm_getenv_int ("GUILE_AUTO_COMPILE", 1));
+  char *auto_compile = getenv ("GUILE_AUTO_COMPILE");
+
+  if (auto_compile && strcmp (auto_compile, "0") == 0)
+    {
+      *scm_loc_load_should_auto_compile = SCM_BOOL_F;
+      *scm_loc_fresh_auto_compile = SCM_BOOL_F;
+    }
+  /* Allow "freshen" also.  */
+  else if (auto_compile && strncmp (auto_compile, "fresh", 5) == 0)
+    {
+      *scm_loc_load_should_auto_compile = SCM_BOOL_T;
+      *scm_loc_fresh_auto_compile = SCM_BOOL_T;
+    }
+  else
+    {
+      *scm_loc_load_should_auto_compile = SCM_BOOL_T;
+      *scm_loc_fresh_auto_compile = SCM_BOOL_F;
+    }
 }
   
   
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 800410c..84e76bd 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -3290,7 +3290,8 @@ module '(ice-9 q) '(make-q q-length))}."
     (catch #t
       (lambda ()
         (let* ((scmstat (stat name))
-               (gostat  (stat go-path #f)))
+               (gostat  (and (not %fresh-auto-compile)
+                             (stat go-path #f))))
           (if (and gostat
                    (or (> (stat:mtime gostat) (stat:mtime scmstat))
                        (and (= (stat:mtime gostat) (stat:mtime scmstat))
diff --git a/module/ice-9/command-line.scm b/module/ice-9/command-line.scm
index 9797364..a34c9a6 100644
--- a/module/ice-9/command-line.scm
+++ b/module/ice-9/command-line.scm
@@ -127,7 +127,8 @@ If FILE begins with `-' the -s switch is mandatory.
                  Default is to enable debugging for interactive
                  use, but not for `-s' and `-c'.
   --auto-compile compile source files automatically
-  --no-auto-compile disable automatic source file compilation
+  --fresh-auto-compile  invalidate auto-compilation cache
+  --no-auto-compile  disable automatic source file compilation
                  Default is to enable auto-compilation of source
                  files.
   --listen[=P]   Listen on a local port or a path for REPL clients.
@@ -295,6 +296,11 @@ If FILE begins with `-' the -s switch is mandatory.
             (set! %load-should-auto-compile #t)
             (parse args out))
 
+           ((string=? arg "--fresh-auto-compile")
+            (set! %load-should-auto-compile #t)
+            (set! %fresh-auto-compile #t)
+            (parse args out))
+
            ((string=? arg "--no-auto-compile")
             (set! %load-should-auto-compile #f)
             (parse args out))


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]