cm.ss: Compilation Manager

To load: (require (lib "cm.ss"))

(make-compilation-manager-load/use-compiled-handler)      PROCEDURE

Returns a procedure suitable as a value for the current-load/use-compiled parameter (see section 7.9.1.6 in PLT MzScheme: Language Manual). The returned procedure passes it arguments on to the current current-load/use-compiled procedure (i.e., the one installed when this procedure is called), but first it automatically compiles source files to a .zo file if

After the handler procedure compiles a .zo file, it creates a corresponding .dep file that lists the current version, plus the .zo timestamp for every file that is required by the module in the compiled file (including require-for-syntaxes and require-for-templates).

The handler caches timestamps when it checks .dep files, and the cache is maintained across calls to the same handler. The cache is not consulted to compare the immediate source file to its .zo file, which means that the caching behavior is consistent with the caching of the default module name resolver (see section 5.4 in PLT MzScheme: Language Manual).

If use-compiled-file-paths contains an empty list when make-compilation-manager-load/use-compiled-handler is called, then exn:fail:contract exception is raised.

Do not install the result of make-compilation-manager-load/use-compiled-handler when the current namespace contains already-loaded versions of modules that may need to be recompiled -- unless the already-loaded modules are never referenced by not-yet-loaded modules. References to already-loaded modules may produce compiled files with inconsistent timestamps and/or .dep files with incorrect information.

(managed-compile-zo file)      PROCEDURE

Compiles the given module source file to a .zo, installing a compilation-manager handler while the file is compiled (so that required modules are also compiled), and creating a .dep file to record the timestamps of immediate files used to compile the source (i.e., files required in the source, including require-for-syntaxes and require-for-templates).

(trust-existing-zos on? [procedure])      

A parameter that is intended for use by Setup PLT when installing with pre-built .zo files. It causes a compilation-manager load/use-compiled handler to ``touch'' out-of-date .zo files instead of re-compiling from source.

(make-caching-managed-compile-zo)      PROCEDURE

Returns a procedure that behaves like managed-compile-zo, but a cache of timestamp information is preserved across calls to the procedure.

(manager-compile-notify-handler [notify-proc])      PROCEDURE

A parameter for a procedure of one argument that is called whenever a compilation starts. The argument to the procedure is the file's path.

(manager-trace-handler [notify-proc])      PROCEDURE

A parameter for a procedure of one argument that is called to report compilation-manager actions, such as checking a file. The argument to the procedure is a string.