diff --git a/collects/browser/private/info.ss b/collects/browser/private/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/browser/private/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/combinator-parser/info.ss b/collects/combinator-parser/info.ss index c14a2ca411..7e41f36e49 100644 --- a/collects/combinator-parser/info.ss +++ b/collects/combinator-parser/info.ss @@ -1 +1,3 @@ #lang setup/infotab + +(define compile-omit-paths '("examples")) diff --git a/collects/combinator-parser/private-combinator/info.ss b/collects/combinator-parser/private-combinator/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/combinator-parser/private-combinator/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/compiler/compiler-unit.ss b/collects/compiler/compiler-unit.ss index d4f2ff69a6..a03150f436 100644 --- a/collects/compiler/compiler-unit.ss +++ b/collects/compiler/compiler-unit.ss @@ -1,5 +1,5 @@ ;; Main compilation procedures -;; (c) 1997-2001 PLT +;; (c) 1997-2008 PLT ;; The various procedures provided by this library are implemented ;; by dynamically linking to code supplied by the MzLib, dynext, and @@ -8,233 +8,185 @@ ;; The Scheme->C compiler is loaded as either sploadr.ss (link in ;; real MrSpidey) or loadr.ss (link in trivial MrSpidey stubs). -(module compiler-unit scheme/base - (require mzlib/unit +#lang scheme/base - "sig.ss" - dynext/file-sig - dynext/link-sig - dynext/compile-sig - - make/make-sig - make/collection-sig +(require mzlib/unit - syntax/toplevel - syntax/moddep + "sig.ss" + dynext/file-sig + dynext/link-sig + dynext/compile-sig - mzlib/list - scheme/file - mzlib/compile ; gets compile-file - mzlib/cm - setup/getinfo) + make/make-sig + make/collection-sig - (provide compiler@) + syntax/toplevel + syntax/moddep - (define-namespace-anchor anchor) - (define orig-namespace (namespace-anchor->empty-namespace anchor)) + mzlib/list + scheme/file + mzlib/compile ; gets compile-file + mzlib/cm + setup/getinfo) - ;; ;;;;;;;; ----- The main compiler unit ------ ;;;;;;;;;; - (define-unit compiler@ - (import compiler:option^ - dynext:compile^ - dynext:link^ - dynext:file^) - (export compiler^) +(provide compiler@) - (define compile-notify-handler - (make-parameter void)) +(define-namespace-anchor anchor) +(define orig-namespace (namespace-anchor->empty-namespace anchor)) - (define current-compiler-dynamic-require-wrapper - (make-parameter (lambda (thunk) - (parameterize ([current-namespace orig-namespace]) - (thunk))))) +;; ;;;;;;;; ----- The main compiler unit ------ ;;;;;;;;;; +(define-unit compiler@ + (import compiler:option^ + dynext:compile^ + dynext:link^ + dynext:file^) + (export compiler^) - (define (c-dynamic-require path id) - ((current-compiler-dynamic-require-wrapper) - (lambda () - (dynamic-require path id)))) - (define (c-get-info cp) - ((current-compiler-dynamic-require-wrapper) - (lambda () - (get-info cp)))) + (define compile-notify-handler + (make-parameter void)) - (define (make-extension-compiler mode prefix) - (let ([u (c-dynamic-require 'compiler/private/base - 'base@)] - [init (unit - (import compiler:inner^) - (export) - (eval-compile-prefix prefix) - (case mode - [(compile-extension) compile-extension] - [(compile-extension-to-c) compile-extension-to-c] - [(compile-c-extension) compile-c-extension]))]) - (invoke-unit - (compound-unit - (import (COMPILE : dynext:compile^) - (LINK : dynext:link^) - (DFILE : dynext:file^) - (OPTION : compiler:option^)) - (export) - (link [((COMPILER : compiler:inner^)) - u - COMPILE LINK DFILE OPTION] - [() init COMPILER])) - (import dynext:compile^ - dynext:link^ - dynext:file^ - compiler:option^)))) + (define current-compiler-dynamic-require-wrapper + (make-parameter (lambda (thunk) + (parameterize ([current-namespace orig-namespace]) + (thunk))))) - (define (make-compiler mode) - (lambda (prefix) - (let ([c (make-extension-compiler mode prefix)]) - (lambda (source-files destination-directory) - (for-each - (lambda (source-file) - (c source-file (or destination-directory 'same))) - source-files))))) + (define (c-dynamic-require path id) + ((current-compiler-dynamic-require-wrapper) + (lambda () (dynamic-require path id)))) + (define (c-get-info cp) + ((current-compiler-dynamic-require-wrapper) + (lambda () (get-info cp)))) - (define (make-unprefixed-compiler mode) - (let ([f #f]) - (lambda (source-files destination-directory) - (unless f - (set! f ((make-compiler mode) '(void)))) - (f source-files destination-directory)))) + (define (make-extension-compiler mode prefix) + (let ([u (c-dynamic-require 'compiler/private/base 'base@)] + [init (unit (import compiler:inner^) (export) + (eval-compile-prefix prefix) + (case mode + [(compile-extension) compile-extension] + [(compile-extension-to-c) compile-extension-to-c] + [(compile-c-extension) compile-c-extension]))]) + (invoke-unit + (compound-unit + (import (COMPILE : dynext:compile^) + (LINK : dynext:link^) + (DFILE : dynext:file^) + (OPTION : compiler:option^)) + (export) + (link [((COMPILER : compiler:inner^)) u COMPILE LINK DFILE OPTION] + [() init COMPILER])) + (import dynext:compile^ + dynext:link^ + dynext:file^ + compiler:option^)))) - (define compile-extensions - (make-compiler 'compile-extension)) - (define compile-extensions-to-c - (make-compiler 'compile-extension-to-c)) - (define compile-c-extensions - (make-unprefixed-compiler 'compile-c-extension)) + (define (make-compiler mode) + (lambda (prefix) + (let ([c (make-extension-compiler mode prefix)]) + (lambda (source-files destination-directory) + (for ([source-file source-files]) + (c source-file (or destination-directory 'same))))))) - (define (compile-to-zo src dest namespace eval?) - ((if eval? (lambda (t) (t)) with-module-reading-parameterization) - (lambda () - (parameterize ([current-namespace namespace]) - (compile-file src dest - (if eval? - (lambda (expr) - (expand-syntax-top-level-with-compile-time-evals expr)) - values))))) - (printf " [output to \"~a\"]~n" dest)) + (define (make-unprefixed-compiler mode) + (let ([f #f]) + (lambda (source-files destination-directory) + (unless f + (set! f ((make-compiler mode) '(void)))) + (f source-files destination-directory)))) - (define (compile-zos prefix) - (let ([n (if prefix - (make-base-namespace) - (current-namespace))]) - (when prefix - (eval prefix n)) - (lambda (source-files destination-directory) - (let ([file-bases (map - (lambda (file) - (let ([f (extract-base-filename/ss file 'mzc)]) - (if destination-directory - (let-values ([(base file dir?) (split-path f)]) - (build-path (if (eq? destination-directory 'auto) - (let ([d (build-path (if (eq? base 'relative) - 'same - base) - "compiled")]) - (unless (directory-exists? d) - (make-directory* d)) - d) - destination-directory) - file)) - f))) - source-files)]) - (for-each - (lambda (f b) - (let ([zo (append-zo-suffix b)]) - (compile-to-zo f zo n prefix))) - source-files file-bases))))) + (define compile-extensions + (make-compiler 'compile-extension)) + (define compile-extensions-to-c + (make-compiler 'compile-extension-to-c)) + (define compile-c-extensions + (make-unprefixed-compiler 'compile-c-extension)) - (define (compile-directory dir info zos?) - (let ([make (c-dynamic-require 'make/make-unit 'make@)] - [coll (c-dynamic-require 'make/collection-unit 'make:collection@)] - [init (unit - (import make^ make:collection^) - (export) - (values make-collection make-notify-handler))]) - (let-values ([(make-collection make-notify-handler) - (invoke-unit - (compound-unit - (import (DFILE : dynext:file^) - (OPTION : compiler:option^) - (COMPILER : compiler^)) - (export) - (link [((MAKE : make^)) make] - [((COLL : make:collection^)) - coll - MAKE DFILE OPTION COMPILER] - [() init MAKE COLL])) - (import dynext:file^ - compiler:option^ - compiler^))]) - (let ([orig (current-directory)]) - (dynamic-wind - (lambda () (current-directory dir)) - (lambda () - (parameterize ([current-load-relative-directory dir]) - ;; Compile the collection files via make-collection - (let ([sses (append - ;; Find all .ss/.scm files: - (filter - extract-base-filename/ss - (directory-list)) - ;; Add specified doc sources: - (map car (info - 'scribblings - (lambda () null))))]) - (let ([filtered-sses - (remove* - (map string->path - (info - (if zos? - 'compile-zo-omit-files - 'compile-extension-omit-files) - (lambda () null))) - (remove* - (map string->path - (info 'compile-omit-files (lambda () null))) - sses))]) - (if zos? - ;; Verbose compilation manager: - (parameterize ([manager-trace-handler (lambda (s) (printf "~a~n" s))] - [manager-compile-notify-handler (lambda (path) - ((compile-notify-handler) path))]) - (map (make-caching-managed-compile-zo) filtered-sses)) - ;; Old collection compiler: - (parameterize ([make-notify-handler (lambda (path) - ((compile-notify-handler) path))]) - (make-collection - ((or info (lambda (a f) (f))) - 'name - (lambda () (error 'compile-collection "info did not provide a name in ~e" - dir))) - filtered-sses - (if zos? #("zo") #())))))))) - (lambda () (current-directory orig))) - (when (compile-subcollections) - (for-each - ;; bug! planet files will do the wrong thing here - (lambda (s) - (unless (and (pair? s) (list? s) (andmap string? s)) - (error 'compile-collection "bad sub-collection path: ~a" s)) - (let ((p (apply build-path dir s))) - (compile-directory p (get-info/full p) zos?))) - (info 'compile-subcollections (lambda () null)))))))) - - (define (compile-collection cp zos?) - (let ([dir (apply collection-path cp)] - [info (c-get-info cp)]) - (compile-directory dir info zos?))) + (define (compile-to-zo src dest namespace eval?) + ((if eval? (lambda (t) (t)) with-module-reading-parameterization) + (lambda () + (parameterize ([current-namespace namespace]) + (compile-file src dest + (if eval? + (lambda (expr) + (expand-syntax-top-level-with-compile-time-evals expr)) + values))))) + (printf " [output to \"~a\"]\n" dest)) - (define (compile-collection-zos collection . cp) - (compile-collection (cons collection cp) #t)) - - (define (compile-directory-zos dir info) - (compile-directory dir info #t)) - - - )) + (define (compile-zos prefix) + (define n (if prefix (make-base-namespace) (current-namespace))) + (when prefix (eval prefix n)) + (lambda (source-files destination-directory) + (define file-bases + (map (lambda (file) + (let ([f (extract-base-filename/ss file 'mzc)]) + (if destination-directory + (let-values ([(base file dir?) (split-path f)]) + (build-path + (if (eq? destination-directory 'auto) + (let ([d (build-path (if (eq? base 'relative) 'same base) + "compiled")]) + (unless (directory-exists? d) (make-directory* d)) + d) + destination-directory) + file)) + f))) + source-files)) + (for ([f source-files] [b file-bases]) + (let ([zo (append-zo-suffix b)]) + (compile-to-zo f zo n prefix))))) + + (define (compile-directory dir info) + (define info* (or info (lambda (key mk-default) (mk-default)))) + (define make (c-dynamic-require 'make/make-unit 'make@)) + (define coll (c-dynamic-require 'make/collection-unit 'make:collection@)) + (define init (unit (import make^ make:collection^) (export) + (values make-collection make-notify-handler))) + (define-values (make-collection make-notify-handler) + (invoke-unit + (compound-unit + (import (DFILE : dynext:file^) + (OPTION : compiler:option^) + (COMPILER : compiler^)) + (export) + (link [((MAKE : make^)) make] + [((COLL : make:collection^)) coll MAKE DFILE OPTION COMPILER] + [() init MAKE COLL])) + (import dynext:file^ compiler:option^ compiler^))) + (define nothing (lambda () null)) + (define omit-paths (info* 'compile-omit-paths nothing)) + (define omit-files (info* 'compile-omit-files nothing)) + (unless (eq? 'all omit-paths) + (parameterize ([current-directory dir] + [current-load-relative-directory dir] + ;; Verbose compilation manager: + [manager-trace-handler (lambda (s) (printf "~a\n" s))] + [manager-compile-notify-handler + (lambda (path) ((compile-notify-handler) path))]) + ;; Compile the collection files via make-collection + (let* ([sses (append + ;; Find all .ss/.scm files: + (filter extract-base-filename/ss (directory-list)) + ;; Add specified doc sources: + (map car (info* 'scribblings nothing)))] + [sses (remove* (map string->path omit-paths) sses)] + [sses (remove* (map string->path omit-files) sses)]) + (for-each (make-caching-managed-compile-zo) sses))) + (when (compile-subcollections) + (when (info* 'compile-subcollections (lambda () #f)) + (printf "Warning: ignoring `compile-subcollections' entry in info ~a\n" + dir)) + (for ([p (directory-list dir)]) + (let ([s (path->string p)]) + ;; this is the same check that setup/setup-unit is doing in + ;; `make-cc*' + (unless (or (regexp-match? #rx"^[.]" s) (equal? "compiled" s) + (and (pair? omit-paths) (member s omit-paths))) + (let ([p (build-path dir p)]) + (compile-directory p (get-info/full p))))))))) + + (define (compile-collection-zos collection . cp) + (compile-directory (apply collection-path collection cp) + (c-get-info (cons collection cp)))) + + (define compile-directory-zos compile-directory) + + ) diff --git a/collects/compiler/option-unit.ss b/collects/compiler/option-unit.ss index 7ad55bc9d5..2126934801 100644 --- a/collects/compiler/option-unit.ss +++ b/collects/compiler/option-unit.ss @@ -1,42 +1,40 @@ -(module option-unit mzscheme - (require mzlib/unit) +#lang mzscheme - (require "sig.ss") +(require mzlib/unit) +(require "sig.ss") - (provide compiler:option@) +(provide compiler:option@) - (define-unit compiler:option@ - (import) - (export compiler:option^) - - (define propagate-constants (make-parameter #t)) - (define assume-primitives (make-parameter #f)) - (define stupid (make-parameter #f)) - - (define vehicles (make-parameter 'vehicles:automatic)) - (define vehicles:monoliths (make-parameter 1)) - (define seed (make-parameter 2001)) - (define max-monoliths 32) - - (define max-inline-size (make-parameter 50)) +(define-unit compiler:option@ (import) (export compiler:option^) - (define unsafe (make-parameter #f)) - (define disable-interrupts (make-parameter #f)) - (define fixnum-arithmetic (make-parameter #f)) + (define propagate-constants (make-parameter #t)) + (define assume-primitives (make-parameter #f)) + (define stupid (make-parameter #f)) - (define verbose (make-parameter #f)) - (define debug (make-parameter #f)) - (define test (make-parameter #f)) - (define clean-intermediate-files (make-parameter #t)) - (define 3m (make-parameter (eq? '3m (system-type 'gc)))) + (define vehicles (make-parameter 'vehicles:automatic)) + (define vehicles:monoliths (make-parameter 1)) + (define seed (make-parameter 2001)) + (define max-monoliths 32) - (define max-exprs-per-top-level-set (make-parameter 25)) - - (define setup-prefix (make-parameter "")) + (define max-inline-size (make-parameter 50)) - (define compile-subcollections (make-parameter #t)) - (define compile-for-embedded (make-parameter #f)) - - ;; Maybe #f helps for register-poor architectures? - (define unpack-environments (make-parameter #f)))) + (define unsafe (make-parameter #f)) + (define disable-interrupts (make-parameter #f)) + (define fixnum-arithmetic (make-parameter #f)) + + (define verbose (make-parameter #f)) + (define debug (make-parameter #f)) + (define test (make-parameter #f)) + (define clean-intermediate-files (make-parameter #t)) + (define 3m (make-parameter (eq? '3m (system-type 'gc)))) + + (define max-exprs-per-top-level-set (make-parameter 25)) + + (define setup-prefix (make-parameter "")) + + (define compile-subcollections (make-parameter #t)) + (define compile-for-embedded (make-parameter #f)) + + ;; Maybe #f helps for register-poor architectures? + (define unpack-environments (make-parameter #f))) diff --git a/collects/compiler/private/info.ss b/collects/compiler/private/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/compiler/private/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/compiler/sig.ss b/collects/compiler/sig.ss index b9577b6fa7..426dc6ee28 100644 --- a/collects/compiler/sig.ss +++ b/collects/compiler/sig.ss @@ -1,90 +1,89 @@ -(module sig mzscheme +#lang mzscheme - (require mzlib/unit) +(require mzlib/unit) - (provide compiler:option^ - compiler^ - compiler:inner^) +(provide compiler:option^ + compiler^ + compiler:inner^) - ;; Compiler options - (define-signature compiler:option^ - (verbose ; default = #f - - setup-prefix ; string to embed in public names; - ; used mainly for compiling extensions - ; with the collection name so that - ; cross-extension conflicts are less - ; likely in architectures that expose - ; the public names of loaded extensions - ; default = "" - - clean-intermediate-files ; #t => keep intermediate .c/.o files - ; default = #f +;; Compiler options +(define-signature compiler:option^ + (verbose ; default = #f - 3m ; #t => build for 3m - ; default = #f - - compile-subcollections ; #t => use 'compile-subcollections - ; from infor for collection compiling - ; default = #t - - compile-for-embedded ; #f => make objects to be linked + setup-prefix ; string to embed in public names; + ; used mainly for compiling extensions + ; with the collection name so that + ; cross-extension conflicts are less + ; likely in architectures that expose + ; the public names of loaded extensions + ; default = "" + + clean-intermediate-files ; #t => keep intermediate .c/.o files + ; default = #f + + 3m ; #t => build for 3m + ; default = #f + + compile-subcollections ; #t => compile collection subdirectories + ; default = #t + + compile-for-embedded ; #f => make objects to be linked ; directly with MzScheme, not dynamically ; loaded; default = #f - - max-inline-size ; max size of inlined procedures - - disable-interrupts ; #t => UNSAFE: turn off breaking, stack - ; overflow, and thread switching; - ; default = #f - unsafe ; #t => UNSAFE: omit some type checks - ; default = #f - fixnum-arithmetic ; #t => UNSAFE: don't check for overflow or - ; underflow for fixnum arithmetic; - ; default = #f - - propagate-constants ; default = #t - assume-primitives ; #t => car = #%car; default = #f - stupid ; allow obvious non-syntactic errors; - ; e.g.: ((lambda () 0) 1 2 3) - - vehicles ; Controls how closures are compiled: - ; 'vehicles:automatic, - ; 'vehicles:functions, - ; 'vechicles:units, or - ; 'vehicles:monolithic. - ; default = 'vehicles:automatic - vehicles:monoliths ; Size for 'vehicles:monolithic - seed ; Randomizer seed for 'vehicles:monolithic - - max-exprs-per-top-level-set ; Number of top-level Scheme expressions - ; crammed into one C function; default = 25 - - unpack-environments ; default = #t - ; Maybe #f helps for register-poor architectures? - - debug ; #t => creates debug.txt debugging file - test ; #t => ignores top-level expressions with syntax errors - )) - ;; Compiler procedures - (define-signature compiler^ - (compile-extensions - compile-extensions-to-c - compile-c-extensions + max-inline-size ; max size of inlined procedures - compile-zos + disable-interrupts ; #t => UNSAFE: turn off breaking, stack + ; overflow, and thread switching; + ; default = #f + unsafe ; #t => UNSAFE: omit some type checks + ; default = #f + fixnum-arithmetic ; #t => UNSAFE: don't check for overflow or + ; underflow for fixnum arithmetic; + ; default = #f - compile-collection-zos - compile-directory-zos - - current-compiler-dynamic-require-wrapper - compile-notify-handler)) + propagate-constants ; default = #t + assume-primitives ; #t => car = #%car; default = #f + stupid ; allow obvious non-syntactic errors; + ; e.g.: ((lambda () 0) 1 2 3) - ;; Low-level extension compiler interface - (define-signature compiler:inner^ - (compile-extension - compile-extension-to-c - compile-c-extension - eval-compile-prefix))) + vehicles ; Controls how closures are compiled: + ; 'vehicles:automatic, + ; 'vehicles:functions, + ; 'vechicles:units, or + ; 'vehicles:monolithic. + ; default = 'vehicles:automatic + vehicles:monoliths ; Size for 'vehicles:monolithic + seed ; Randomizer seed for 'vehicles:monolithic + + max-exprs-per-top-level-set ; Number of top-level Scheme expressions + ; crammed into one C function; default = 25 + + unpack-environments ; default = #t + ; Maybe #f helps for register-poor architectures? + + debug ; #t => creates debug.txt debugging file + test ; #t => ignores top-level expressions with syntax errors + )) + +;; Compiler procedures +(define-signature compiler^ + (compile-extensions + compile-extensions-to-c + compile-c-extensions + + compile-zos + + compile-collection-zos + compile-directory-zos + + current-compiler-dynamic-require-wrapper + compile-notify-handler)) + +;; Low-level extension compiler interface +(define-signature compiler:inner^ + (compile-extension + compile-extension-to-c + compile-c-extension + eval-compile-prefix)) diff --git a/collects/drscheme/private/info.ss b/collects/drscheme/private/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/drscheme/private/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/dynext/private/dirs.ss b/collects/dynext/private/dirs.ss index 4566a9179d..888d925889 100644 --- a/collects/dynext/private/dirs.ss +++ b/collects/dynext/private/dirs.ss @@ -6,7 +6,3 @@ (define std-library-dir (find-lib-dir)) (provide include-dir std-library-dir)) - - - - diff --git a/collects/dynext/private/info.ss b/collects/dynext/private/info.ss new file mode 100644 index 0000000000..1ed3114373 --- /dev/null +++ b/collects/dynext/private/info.ss @@ -0,0 +1,3 @@ +#lang setup/infotab + +(define compile-omit-paths '("stdio.ss" "macinc.ss")) diff --git a/collects/embedded-gui/info.ss b/collects/embedded-gui/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/embedded-gui/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/embedded-gui/private/info.ss b/collects/embedded-gui/private/info.ss new file mode 100644 index 0000000000..865edce150 --- /dev/null +++ b/collects/embedded-gui/private/info.ss @@ -0,0 +1,3 @@ +#lang setup/infotab + +(define compile-omit-paths '("tests")) diff --git a/collects/eopl/private/info.ss b/collects/eopl/private/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/eopl/private/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/errortrace/info.ss b/collects/errortrace/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/errortrace/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/ffi/info.ss b/collects/ffi/info.ss index 2119f78f5c..de10b968fb 100644 --- a/collects/ffi/info.ss +++ b/collects/ffi/info.ss @@ -1,3 +1,5 @@ #lang setup/infotab (define name "Sample FFIs") + +(define compile-omit-paths '("examples")) diff --git a/collects/file/info.ss b/collects/file/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/file/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/framework/info.ss b/collects/framework/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/framework/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/framework/private/info.ss b/collects/framework/private/info.ss index 1540052563..14c0367cff 100644 --- a/collects/framework/private/info.ss +++ b/collects/framework/private/info.ss @@ -1,3 +1,3 @@ #lang setup/infotab -(define compile-omit-files '("standard-menus.ss")) +(define compile-omit-paths '("standard-menus.ss")) diff --git a/collects/frtime/info.ss b/collects/frtime/info.ss index 9a5b3eaa0c..739b26c51d 100644 --- a/collects/frtime/info.ss +++ b/collects/frtime/info.ss @@ -1,7 +1,8 @@ #lang setup/infotab +(define compile-omit-paths '("demos")) + (define scribblings '(("frtime.scrbl" ()))) -(define compile-subcollections '(("frtime" "demos" "gui"))) (define tools '("frtime-tool.ss")) (define tool-icons '(("clock.png" "frtime"))) (define tool-names '("FrTime Languages")) diff --git a/collects/games/loa/info.ss b/collects/games/loa/info.ss new file mode 100644 index 0000000000..a073420a94 --- /dev/null +++ b/collects/games/loa/info.ss @@ -0,0 +1,3 @@ +#lang setup/infotab + +(define compile-omit-paths 'all) diff --git a/collects/games/paint-by-numbers/info.ss b/collects/games/paint-by-numbers/info.ss index 73861ab1c3..55beccd2a9 100644 --- a/collects/games/paint-by-numbers/info.ss +++ b/collects/games/paint-by-numbers/info.ss @@ -2,7 +2,7 @@ (define game "paint-by-numbers.ss") (define game-set "Puzzle Games") -(define compile-omit-files +(define compile-omit-paths '(;; Skipped because it's huge - lots of data-encoding units "all-problems.ss" ;; Skipped because it requires all-problems.ss @@ -17,4 +17,9 @@ "raw-misc.ss" "build-rows-cols.ss" "count-missing.ss" - "main.ss")) + "main.ss" + ;; directories too + "hattori" + "problems" + "raw-problems" + "solution-sets")) diff --git a/collects/graphics/info.ss b/collects/graphics/info.ss index 4e693a1e7d..63f4ab2a84 100644 --- a/collects/graphics/info.ss +++ b/collects/graphics/info.ss @@ -1,3 +1,3 @@ #lang setup/infotab -(define compile-omit-files '("value-turex.ss" "value-turtle-lib.ss")) +(define compile-omit-paths '("value-turex.ss" "value-turtle-lib.ss")) diff --git a/collects/handin-server/info.ss b/collects/handin-server/info.ss index a8d06ce502..574c25002b 100644 --- a/collects/handin-server/info.ss +++ b/collects/handin-server/info.ss @@ -1,3 +1,5 @@ #lang setup/infotab (define scribblings '(("scribblings/handin-server.scrbl" (user-doc)))) + +(define compile-omit-paths '("status-web-root")) diff --git a/collects/htdch/draw/installer.ss b/collects/htdch/draw/installer.ss index 25be35ed9f..bab61143aa 100644 --- a/collects/htdch/draw/installer.ss +++ b/collects/htdch/draw/installer.ss @@ -21,4 +21,3 @@ (javac "Canvas.java") (javac "SillyCanvas.java") (javac "World.java"))))) - diff --git a/collects/htdch/idraw/Canvas-native-methods.ss b/collects/htdch/idraw/Canvas-native-methods.ss index ac326845e0..ff96185c1c 100644 --- a/collects/htdch/idraw/Canvas-native-methods.ss +++ b/collects/htdch/idraw/Canvas-native-methods.ss @@ -1,6 +1,6 @@ #cs (module Canvas-native-methods mzscheme - (require (lib "support.scm" "htdch" "draw") mzlib/unit) + (require (lib "htdch/draw/support.scm") mzlib/unit) (define void-or-true (void)) (define (imperative w@t+1 w@t) w@t+1) diff --git a/collects/htdch/idraw/World-native-methods.ss b/collects/htdch/idraw/World-native-methods.ss index f313033e30..49d2954d34 100644 --- a/collects/htdch/idraw/World-native-methods.ss +++ b/collects/htdch/idraw/World-native-methods.ss @@ -1,6 +1,6 @@ #cs (module World-native-methods mzscheme - (require (lib "support.scm" "htdch" "draw") mzlib/unit) + (require (lib "htdch/draw/support.scm") mzlib/unit) (provide endOfTime-java.lang.String-native endOfWorld-java.lang.String-native bigBangO-double-native) diff --git a/collects/htdch/idraw/info.ss b/collects/htdch/idraw/info.ss index 6c46e8acf7..fd781dacce 100644 --- a/collects/htdch/idraw/info.ss +++ b/collects/htdch/idraw/info.ss @@ -2,5 +2,5 @@ (define name "Imperative Drawing") (define assume-virtual-sources #t) -(define install-collection "installer.ss") +;; FIXME: doing this leads to an error: (define install-collection "installer.ss") ;; (define pre-install-collection "pre-installer.ss") diff --git a/collects/htdch/info.ss b/collects/htdch/info.ss index 2da8ed5e45..c78ad9474f 100644 --- a/collects/htdch/info.ss +++ b/collects/htdch/info.ss @@ -1,9 +1,5 @@ #lang setup/infotab (define name "Java Teachpacks") -(define compile-subcollections - '(("htdch" "draw") - ("htdch" "geometry") - ("htdch" "colors") - ("htdch" "graphics") - ("htdch" "idraw"))) + +(define compile-omit-paths '("Examples")) diff --git a/collects/htdp/HtDPv0/pingp-sig.ss b/collects/htdp/HtDPv0/pingp-sig.ss index efe76188bb..72640bc12e 100644 --- a/collects/htdp/HtDPv0/pingp-sig.ss +++ b/collects/htdp/HtDPv0/pingp-sig.ss @@ -1,5 +1,5 @@ #cs(module pingp-sig mzscheme - (require "draw-sig.ss" + (require htdp/draw-sig mzlib/unitsig) (provide pingpS ping-protS-core diff --git a/collects/htdp/info.ss b/collects/htdp/info.ss index 5ff1957b44..cd995b856f 100644 --- a/collects/htdp/info.ss +++ b/collects/htdp/info.ss @@ -1,9 +1,10 @@ #lang setup/infotab (define name "HtDP Teachpacks") -(define compile-omit-files +(define compile-omit-paths '("hangman-world.ss" "hangman-world-play.ss" ;; TEMPORARY DISABLE THESE FILES UNTIL FIXED ;; "matrix.ss" "matrix-client.ss" "matrix-invisible.ss" ;; "matrix-render-sig.ss" "matrix-sig.ss" "matrix-unit.ss" - )) + "Test" + "HtDPv0")) diff --git a/collects/html/info.ss b/collects/html/info.ss index 0d8853d4bc..2e71718a8b 100644 --- a/collects/html/info.ss +++ b/collects/html/info.ss @@ -1,6 +1,6 @@ #lang setup/infotab (define scribblings '(("html.scrbl"))) -(define compile-omit-files +(define compile-omit-paths '("dtd.ss" "dtdr.ss" "dtds.ss" "dtd-ast.ss" "case.ss" "html-structs.ss" "entity-expander.ss" "generate-code.ss" "sgml.ss")) diff --git a/collects/lang/private/info.ss b/collects/lang/private/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/lang/private/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/launcher/info.ss b/collects/launcher/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/launcher/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/little-helper/indexer/planet/info.ss b/collects/little-helper/indexer/planet/info.ss new file mode 100644 index 0000000000..874e3c1927 --- /dev/null +++ b/collects/little-helper/indexer/planet/info.ss @@ -0,0 +1,5 @@ +#lang setup/infotab + +;; This directory should go away soon + +(define compile-omit-paths 'all) diff --git a/collects/little-helper/info.ss b/collects/little-helper/info.ss index 40f26e8044..738f3eb9f5 100644 --- a/collects/little-helper/info.ss +++ b/collects/little-helper/info.ss @@ -1,3 +1,3 @@ #lang setup/infotab -(define name "Little Helper") +(define compile-omit-paths '("web-root")) diff --git a/collects/macro-debugger/syntax-browser/info.ss b/collects/macro-debugger/syntax-browser/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/macro-debugger/syntax-browser/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/macro-debugger/view/info.ss b/collects/macro-debugger/view/info.ss index be50e54fd7..2c2a07f91a 100644 --- a/collects/macro-debugger/view/info.ss +++ b/collects/macro-debugger/view/info.ss @@ -1,3 +1,3 @@ #lang setup/infotab -(define compile-omit-files '("browse-deriv.ss" "show-deriv.ss")) +(define compile-omit-paths '("browse-deriv.ss" "show-deriv.ss")) diff --git a/collects/make/info.ss b/collects/make/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/make/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/mred/lang/info.ss b/collects/mred/lang/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/mred/lang/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/mred/private/info.ss b/collects/mred/private/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/mred/private/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/mrlib/info.ss b/collects/mrlib/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/mrlib/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/mrlib/private/aligned-pasteboard/info.ss b/collects/mrlib/private/aligned-pasteboard/info.ss new file mode 100644 index 0000000000..865edce150 --- /dev/null +++ b/collects/mrlib/private/aligned-pasteboard/info.ss @@ -0,0 +1,3 @@ +#lang setup/infotab + +(define compile-omit-paths '("tests")) diff --git a/collects/mrlib/private/info.ss b/collects/mrlib/private/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/mrlib/private/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/mzlib/info.ss b/collects/mzlib/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/mzlib/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/mzlib/private/info.ss b/collects/mzlib/private/info.ss index 037595c0d0..d0ef083e83 100644 --- a/collects/mzlib/private/info.ss +++ b/collects/mzlib/private/info.ss @@ -1,3 +1,3 @@ #lang setup/infotab -(define compile-omit-files '("shared-body.ss")) +(define compile-omit-paths '("shared-body.ss")) diff --git a/collects/mzscheme/info.ss b/collects/mzscheme/info.ss index 697de8483a..5da4f18e16 100644 --- a/collects/mzscheme/info.ss +++ b/collects/mzscheme/info.ss @@ -4,3 +4,5 @@ (define scribblings '(("mzscheme.scrbl" (multi-page)))) (define doc-categories '(legacy)) + +(define compile-omit-paths '("examples")) diff --git a/collects/mzscheme/lang/info.ss b/collects/mzscheme/lang/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/mzscheme/lang/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/net/info.ss b/collects/net/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/net/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/parser-tools/info.ss b/collects/parser-tools/info.ss index 5e433f62ad..9062091f56 100644 --- a/collects/parser-tools/info.ss +++ b/collects/parser-tools/info.ss @@ -1,3 +1,5 @@ #lang setup/infotab (define scribblings '(("parser-tools.scrbl" (multi-page)))) + +(define compile-omit-paths '("examples")) diff --git a/collects/parser-tools/private-lex/info.ss b/collects/parser-tools/private-lex/info.ss index ac5460be1a..4be81f783d 100644 --- a/collects/parser-tools/private-lex/info.ss +++ b/collects/parser-tools/private-lex/info.ss @@ -1,3 +1,3 @@ #lang setup/infotab -(define compile-omit-files (list "error-tests.ss")) +(define compile-omit-paths '("error-tests.ss")) diff --git a/collects/parser-tools/private-yacc/info.ss b/collects/parser-tools/private-yacc/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/parser-tools/private-yacc/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/plot/info.ss b/collects/plot/info.ss index 1586d46a15..73517418fd 100644 --- a/collects/plot/info.ss +++ b/collects/plot/info.ss @@ -1,3 +1,5 @@ #lang setup/infotab (define pre-install-collection "pre-installer.ss") + +(define compile-omit-paths '("demos")) diff --git a/collects/profj/comb-parsers/info.ss b/collects/profj/comb-parsers/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/profj/comb-parsers/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/profj/info.ss b/collects/profj/info.ss index b6ec5099f1..8defd0b225 100644 --- a/collects/profj/info.ss +++ b/collects/profj/info.ss @@ -6,12 +6,6 @@ (define tool-names '("ProfessorJ" "ProfessorJ Testing")) (define install-collection "installer.ss") (define pre-install-collection "pre-installer.ss") -(define compile-subcollections - '(("profj" "parsers") - ("profj" "comb-parsers") - ("profj" "libs" "java" "lang") - ("profj" "libs" "java" "io") - ("profj" "libs" "java" "util"))) (define textbook-pls (list (list '("htdch-icon.png" "profj") "How to Design Classes" diff --git a/collects/profj/parsers/info.ss b/collects/profj/parsers/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/profj/parsers/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/profjWizard/info.ss b/collects/profjWizard/info.ss index ebfbd6163b..6fbc66c821 100644 --- a/collects/profjWizard/info.ss +++ b/collects/profjWizard/info.ss @@ -3,11 +3,8 @@ (define name "ProfessorJ Wizard") (define tools '(("tool.ss"))) (define tool-names '("ProfessorJ Wizard")) -;; (define compile-subcollections -;; '(("profj" "parsers") -;; ("profj" "libs" "java" "lang") -;; ("profj" "libs" "java" "io"))) -(define compile-omit-files + +(define compile-omit-paths '("draw-txt0.ss" "macro-class.scm" "view0.scm" diff --git a/collects/r5rs/lang/info.ss b/collects/r5rs/lang/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/r5rs/lang/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/r6rs/info.ss b/collects/r6rs/info.ss deleted file mode 100644 index 3940614bea..0000000000 --- a/collects/r6rs/info.ss +++ /dev/null @@ -1,7 +0,0 @@ -#lang setup/infotab - -(define scribblings '(("scribblings/r6rs.scrbl" (multi-page)))) -(define doc-categories '((languages -1))) - -(define mzscheme-launcher-names '("PLT R6RS")) -(define mzscheme-launcher-libraries '("run.ss")) diff --git a/collects/rnrs/arithmetic/info.ss b/collects/rnrs/arithmetic/info.ss deleted file mode 100644 index de01082fe1..0000000000 --- a/collects/rnrs/arithmetic/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab \ No newline at end of file diff --git a/collects/rnrs/info.ss b/collects/rnrs/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/rnrs/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/rnrs/io/info.ss b/collects/rnrs/io/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/rnrs/io/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/rnrs/records/info.ss b/collects/rnrs/records/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/rnrs/records/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/s-exp/lang/info.ss b/collects/s-exp/lang/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/s-exp/lang/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/scheme/info.ss b/collects/scheme/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/scheme/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/scribble/info.ss b/collects/scribble/info.ss index 805d59f03b..88f25d81c7 100644 --- a/collects/scribble/info.ss +++ b/collects/scribble/info.ss @@ -2,4 +2,4 @@ (define mzscheme-launcher-names '("scribble")) (define mzscheme-launcher-libraries '("scribble.ss")) -(define compile-omit-files '("test-reader.ss")) +(define compile-omit-paths '("test-reader.ss")) diff --git a/collects/scribblings/guide/info.ss b/collects/scribblings/guide/info.ss index 5a4b016b6b..5f69e678b8 100644 --- a/collects/scribblings/guide/info.ss +++ b/collects/scribblings/guide/info.ss @@ -2,3 +2,5 @@ (define scribblings '(("guide.scrbl" (multi-page)))) (define doc-categories '(getting-started)) + +(define compile-omit-paths '("contracts-examples")) diff --git a/collects/scribblings/mzc/api.scrbl b/collects/scribblings/mzc/api.scrbl index 1952e059de..098bf55850 100644 --- a/collects/scribblings/mzc/api.scrbl +++ b/collects/scribblings/mzc/api.scrbl @@ -74,22 +74,22 @@ following fields are used: @item{@scheme[name] : The name of the collection as a string.} + @item{@scheme[compile-omit-paths] : A list of immediate file and + directory names; all Scheme files (and subdirectories, if + @scheme[compile-subcollections] is set) in the collection are + compiled except for ones in this list. Alternatively, the + field can be set to @scheme['all], which is equivalent to + specifying all files and directories, and effectively makes the + collection ignored completely. + + Files that are required by other files that are compiled, + however, are always compiled in the process, even when listed + with this field, or when it is @scheme['all].} + @item{@scheme[compile-omit-files] : A list of filenames (without - directory paths); all Scheme files in the collection are - compiled except for the files in this list. Files that are - required by other files that are compiled, however, will get - compiled in the process, even when listed with this field.} - - @item{@scheme[compile-zo-omit-files] : A List of filenames to extend - the list for @scheme[compile-omit-files]. Historically, this - list of files was not used for other compilation modes that are - no longer supported.} - - @item{@scheme[compile-subcollections] : A list of collection paths, - where each path is a list of strings specifying a collection - (from the collection root, not relative). - @scheme[compile-collection-extension] is applied to - each of the collections.} + directory paths); that are not compiled, in addition to the + contents of @scheme[compile-omit-paths]. Do not use this + field: it is for backward compatibility.} } Only the @scheme[name] field is required from @filepath{info.ss}, @@ -197,15 +197,10 @@ A @scheme[#f] value for the parameter keeps intermediate @filepath{.c} and @filepath{.o} files generated during compilation via C. The default is @scheme[#t].} +@defparam[compile-subcollections cols (one-of/c #t #f)]{ -@defparam[compile-subcollections cols (or/c (listof (listof string?)) (one-of/c #t))]{ - -A parameter that specifies sub-collections for -@scheme[compile-collection-zos] to compile. A @scheme[#t] value -indicates that the collection's @filepath{info.ss} should be used, or -that sub-collections should be determined automatically by looking for -sub-directories that contain @filepath{info.ss} files. The default is -@scheme[#t].} +A parameter that specifies whether sub-collections are compiled by +@scheme[compile-collection-zos]. The default is @scheme[#t].} @defboolparam[compile-for-embedded embed?]{ diff --git a/collects/scribblings/setup-plt/info.scrbl b/collects/scribblings/setup-plt/info.scrbl index 978c182596..8cb62acf48 100644 --- a/collects/scribblings/setup-plt/info.scrbl +++ b/collects/scribblings/setup-plt/info.scrbl @@ -61,10 +61,11 @@ As illustrated in this example, an @filepath{info.ss} file can use @hash-lang[] notation, but only with the @schememodname[setup/infotab] language. +@;{ The @scheme[name] tag is required for @exec{setup-plt} to recognize the collection and compile its files to bytecode. Similarly, an @filepath{info.ss} file in a sub-directory of a collection causes the sub-directory's files to be compiled. +;} See also @scheme[get-info] from @schememodname[setup/getinfo]. - diff --git a/collects/scribblings/setup-plt/setup-plt.scrbl b/collects/scribblings/setup-plt/setup-plt.scrbl index b9a19f4016..d2f9534b2d 100644 --- a/collects/scribblings/setup-plt/setup-plt.scrbl +++ b/collects/scribblings/setup-plt/setup-plt.scrbl @@ -100,6 +100,16 @@ accepted by the @|setup-plt| executable. @subsection{Compiling and Setting Up All Collections} +The @|setup-plt| executable attempts to compile and set up all +collections (all directories in the collects hierarchy). Some +collections are not really libraries (e.g., the @filepath{icons} +collection); this is fine since nothing is done when there are no +source files in the directory. + +Collections are compiled using the @scheme[compile-collection-zos] +procedure. + +@;{ The @|setup-plt| executable attempts to compile and set up any collection that: @@ -118,6 +128,7 @@ Collections that meet this criteria are compiled using the @scheme[compile-collection-zos] procedure (which means that even if a collection has no @filepath{info.ss} file, its modules will get compiled if they are used by other compiled modules). +;} @; ------------------------------------------------------------------------ @@ -144,7 +155,7 @@ Optional @filepath{info.ss} fields trigger additional setup actions: of the @filepath{info.ss} file. In addition, - + @schemeblock[ (build-aux-from-path (build-path (collection-path #,(nonterm "colls") _...) #,(nonterm "suffixless-file"))) @@ -161,10 +172,7 @@ Optional @filepath{info.ss} fields trigger additional setup actions: @scheme[mzscheme-launcher-libraries], then the flags will override the libraries, but the libraries can still be used to specify a name for @scheme[build-aux-from-path] (to find related information - like icon files etc). - - If @scheme[compile-subcollections] mentions a subcollection with - this field, the executable is also set up for that subcollection.} + like icon files etc).} @item{@scheme[mzscheme-launcher-libraries] : @scheme[(listof path-string?)] --- A list of library names in parallel to diff --git a/collects/setup/info.ss b/collects/setup/info.ss index a1e2930ed0..42a72f4d23 100644 --- a/collects/setup/info.ss +++ b/collects/setup/info.ss @@ -2,7 +2,7 @@ (define name "Setup PLT") -(define compile-omit-files '("main.ss")) +(define compile-omit-paths '("main.ss")) (define mzscheme-launcher-libraries '("main.ss")) (define mzscheme-launcher-names '("Setup PLT")) diff --git a/collects/setup/setup-unit.ss b/collects/setup/setup-unit.ss index 698baa5f23..eebc766b17 100644 --- a/collects/setup/setup-unit.ss +++ b/collects/setup/setup-unit.ss @@ -11,6 +11,7 @@ scheme/port scheme/match scheme/system + scheme/list planet/planet-archives planet/private/planet-shared @@ -25,6 +26,16 @@ (define-namespace-anchor anchor) +;; read info files without compiling them +(define getinfo + (let ([ns (namespace-anchor->empty-namespace anchor)] + [compile (current-compile)]) + (lambda (path) + (parameterize ([current-namespace ns] + [current-compile compile] + [use-compiled-file-paths '()]) + (get-info/full path))))) + (provide setup@) (define-unit setup@ @@ -66,9 +77,7 @@ (setup-printf " ~a" (path->string p))) (define (call-info info flag mk-default test) - (if info - (let ([v (info flag mk-default)]) (test v) v) - (mk-default))) + (let ([v (info flag mk-default)]) (test v) v)) (define mode-dir (if (compile-mode) @@ -94,10 +103,7 @@ (for ([e (reverse errors)]) (match-let ([(list cc desc x) e]) (setup-fprintf port "Error during ~a for ~a" - desc - (if (cc? cc) - (format "~a (~a)" (cc-name cc) (cc-path cc)) - cc)) + desc (if (cc? cc) (cc-name cc) cc)) (setup-fprintf port " ~a" (exn->string x))))) (define (done) @@ -150,43 +156,55 @@ (collection path name info root-dir info-path shadowing-policy) #:inspector #f) + (define (make-cc* collection path root-dir info-path shadowing-policy) + (define info + (or (with-handlers ([exn:fail? (warning-handler #f)]) (getinfo path)) + (lambda (flag mk-default) (mk-default)))) + (define name + (call-info + info 'name (lambda () #f) + (lambda (x) + (when (and x (not (string? x))) + (error 'setup-plt + "'name' result from collection ~e is not a string: ~e" + path x))))) + (define path-string (path->string path)) + (define basename + (let-values ([(base name dir?) (split-path path)]) + (if (path? name) + (path-element->string name) + (error 'make-cc* + "Internal error: cc had invalid info-path: ~e" path)))) + (when (info 'compile-subcollections (lambda () #f)) + (setup-printf "Warning: ignoring `compile-subcollections' entry in info ~a\n" + path)) + ;; this check is also done in compiler/compiler-unit, in compile-directory + (and (not (or (regexp-match? #rx"^[.]" basename) (equal? "compiled" basename) + (eq? 'all (info 'compile-omit-paths void)))) + (make-cc collection path + (if name (string-append path-string " (" name ")") path-string) + info root-dir info-path shadowing-policy))) + (define ((warning-handler v) exn) (setup-printf "Warning: ~a" (exn->string exn)) v) - ;; collection->cc : listof path -> cc + ;; collection->cc : listof path -> cc/#f (define (collection->cc collection-p) - (let* ([root-dir (ormap (lambda (p) - (parameterize ([current-library-collection-paths - (list p)]) - (and (with-handlers ([exn:fail? (lambda (x) #f)]) - (apply collection-path collection-p)) - p))) - (current-library-collection-paths))] - [info (with-handlers ([exn:fail? (warning-handler #f)]) - (get-info collection-p))] - [name (call-info info 'name (lambda () #f) - (lambda (x) - (when (and x (not (string? x))) - (error - 'setup-plt - "'name' result from collection ~e is not a string: ~e" - collection-p - x))))] - [name (string-append (path->string (apply build-path collection-p)) - (if name - (string-append " (" name ")") - ""))]) - (and info - (make-cc collection-p - (apply collection-path collection-p) - name - info - root-dir - (build-path root-dir "info-domain" "compiled" "cache.ss") - ;; by convention, all collections have "version" 1 0. This - ;; forces them to conflict with each other. - (list (cons 'lib (map path->string collection-p)) 1 0))))) + (let ([root-dir + (ormap (lambda (p) + (parameterize ([current-library-collection-paths (list p)]) + (and (with-handlers ([exn:fail? (lambda (x) #f)]) + (apply collection-path collection-p)) + p))) + (current-library-collection-paths))]) + (make-cc* collection-p + (apply collection-path collection-p) + root-dir + (build-path root-dir "info-domain" "compiled" "cache.ss") + ;; by convention, all collections have "version" 1 0. This + ;; forces them to conflict with each other. + (list (cons 'lib (map path->string collection-p)) 1 0)))) ;; remove-falses : listof (union X #f) -> listof X ;; returns the non-false elements of l in order @@ -213,24 +231,11 @@ (define (planet->cc path owner pkg-file extra-path maj min) (unless (path? path) (error 'planet->cc "non-path when building package ~e" pkg-file)) - (let/ec return - (let* ([info (with-handlers ([exn:fail? (warning-handler #f)]) - (get-info/full path))] - [name (call-info info 'name (lambda () (return #f)) - (lambda (x) - (when (and x (not (string? x))) - (error - 'planet->cc - "'name' result from directory ~e is not a string: ~e" - path - x))))]) - (make-cc #f - path - name - info - #f ; don't need root-dir; absolute paths in cache.ss will be ok - (get-planet-cache-path) - (list `(planet ,owner ,pkg-file ,@extra-path) maj min))))) + (make-cc* #f + path + #f ; don't need root-dir; absolute paths in cache.ss will be ok + (get-planet-cache-path) + (list `(planet ,owner ,pkg-file ,@extra-path) maj min))) ;; planet-cc->sub-cc : cc (listof bytes [encoded path]) -> cc ;; builds a compilation job for the given subdirectory of the given cc this @@ -245,10 +250,6 @@ maj min))) - (define (cannot-compile c) - (error 'setup-plt "don't know how to compile collection: ~a" - (if (= (length c) 1) (car c) c))) - (define planet-dirs-to-compile (if (make-planet) (remove-falses (map (lambda (spec) (apply planet->cc spec)) @@ -271,107 +272,124 @@ (hash-table-map ht (lambda (k v) v)))) ;; Close over sub-collections - (define (collection-closure collections-to-compile) - (let loop ([l collections-to-compile]) - (if (null? l) - null - (let* ([cc (car l)] - [info (cc-info cc)]) - (append - (map - (lambda (subcol) - (or (collection->cc (map string->path subcol)) - (cannot-compile subcol))) - (call-info info 'compile-subcollections - ;; Default: subdirs with info.ss files - (lambda () - (map (lambda (x) - (map path->string (append (cc-collection cc) (list x)))) - (filter (lambda (p) - (let ([d (build-path (cc-path cc) p)]) - (and (directory-exists? d) - (file-exists? (build-path d "info.ss"))))) - (directory-list (cc-path cc))))) - ;; Result checker: - (lambda (x) - (unless (list-of (list-of relative-path-string?) x) - (error "result is not a list of relative path string lists:" - x))))) - (list cc) - (loop (cdr l))))))) + (define (collection-closure collections-to-compile make-subs) + (define (get-subs cc) + (let* ([info (cc-info cc)] + [ccp (cc-path cc)] + ;; note: `compile-omit-paths' can be the symbol `all', if this + ;; happens then this collection should not have been included in + ;; the first place, but we might jump in if a command-line + ;; argument specifies coll/subcoll + [omit (call-info info 'compile-omit-paths (lambda () '()) + (lambda (x) + (unless (or (eq? 'all x) (list-of string? x)) + (error 'setup-plt + "expected a list of path strings or 'all for compile-omit-paths, got: ~s" + x))))] + [omit (if (pair? omit) omit '())] + [subs (filter (lambda (p) + (and (directory-exists? (build-path ccp p)) + (not (member (path->string p) omit)))) + (directory-list ccp))]) + (remove-falses (make-subs cc subs)))) + (remove-falses + (let loop ([l collections-to-compile]) + (apply append (map (lambda (cc) (cons cc (loop (get-subs cc)))) l))))) - (define (same-collection-name? cc-1 cc-2) - (let ([split (lambda (cc) - (apply append - (map (lambda (e) - (if (path? e) - (map path-element->string (explode-path e)) - (regexp-split #rx"/" e))) - (cc-collection cc))))]) - (equal? (split cc-1) (split cc-2)))) + (define (plt-collection-closure collections-to-compile) + (collection-closure + collections-to-compile + (lambda (cc subs) + (map (lambda (sub) + (collection->cc (append (cc-collection cc) (list sub)))) + subs)))) (define (check-again-all given-ccs) - (define all-collections* (collection-closure all-collections)) + #| + ;; This code is better than using marker files, but an older version of it + ;; relied on the obligatory existence of an "info.ss" file. That is no + ;; longer required, so it needs to identify directories and that is + ;; currently not available. So use the code below instead. + (define all-cc+ids + (map (lambda (cc) + (cons cc (file-or-directory-identity (cc-path cc)))) + (plt-collection-closure all-collections))) (for ([cc given-ccs]) - (call-with-input-file* (build-path (cc-path cc) "info.ss") - (lambda (given-info-port) - (define given-id (port-file-identity given-info-port)) - (for ([found-cc all-collections*] - #:when (not (same-collection-name? cc found-cc))) - (call-with-input-file* (build-path (cc-path found-cc) "info.ss") - (lambda (found-info-port) - (when (eq? (port-file-identity found-info-port) given-id) - (error 'setup-plt - "given collection path: ~e refers to the same info file as another path: ~e" - (apply build-path (cc-collection cc)) - (apply build-path (cc-collection found-cc)))))))))) - given-ccs) + (define given-id + (file-or-directory-identity (cc-path cc))) + (for ([found-cc+id all-cc+ids] + #:when (not (same-collection-name? cc (car found-cc+id)))) + (when (eq? (cdr found-cc+id) given-id) + (error 'setup-plt + "given collection path: ~e refers to the same info file as another path: ~e" + (apply build-path (cc-collection cc)) + (apply build-path (cc-collection (car found-cc+id))))))) + |# + ;; Note: this is not a locking mechanism; specifically, if we find a marker + ;; file we assume that we generated it rather than another setup-plt + ;; process + (define all-ccs (plt-collection-closure all-collections)) + (define (cc->name cc) (apply build-path (cc-collection cc))) + (define all-names (map cc->name all-ccs)) + (define given-names (map cc->name given-ccs)) + (define (cc-mark cc) (build-path (cc-path cc) ".setup-plt-marker")) + ;; For cleanup: try to remove all files, be silent + (define (cleanup) + (for ([cc (append given-ccs all-ccs)]) + (let ([mark (cc-mark cc)]) + (when (file-exists? mark) + (with-handlers ([void void]) (delete-file mark)))))) + ;; First remove all marker files if any, let it fail if we can't remove it + (define (remove-markers) + (for ([cc given-ccs]) + (let ([mark (cc-mark cc)]) + (when (file-exists? mark) + (setup-printf "Warning: found a marker file, deleting: ~a" + (cc-mark cc)) + (delete-file mark))))) + ;; Now create all marker files, signalling an error if duplicate + (define (put-markers) + (for ([cc given-ccs] [name given-names]) + (let ([mark (cc-mark cc)]) + (if (file-exists? mark) + (error 'setup-plt + "given collection path: ~e refers to the same directory as another given collection path" + name) + (with-output-to-file mark (lambda () (printf "~a\n" name))))))) + ;; Finally scan all ccs and look for duplicates + (define (scan-all) + (for ([cc all-ccs] [name all-names]) + (when (and (not (member name given-names)) + (file-exists? (cc-mark cc))) + (let ([given (with-input-from-file (cc-mark cc) read-line)]) + (error 'setup-plt + "given collection path: ~e refers to the same directory as another given collection path" + name))))) + (dynamic-wind + void + (lambda () (remove-markers) (put-markers) (scan-all) given-ccs) + cleanup)) + + (define (sort-collections ccs) + (sort ccs (lambda (a b) (stringcc (map string->path c)) - (cannot-compile c))) - x-specific-collections))) - (lambda (a b) (string-cicc (map string->path c))) + x-specific-collections))))))) (set! planet-dirs-to-compile - (let loop ([l planet-dirs-to-compile]) - (if (null? l) - null - (let* ([cc (car l)] - [info (cc-info cc)]) - (append - (remove-falses - (map - (lambda (p) - (planet-cc->sub-cc - cc - (cond - [(path? p) (list (path->bytes p))] - [(list-of bytes? p) p] - [else (map (λ (s) (path->bytes (string->path s))) p)]))) - (call-info info 'compile-subcollections - (lambda () - (map (λ (p) (list (path->bytes p))) - (filter - (lambda (p) - (let ((d (build-path (cc-path cc) p))) - (and (directory-exists? d) - (file-exists? (build-path d "info.ss"))))) - (directory-list (cc-path cc))))) - ;; Result checker: - (λ (p) - (match p - [(list (list (? (λ (v) (or (string? v) (bytes? v)))) ...) ...) - (void)] - [_ (error "result is not a list of lists of strings: " p)]))))) - (list cc) - (loop (cdr l))))))) + (sort-collections + (collection-closure + planet-dirs-to-compile + (lambda (cc subs) + (map (lambda (p) (planet-cc->sub-cc cc (list (path->bytes p)))) + subs))))) (define ccs-to-compile (append collections-to-compile planet-dirs-to-compile)) @@ -442,10 +460,12 @@ (lambda () (list mode-dir (build-path mode-dir "native") - (build-path mode-dir "native" (system-library-subpath)))) + (build-path mode-dir "native" + (system-library-subpath)))) (lambda (x) (unless (list-of path-string? x) - (error 'setup-plt "expected a list of path strings for 'clean, got: ~s" + (error 'setup-plt + "expected a list of path strings for 'clean, got: ~s" x))))] [printed? #f] [print-message @@ -724,7 +744,9 @@ (unless (equal? ht (hash-table-get ht-orig info-path)) (let-values ([(base name must-be-dir?) (split-path info-path)]) (unless (path? base) - (error 'make-info-domain "Internal error: cc had invalid info-path: ~s" info-path)) + (error 'make-info-domain + "Internal error: cc had invalid info-path: ~e" + info-path)) (make-directory* base) (let ([p info-path]) (setup-printf "Updating ~a" p) diff --git a/collects/sgl/info.ss b/collects/sgl/info.ss index 40cb64e3d4..5b64a3e521 100644 --- a/collects/sgl/info.ss +++ b/collects/sgl/info.ss @@ -1,7 +1,7 @@ #lang setup/infotab (define pre-install-collection "makefile.ss") -(define compile-omit-files (list)) (define virtual-sources '("gl-info.ss")) (define clean (list (build-path "compiled" "native" (system-library-subpath)) "compiled")) +(define compile-omit-paths '("examples")) diff --git a/collects/sirmail/info.ss b/collects/sirmail/info.ss index 311011bdd4..bd1bf4cbe1 100644 --- a/collects/sirmail/info.ss +++ b/collects/sirmail/info.ss @@ -2,5 +2,5 @@ (define mred-launcher-libraries (list "sirmail.ss")) (define mred-launcher-names (list "SirMail")) -(define compile-omit-files '("recover.ss")) +(define compile-omit-paths '("recover.ss")) (define requires '(("mred") ("openssl"))) diff --git a/collects/slideshow/info.ss b/collects/slideshow/info.ss index d81c650404..b15ab16381 100644 --- a/collects/slideshow/info.ss +++ b/collects/slideshow/info.ss @@ -6,4 +6,4 @@ (define tool-urls (list "http://www.plt-scheme.org/software/slideshow/")) (define mred-launcher-libraries (list "start.ss")) (define mred-launcher-names (list "Slideshow")) -(define compile-omit-files (list "initial-ones.ss" "pict-snipclass.ss")) +(define compile-omit-paths '("initial-ones.ss" "pict-snipclass.ss" "examples")) diff --git a/collects/srfi/1/info.ss b/collects/srfi/1/info.ss index 397716286f..6b18593b27 100644 --- a/collects/srfi/1/info.ss +++ b/collects/srfi/1/info.ss @@ -1,6 +1,6 @@ #lang setup/infotab -(define compile-omit-files +(define compile-omit-paths '("alist-test.ss" "all-srfi-1-tests.ss" "cons-test.ss" diff --git a/collects/srfi/19/info.ss b/collects/srfi/19/info.ss index daff9302e9..359f965f3a 100644 --- a/collects/srfi/19/info.ss +++ b/collects/srfi/19/info.ss @@ -1,3 +1,3 @@ #lang setup/infotab -(define compile-omit-files `("tests.ss")) +(define compile-omit-paths `("tests.ss")) diff --git a/collects/srfi/25/info.ss b/collects/srfi/25/info.ss new file mode 100644 index 0000000000..8b67620245 --- /dev/null +++ b/collects/srfi/25/info.ss @@ -0,0 +1,3 @@ +#lang setup/infotab + +(define compile-omit-paths '("arlib.scm" "ix-ctor.scm" "op-ctor.scm")) diff --git a/collects/srfi/27/random-bits-examples.ss b/collects/srfi/27/random-bits-examples.ss index e1f3be0bea..46e67ad87c 100644 --- a/collects/srfi/27/random-bits-examples.ss +++ b/collects/srfi/27/random-bits-examples.ss @@ -78,7 +78,7 @@ ; evals expr and issues an error if it is not #t. (define (check expr) - (if (not (eq? (eval expr (interaction-environment)) #t)) + (if (not (eq? (eval expr) #t)) (error "check failed" expr))) ; Basic Tests of the Interface diff --git a/collects/srfi/32/info.ss b/collects/srfi/32/info.ss new file mode 100644 index 0000000000..47278d0d0f --- /dev/null +++ b/collects/srfi/32/info.ss @@ -0,0 +1,3 @@ +#lang setup/infotab + +(define compile-omit-paths '("test.scm")) diff --git a/collects/srfi/67/info.ss b/collects/srfi/67/info.ss new file mode 100644 index 0000000000..ff1f2c5d0f --- /dev/null +++ b/collects/srfi/67/info.ss @@ -0,0 +1,3 @@ +#lang setup/infotab + +(define compile-omit-paths '("compare-reference.scm")) diff --git a/collects/srfi/74/info.ss b/collects/srfi/74/info.ss new file mode 100644 index 0000000000..fa2f47605c --- /dev/null +++ b/collects/srfi/74/info.ss @@ -0,0 +1,3 @@ +#lang setup/infotab + +(define compile-omit-paths '("blob.scm")) diff --git a/collects/srfi/78/info.ss b/collects/srfi/78/info.ss new file mode 100644 index 0000000000..27ab57b1ba --- /dev/null +++ b/collects/srfi/78/info.ss @@ -0,0 +1,3 @@ +#lang setup/infotab + +(define compile-omit-paths '("check-reference.scm" "examples-78.scm")) diff --git a/collects/srfi/info.ss b/collects/srfi/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/srfi/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/srpersist/info.ss b/collects/srpersist/info.ss index f69160d4da..c35fa55e4b 100644 --- a/collects/srpersist/info.ss +++ b/collects/srpersist/info.ss @@ -1,4 +1,4 @@ #lang setup/infotab ;; no .zo compilation necessary, since all the real code is in C++ -(define compile-omit-files '("info.ss" "srpersist.ss" "main.ss")) +(define compile-omit-paths '("info.ss" "srpersist.ss" "main.ss")) diff --git a/collects/stepper/info.ss b/collects/stepper/info.ss index d60e7cd0b7..202ca1181d 100644 --- a/collects/stepper/info.ss +++ b/collects/stepper/info.ss @@ -12,4 +12,4 @@ ;; #f )) -(define compile-omit-files `("debugger-tool.ss")) +(define compile-omit-paths '("debugger-tool.ss")) diff --git a/collects/stepper/private/info.ss b/collects/stepper/private/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/stepper/private/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/teachpack/htdc/info.ss b/collects/teachpack/htdc/info.ss new file mode 100644 index 0000000000..a073420a94 --- /dev/null +++ b/collects/teachpack/htdc/info.ss @@ -0,0 +1,3 @@ +#lang setup/infotab + +(define compile-omit-paths 'all) diff --git a/collects/teachpack/info.ss b/collects/teachpack/info.ss index 072da247e8..bf8edbc3fb 100644 --- a/collects/teachpack/info.ss +++ b/collects/teachpack/info.ss @@ -1,4 +1,3 @@ #lang setup/infotab (define scribblings '(("teachpacks.scrbl" (multi-page)))) -(define compile-omit-files '()) diff --git a/collects/tests/drscheme/info.ss b/collects/tests/drscheme/info.ss index a02ecd8c3f..fb46d8c739 100644 --- a/collects/tests/drscheme/info.ss +++ b/collects/tests/drscheme/info.ss @@ -1,6 +1,6 @@ #lang setup/infotab -(define compile-omit-files +(define compile-omit-paths '("config-lang-test.ss" "drscheme-jr.ss" "drscheme-test.ss" "event-efficency.ss" ;"language-test.ss" "launcher.ss" diff --git a/collects/tests/framework/info.ss b/collects/tests/framework/info.ss index dec6fde677..e271d9238b 100644 --- a/collects/tests/framework/info.ss +++ b/collects/tests/framework/info.ss @@ -1,3 +1,3 @@ #lang setup/infotab -(define compile-omit-files '("key-specs.ss" "utils.ss" "receive-sexps-port.ss")) +(define compile-omit-paths '("key-specs.ss" "utils.ss" "receive-sexps-port.ss")) diff --git a/collects/tests/info.ss b/collects/tests/info.ss index edb283b8a4..4eabaf1a51 100644 --- a/collects/tests/info.ss +++ b/collects/tests/info.ss @@ -1,9 +1,7 @@ #lang setup/infotab (define name "Test Suites") -(define doc-subcollections '("tester")) -(define compile-subcollections '(("tests" "drscheme") - ("tests" "framework") - ("tests" "utils"))) (define tools '(("tool.ss" "drscheme"))) (define tool-names '("DrScheme Test Suites")) + +(define compile-omit-paths 'all) diff --git a/collects/tests/utils/info.ss b/collects/tests/utils/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/tests/utils/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/texpict/info.ss b/collects/texpict/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/texpict/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/texpict/private/info.ss b/collects/texpict/private/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/texpict/private/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/waterworld/info.ss b/collects/waterworld/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/waterworld/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/web-server/bench/info.ss b/collects/web-server/bench/info.ss new file mode 100644 index 0000000000..a073420a94 --- /dev/null +++ b/collects/web-server/bench/info.ss @@ -0,0 +1,3 @@ +#lang setup/infotab + +(define compile-omit-paths 'all) diff --git a/collects/web-server/info.ss b/collects/web-server/info.ss index 1499a7c53b..9473cef06b 100644 --- a/collects/web-server/info.ss +++ b/collects/web-server/info.ss @@ -5,3 +5,5 @@ (define mzscheme-launcher-libraries '("main.ss")) (define mzscheme-launcher-names '("PLT Web Server")) + +(define compile-omit-paths '("default-web-root")) diff --git a/collects/web-server/scribblings/info.ss b/collects/web-server/scribblings/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/web-server/scribblings/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/web-server/tests/info.ss b/collects/web-server/tests/info.ss new file mode 100644 index 0000000000..a073420a94 --- /dev/null +++ b/collects/web-server/tests/info.ss @@ -0,0 +1,3 @@ +#lang setup/infotab + +(define compile-omit-paths 'all) diff --git a/collects/wxme/info.ss b/collects/wxme/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/wxme/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab diff --git a/collects/xml/private/info.ss b/collects/xml/private/info.ss deleted file mode 100644 index c14a2ca411..0000000000 --- a/collects/xml/private/info.ss +++ /dev/null @@ -1 +0,0 @@ -#lang setup/infotab