Simplify the build: one-file modules, a module graph read off the imports #67

Merged
alex-eg merged 20 commits from project-infrastructure-improvements into main 2026-10-26 23:24:24 +01:00
Showing only changes of commit 49b463ac7b - Show all commits

View File

@@ -23,6 +23,7 @@
(import scheme
(chicken base)
(chicken condition)
(chicken eval)
(chicken file)
(chicken io)
(chicken pathname)
@@ -43,11 +44,22 @@
;;; module the tests import
(define eggs (call-with-input-file "dependencies.txt" read-list))
;;; A scheme.scm is not the module every unit imports. Asked from /,
;;; since here a NAME.import.scm built from NAME.scm would answer
(define (chicken-module? name)
(let ((here (current-directory)))
(dynamic-wind
(lambda () (change-directory "/"))
(lambda () (handle-exceptions exn #f (module-environment name) #t))
(lambda () (change-directory here)))))
(define (module-file name)
(and (symbol? name)
(not (memq name eggs))
(let ((file (string-append (symbol->string name) ".scm")))
(and (file-exists? file) file))))
(and (file-exists? file)
(not (chicken-module? name))
file))))
;;; FILE's forms, or the end of the scan, naming the file that has none
(define (forms-of file)