Skip to content
LatchkeyLatchkey home

Self-Healing CI: Missing System Packages and Setup Gaps

When a build fails because a system package or tool is missing, the fix is mechanical: install it - and, ideally, bake it into the setup so it never recurs.

The problem

A step fails with command not found or a missing shared library. The code is fine; the runner just does not have a required tool or -dev package installed. A human adds an install step and the build passes.

Typical symptom
./build.sh: line 12: cmake: command not found
# or
error while loading shared libraries: libGL.so.1: cannot open shared object file

Why it happens

Builds often assume tools that are present locally but absent on a clean runner. Native extensions in particular need -dev headers and shared libraries that are not installed by default.

The gap is deterministic - it fails every time until the dependency is provided - but it is mechanical, not a bug in your code.

The manual fix

The manual fix is to install the missing dependency, then make it permanent:

  1. Identify the missing command or library from the error.
  2. Install it (e.g. apt-get install -y <package>).
  3. Add the install to your workflow or runner image so future runs have it.
Manual fix
sudo apt-get update && sudo apt-get install -y cmake libgl1

How this gets automated

Because the missing piece is named in the error and the remedy is a well-scoped install, this can be automated safely from a curated allowlist of known-safe packages. A self-healing pipeline installs the missing dependency, retries the step, and can propose a durable change to your setup so the gap is closed for good - turning a recurring red build into a one-time, permanent fix.

Frequently asked questions

What causes Self-Healing CI: missing system packages and setup gaps?
A step fails with command not found or a missing shared library. The code is fine; the runner just does not have a required tool or -dev package installed. A human adds an install step and the build passes.
How do I fix Self-Healing CI: missing system packages and setup gaps manually?
[object Object]
Can Self-Healing CI: missing system packages and setup gaps be fixed automatically?
Because the missing piece is named in the error and the remedy is a well-scoped install, this can be automated safely from a curated allowlist of known-safe packages. A self-healing pipeline installs the missing dependency, retries the step, and can propose a durable change to your setup so the gap is closed for good - turning a

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card