Checking for Drift¶
collider check scans meson.build for dependency() calls and compares them
against collider.json. It reports two classes of issues:
- Untracked: a dependency called in
meson.buildthat is not recorded incollider.json. Fix withcollider pkg add <name>. - Stale: a collider-managed entry in
collider.jsonthat no longer appears anywhere inmeson.build. Fix by runningcollider pkg remove <name>.
The command exits 0 when clean and non-zero when drift or a scan error is
detected, making it suitable for CI gates.
Exit Codes¶
0(EX_OK): no drift detected.65(EX_DATAERR): drift detected (untracked or stale entries).66(EX_NOINPUT): nomeson.buildor nocollider.jsonfound in the source directory.70(EX_SOFTWARE):meson.buildcould not be introspected, for example because of a syntax error inmeson.build.
Basic Usage¶
Run from the project root:
Or specify a source directory:
Conditional Dependencies¶
By default, collider check skips dependency() calls inside Meson if-blocks
because their resolution depends on the build configuration. Pass
--include-conditional to treat them as required:
This flag only affects the untracked check. Stale detection always uses the raw
scan of every dependency() call, so a collider.json entry used only inside an
if-block is never flagged stale, regardless of the flag.
Known Limitation¶
collider check assumes the dependency() name in meson.build matches the
collider package name. Packages where these differ (for example, abseil-cpp
provides absl_strings) may produce false positives.
CI Integration¶
Add collider check as a step in CI to prevent dependency drift from going
unnoticed: