>From 20faf069191b572daef8134f2e47875acb96217a Mon Sep 17 00:00:00 2001 From: Evan Hanson Date: Fri, 29 Mar 2019 19:36:43 +1300 Subject: [PATCH] Always regenerate import libraries in setup-mode When building an egg, `chicken-do' considers the modification times of import libraries when determining whether to build the files from which they're generated generated. So, if `csc' avoids regenerating an import library because its imports haven't changed, the file that emits it will be stuck in an outdated state and will always be rebuilt, unnecessarily. This can lead to more extra work than is saved by not emitting the import library in the first place, so disable this optimisation when setup-mode is enabled and `chicken-do' is involved. --- batch-driver.scm | 3 ++- core.scm | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/batch-driver.scm b/batch-driver.scm index 4a4a370e..bd9d7c33 100644 --- a/batch-driver.scm +++ b/batch-driver.scm @@ -369,7 +369,8 @@ (when (memq 'unsafe options) (set! unsafe #t) ) (when (memq 'setup-mode options) - (set! ##sys#setup-mode #t)) + (set! ##sys#setup-mode #t) + (set! preserve-unchanged-import-libraries #f)) (when (memq 'disable-interrupts options) (set! insert-timer-checks #f)) (when (memq 'fixnum-arithmetic options) (set! number-type 'fixnum)) (when (memq 'block options) (set! block-compilation #t)) diff --git a/core.scm b/core.scm index 06a4cf7f..00e5fa76 100644 --- a/core.scm +++ b/core.scm @@ -287,7 +287,8 @@ process-declaration file-requirements ;; Various ugly global boolean flags that get set by the (batch) driver - all-import-libraries bootstrap-mode compiler-syntax-enabled + all-import-libraries preserve-unchanged-import-libraries + bootstrap-mode compiler-syntax-enabled emit-closure-info emit-profile enable-inline-files explicit-use-flag first-analysis no-bound-checks enable-module-registration optimize-leaf-routines standalone-executable undefine-shadowed-macros @@ -400,6 +401,7 @@ (define profiled-procedures #f) (define import-libraries '()) (define all-import-libraries #f) +(define preserve-unchanged-import-libraries #t) (define enable-module-registration #t) (define standalone-executable #t) (define local-definitions #f) @@ -598,7 +600,7 @@ (oldimps (and (file-exists? fname) (call-with-input-file fname read-expressions)))) - (cond ((equal? imps oldimps) + (cond ((and (equal? imps oldimps) preserve-unchanged-import-libraries) (when verbose-mode (print "not generating import library `" fname "' for module `" name "' because imports did not change")) ) -- 2.11.0