To compile a collection’s files to bytecode, raco setup uses the compile-collection-zos procedure. That procedure, in turn, consults the collection’s "info.rkt" file, if it exists, for specific instructions on compiling the collection. See compile-collection-zos for more information on the fields of "info.rkt" that it uses, and see "info.rkt" File Format for information on the format of an "info.rkt" file.
Optional "info.rkt" fields trigger additional actions by raco setup:
scribblings : (listof (cons/c string? list?)) —
A list of documents to build. Each document in the list is itself represented as a list, where each document’s list starts with a string that is a collection-relative path to the document’s source file. A directory for pre-rendered documentation is computed from the source file name by starting with the directory of the "info.rkt" file, adding "doc", and then using the source file’s name without a suffix; if such a directory exists and does not have a "synced.rktd" file, then it is treated as pre-rendered documentation and moved into place, in which case the documentation source file need not be present. (Moving documentation into place may require no movement at all, depending on the way that the enclosing collection is installed, but movement includes adding a "synced.rktd" file to represent the installation.)
More precisely a scribblings entry must be a value that can be generated from an expression matching the following entry grammar:
entry = (list doc ...) doc = (list src-string) | (list src-string flags) | (list src-string flags category) | (list src-string flags category name) | (list src-string flags category name out-k) | (list src-string flags category name out-k order-n) flags = (list mode-symbol ...) category = (list category-symbol) | (list category-symbol sort-number) name = string | #f
A document’s list optionally continues with information on how to build the document. If a document’s list contains a second item, flags, it must be a list of mode symbols (described below). If a document’s list contains a third item, category, it must be a list that categorizes the document (described further below). If a document’s list contains a fourth item, name, it is a name to use for the generated documentation, instead of defaulting to the source file’s name (sans extension), where #f means to use the default. If a document’s list contains a fifth item, out-k, it is used a hint for the number of files to use for the document’s cross-reference information; see below. If a document’s list contains a fourth item, order-n, it is used a hint for the order of rendering; see below.
Each mode symbol in flags can be one of the following, where only 'multi-page is commonly used:
'multi-page : Generates multi-page HTML output, instead of the default single-page format.
'main-doc : Indicates that the generated documentation should be written into the main installation directory, instead of to a user-specific directory. This mode is the default for a collection that is itself located in the main installation.
'user-doc : Indicates that the generated documentation should be written a user-specific directory. This mode is the default for a collection that is not itself located in the main installation.
'depends-all : Indicates that the document should be re-built if any other document is rebuilt—
except for documents that have the 'no-depend-on mode.
'depends-all-main : Indicates that the document should be re-built if any other document is rebuilt that is installed into the main installation—
except for documents that have the 'no-depend-on mode.
'depends-all-user : Indicates that the document should be re-built if any other document is rebuilt that is installed into the user’s space—
except for documents that have the 'no-depend-on mode.
'always-run : Build the document every time that raco setup is run, even if none of its dependencies change.
'no-depend-on : Removes the document for consideration for other dependencies. Furthermore, references from the document to other documents are always direct, instead of potentially indirect (i.e., resolved at document-viewing time and potentially redirected to a remote site).
'main-doc-root : Designates the root document for the main installation. The document that currently has this mode should be the only one with the mode.
'user-doc-root : Designates the root document for the user-specific documentation directory. The document that currently has this mode should be the only one with the mode.
The category list specifies how to show the document in the root table of contents. The list must start with a symbol, usually one of the following categories, which are ordered as below in the root documentation page:
'getting-started : High-level, introductory documentation, typeset at the same level as other category titles.
'language : Documentation for a prominent programming language.
'tool : Documentation for an executable.
'gui-library : Documentation for GUI and graphics libraries.
'net-library : Documentation for networking libraries.
'parsing-library : Documentation for parsing libraries.
'tool-library : Documentation for programming-tool libraries (i.e., not important enough for the more prominent 'tool category).
'interop : Documentation for interoperability tools and libraries.
'library : Documentation for libraries; this category is the default and used for unrecognized category symbols.
'legacy : Documentation for deprecated libraries, languages, and tools.
'experimental : Documentation for an experimental language or library.
'other : Other documentation.
'omit : Documentation that should not be listed on the root page.
If the category list has a second element, it must be a real number that designates the manual’s sorting position with the category; manuals with the same sorting position are ordered alphabetically. For a pair of manuals with sorting numbers n and m, the groups for the manuals are separated by space if (truncate (/ n 10))and (truncate (/ m 10)) are different.
The out-k specification is a hint on whether to break the document’s cross-reference information into multiple parts, which can reduce the time and memory use for resolving a cross-reference into the document. It must be a positive, exact integer, and the default is 1.
The order-n specification is a hint for ordering document builds, since documentation references can be mutually recursive. The order hint can be any real number. A value of -10 or less disables running the document in parallel to other documents. The main Racket reference is given a value of -11, the search page is given a value of 10, and the default is 0.
release-note-files : (listof (cons/c string? (cons/c string? list?))) —
A list of release-notes text files to link from the main documentation pages. Each note is itself represented as a list, and the list can specify auxiliary notes that are grouped with the main note.
A release-note-files entry must be a value that can be generated from an expression matching the following entry grammar:
entry = (list note ...) doc = (list label-string note-path) | (list label-string note-path order-integer) | (list label-string note-path order-integer (list sub-note ...)) sub-note = (list label-string note-path)
The order-integer is used to order notes and defaults to 0.
racket-launcher-names : (listof string?) —
A list of executable names to be generated in the installation’s executable directory to run Racket-based programs implemented by the collection. A parallel list of library names must be provided by racket-launcher-libraries or racket-launcher-flags.
For each name, a launching executable is set up using make-racket-launcher. The arguments are -l- and ‹colls›/.../‹file›, where ‹file› is the file named by racket-launcher-libraries and ‹colls›/... are the collections (and subcollections) of the "info.rkt" file.
(build-aux-from-path (build-path (collection-path ‹colls› ...) ‹suffixless-file›))
is provided for the optional aux argument (for icons, etc.) to make-racket-launcher, where ‹suffixless-file› is ‹file› without its suffix.
If racket-launcher-flags is provided, it is used as a list of command-line arguments passed to racket instead of the above default, allowing arbitrary command-line arguments. If racket-launcher-flags is specified together with racket-launcher-libraries, then the flags will override the libraries, but the libraries can still be used to specify a name for build-aux-from-path (to find related information like icon files etc).
gracket-launcher-names : (listof string?) —
Like racket-launcher-names, but for GRacket-based executables. The launcher-name list is treated in parallel to gracket-launcher-libraries and gracket-launcher-flags.
copy-foreign-libs : (listof (and/c path-string? relative-path?)) —
Files to copy into a directory where foreign libraries are found by ffi-lib. If install-platform is defined, then the files are copied only if the current platform matches the definition.
copy-shared-files : (listof (and/c path-string? relative-path?)) —
Files to copy into a directory where shared files are found. If install-platform is defined, then the files are copied only if the current platform matches the definition.
copy-man-pages : (listof (and/c path-string? relative-path? filename-extension)) —
Files to copy into a man directory. The file suffix determines its category; for example, .1 should be used for a man page describing an executable.
move-man-pages : (listof (and/c path-string? relative-path? filename-extension)) —
Like copy-man-pages, but the original file is removed after it is copied (which makes sense for precompiled packages).
install-platform : (or/c regexp? string? symbol?) —
Determines whether files are copied or moved for copy-foreign-libs, move-foreign-libs, copy-shared-files, or move-shared-files. If install-platform is defined as a regexp, then files are copied/moved only if the regexp matches the result of (system-library-subpath #f). If install-platform is defined as a string, then files are copied/moved only if the (path->string (system-library-subpath #f)) produces the same string. If install-platform is defined as a symbol, then files are copied/moved only if the (system-type) produces the same symbol.
install-collection : path-string? —
A library module relative to the collection that provides installer. The installer procedure accepts one to three arguments. The first argument is a directory path to the parent of the Racket installation’s "collects" directory; the second argument, if accepted, is a path to the collection’s own directory; the third argument, if accepted, is a boolean indicating whether the collection is installed as user-specific (#f) or installation-wide (#f). The procedure should perform collection-specific installation work, and it should avoid unnecessary work in the case that it is called multiple times for the same installation.
pre-install-collection : path-string? —
Like install-collection, except that the corresponding installer is called before the normal ".zo" build, instead of after. The provided procedure should be named pre-installer in this case, so it can be provided by the same file that provides an installer.
post-install-collection : path-string? —
Like install-collection. It is called right after the install-collection procedure is executed. The only difference between these is that the --no-install flag can be used to disable the previous two installers, but not this one. It is therefore expected to perform operations that are always needed, even after an installation that contains pre-compiled files. The provided procedure should be named post-installer in this case, so it can be provided by the same file that provides the previous two.
assume-virtual-sources : any/c —
A true value indicates that bytecode files without a corresponding source file should not be removed from "compiled" directories, and no files should not be removed when the --clean or -c flag is passed to raco setup.
clean : (listof path-string?) —
A list of pathnames to be deleted when the --clean or -c flag is passed to raco setup. The pathnames must be relative to the collection. If any path names a directory, each of the files in the directory are deleted, but none of the subdirectories of the directory are checked. If the path names a file, the file is deleted. The default, if this flag is not specified, is to delete all files in the "compiled" subdirectory, and all of the files in the platform-specific subdirectory of the compiled directory for the current platform.
Just as compiling ".zo" files will compile each module used by a compiled module, deleting a module’s compiled image will delete the ".zo" of each module that is used by the module. More specifically, used modules are determined when deleting a ".dep" file, which would have been created to accompany a ".zo" file when the ".zo" was built by raco setup. If the ".dep" file indicates another module, that module’s ".zo" is deleted only if it also has an accompanying ".dep" file. In that case, the ".dep" file is deleted, and additional used modules are deleted based on the used module’s ".dep" file, etc. Supplying a specific list of collections to raco setup disables this dependency-based deletion of compiled files.