valis / Reference / API reference
Main - API reference
Exported surface for the main subsystem. Part of the API reference.
Package valis/src/main
Functions
main
(main &rest args)
Main entry point. Dispatches on command-line arguments. When invoked as the saved image's toplevel, ARGS is empty (SBCL calls the toplevel with no Lisp arguments), so fall back to the process command line. The build saves with :save-runtime-options t, so SBCL passes flags like –version straight through instead of intercepting them itself.
–resident is the steered production boot: it consumes –control-socket <path> and –ports <set> (value args) and fails closed on either being absent or a malformed port, so an incomplete launcher invocation refuses rather than binding a default port. –daemon stays a harmless no-op; –run (foreground loopback) and –dev are unchanged.
open-development-image-configuration
(open-development-image-configuration)
Install the node's configuration under the data root, read-only, as this image's store, and return it, or NIL when the data root holds none. A development image loads valis without booting a node, so nothing else opens the store there. The store is read-only so the image never holds the lock a node beside it needs. The image holds the configuration as the file stood when a setting was first read.
stamp-build-commit
(stamp-build-commit)
Set COMMIT from the source tree valis was compiled from and return it. Builders call this immediately before dumping the image.
try-install-module
(try-install-module designation &key source-root custody revocation-path vouch-path loader)
Ask whether the module DESIGNATION names can be installed into this image, by installing it through install-module, and return (values status message).
The node's stores are read and never written: the vouch store at VOUCH-PATH is decoded into a store held only in memory, which is what admission records into and files a shipped vouch into, and the revocation store at REVOCATION-PATH is only consulted. Either file may be absent, and is then taken as empty. CUSTODY is the node's owner custody, NIL when the node has none. SOURCE-ROOT is the module source root. LOADER is the test seam install-module passes to admission.
STATUS is 0 when the module was admitted and loaded; 2 when no designation was given; 3 when DESIGNATION is not a module designation; 4 when no identity directory under the root holds that module; 5 when it was refused before any of its code ran; 6 when the question could not be asked, because the root or the node state it needs is missing or unusable; and 7 when both signatures admitted it and its load then failed, so some of its code may have run. MESSAGE says which, and why.
try-supersede-module
(try-supersede-module old-designation new-designation &key source-root custody revocation-path vouch-path loader)
Ask whether the module version NEW-DESIGNATION names can supersede the one OLD-DESIGNATION names, by loading the old version into this process as a restart stands it up, and then the new one as an install admits it, and return (values status message phase redefined warnings).
This is the dry run a node asks for before it compiles anything of a new version into itself, because compiling into a running image is already a change to it. It must run in a process of its own, which it then leaves: the node's stores are read and never written, exactly as try-install-module reads them. CUSTODY, SOURCE-ROOT, REVOCATION-PATH, VOUCH-PATH and LOADER are as for try-install-module.
The old version is re-admitted on the credentials and admission time the node recorded for it, as a restart would, so a version the node could no longer stand up is refused here too. The new version goes through install-module, the gate a fresh install passes.
STATUS is 0 when both loaded; 2 when a designation is missing; 3 when one is not a module designation; 4 when no identity directory holds one of them; 5 when a version was refused before any of its code ran; 6 when the question could not be asked; and 7 when a version was admitted and its load failed. PHASE is "old" or "new", the version STATUS is about, or NIL before either was tried. REDEFINED names each definition the new version's load replaced, and WARNINGS holds the text of every warning that load raised that was not a style warning.