>From 6474b33b13fa008277eaae1c6cd82ac7852e3a2e Mon Sep 17 00:00:00 2001 From: Evan Hanson
Date: Sat, 9 Jun 2018 08:48:28 +1200 Subject: [PATCH 3/6] Drop `find-static-extension' from the eval unit This procedure is only used in one place now, to help issue a warning when an extension isn't installed. However, compile-time logic like that doesn't really belong in eval.scm, the logic for locating files isn't even correct (it doesn't consider the current directory or setup-mode, for example), and the "extension not installed" message it's used for doesn't seem very useful (you will most likely have already encountered a compile error since the module wasn't found, and a proper implementation of the warning should probably consult egg-info files instead). We can save a tiny bit of memory in the eval unit, and simplify batch-driver.scm, by dropping both of these. --- batch-driver.scm | 16 +++------------- eval.scm | 6 ------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/batch-driver.scm b/batch-driver.scm index fc296fa7..48e2a1cd 100644 --- a/batch-driver.scm +++ b/batch-driver.scm @@ -662,17 +662,7 @@ (initialize-analysis-database) ;; collect requirements and load inline files - (let* ((required-extensions - (remove chicken.load#core-unit? library-requirements)) - (missing-extensions - (remove (lambda (id) - (or (chicken.load#find-static-extension id) - (chicken.load#find-dynamic-extension id #f))) - required-extensions))) - (when (pair? missing-extensions) - (warning - (sprintf "the following extensions are not currently installed: ~A" - (string-intersperse (map ->string missing-extensions) ", ")))) + (let ((extensions (remove chicken.load#core-unit? library-requirements))) (when enable-inline-files (for-each (lambda (id) @@ -680,7 +670,7 @@ (symbol->string id) '(".inline") #t #f))) (dribble "Loading inline file ~a ..." ifile) (load-inline-file ifile))) - required-extensions)) + extensions)) (let ((ifs (collect-options 'consult-inline-file))) (unless (null? ifs) (set! inline-locally #t) @@ -707,7 +697,7 @@ (load-type-database (make-pathname #f (symbol->string id) "types") enable-specialization)) - required-extensions) + extensions) (begin-time) (set! first-analysis #f) (set! db (analyze 'scrutiny node0)) diff --git a/eval.scm b/eval.scm index dc8043da..fe3c95e0 100644 --- a/eval.scm +++ b/eval.scm @@ -1285,11 +1285,6 @@ (for-each (cut ##sys#check-symbol <> 'provided?) ids) (every ##sys#provided? ids)) -(define (find-static-extension id) - (let ((p (##sys#canonicalize-extension-path id #f))) - (find-file (##sys#string-append p object-file-extension) - (repository-path)))) - ;; Do the right thing with a `##core#require' form. (define (##sys#process-require lib compile-mode) (let ((id (library-id lib))) @@ -1311,7 +1306,6 @@ ;; Export for internal use in csc, modules and batch-driver: (define chicken.load#find-file find-file) -(define chicken.load#find-static-extension find-static-extension) (define chicken.load#find-dynamic-extension find-dynamic-extension) ;;; Find included file: -- 2.11.0