>From b4f2b15896cae536d7e59a82420d21f1b6fd5c5c Mon Sep 17 00:00:00 2001 From: Evan Hanson Date: Sat, 28 Apr 2018 23:01:59 +0200 Subject: [PATCH 2/2] Include identifiers from "chicken.foreign" in modules.db We need to load chicken-ffi-syntax in chicken-install so that the `##sys#chicken-ffi-macro-environment' list has been populated before `update-db' is run. Also, skip "main" (the module that wraps chicken-install.scm) and add some more detailed messaging when "-verbose" is used with "-update-db". --- chicken-install.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/chicken-install.scm b/chicken-install.scm index 6df5ad67..e3cb9aea 100644 --- a/chicken-install.scm +++ b/chicken-install.scm @@ -23,6 +23,8 @@ ; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ; POSSIBILITY OF SUCH DAMAGE. +(declare + (uses chicken-ffi-syntax)) ; populate ##sys#chicken-ffi-macro-environment (module main () @@ -36,6 +38,7 @@ (import (chicken fixnum)) (import (chicken format)) (import (chicken irregex)) +(import (chicken module)) (import (chicken tcp)) (import (chicken port)) (import (chicken platform)) @@ -927,6 +930,7 @@ (print-error-message ex (current-error-port) (sprintf "Failed to import from `~a'" file)) + (unless quiet (print "loading " file " ...")) (eval `(import-syntax ,(string->symbol module-name)))))) files)) (print "generating database ...") @@ -937,7 +941,9 @@ (lambda (m) (and-let* ((mod (cdr m)) (mname (##sys#module-name mod)) - ((not (memq mname +internal-modules+)))) + ((not (memq mname +internal-modules+))) + ((not (eq? mname (current-module))))) + (unless quiet (print "processing " mname " ...")) (let-values (((_ ve se) (##sys#module-exports mod))) (append (map (lambda (se) (list (car se) 'syntax mname)) se) (map (lambda (ve) (list (car ve) 'value mname)) ve))))) @@ -947,6 +953,7 @@ (with-output-to-file dbfile (lambda () (for-each (lambda (x) (write x) (newline)) db))) + (unless quiet (print "installing " +module-db+ " ...")) (copy-file dbfile (make-pathname (install-path) +module-db+) #t)))) -- 2.11.0