1 Checking Systems
dxtr edited this page 2026-10-16 07:53:03 +02:00

Checking Systems

The stiftfiles say which projects a project requires, not which systems its systems need: that is in its .asd files, which are code, so stift cannot read it the way Go reads imports. stift check finds it by running ASDF.

stift check               # in SBCL
stift check --lisp ccl    # in CCL

What it does

  1. It works out the build list, as stift exec does, fetching the commits the cache lacks, and starts the Lisp with the build list set up.
  2. In that Lisp, it loads every .asd file of the main projects: the project, or every member of the workspace.
  3. From each system those files define, test systems included, it follows ASDF's depends-on and defsystem-depends-on, and from each system those need, until nothing new appears.

Running ASDF, rather than reading .asd files as text, also follows package-inferred systems, whose dependencies are in their source files' package forms.

Dependencies under (:feature ...) are followed whatever the platform, as ASDF keeps them as written: a Windows-only dependency is checked on Linux too. #+ in an .asd file is settled as the file is read, on this platform only, so run check on each platform, as CI does.

check changes nothing.

What it reports

Missing systems. A system no project of the build list provides, with the systems that need it:

The system "trivial-indent", which "documentation-utils" depends on, is in no project of the build list.
stift cannot know where a system lives: add the repository that provides each that is missing with stift get URL.

With no index of projects, stift cannot know where a system lives, so you name the repository with stift get URL. A system needed only under (:feature ...) says so: which "app" depends on only with :windows.

Indirect projects used directly. A system of a main project that uses a project its stiftfile requires only as an :indirect entry. Such an entry stays only while a project it requires needs it, so tidy may drop it: require the project itself, with stift get URL.

Projects a stiftfile lacks. In a workspace, a member's system may use a project the workspace's build list holds, but the member's own stiftfile does not require. Without the workspace, the member would not build.

Requirements nothing reaches. A requirement of a main project, not :indirect, on a project none of whose systems the main project's systems need, on this platform. It may be left over, or needed on another platform through #+.

What cannot be loaded. An .asd file, or a system, whose loading signals an error, with the error's message. A defsystem-depends-on on a missing system is reported as a missing system instead.

Exit status

check exits with 1 when a build would fail: a missing system, a project a stiftfile lacks, or what cannot be loaded. Indirect projects used directly and requirements nothing reaches are advice: with only those, it exits with 0. With nothing to report, it says:

The build list holds every system the systems need.

From Lisp

stift:check-systems takes :lisp, :directory and :settings, and returns a list of finding objects, whose finding-kind is :missing, :unrequired, :indirect, :unreached or :unloadable; see the API Reference.