# Self-Healing CI: Auto-Installing a Missing Compiler / Build Tool

> A missing compiler (gcc, clang, cc) fails native builds until installed. See the manual fix and how self-healing CI installs it and proposes a durable fix.

Source: https://latchkey.dev/learn/self-healing-ci/self-heal-missing-compiler-toolchain  
Updated: 2026-06-25

When a native build dies because there is no compiler on the runner, the fix is mechanical: install the toolchain - and bake it in so it never recurs.

## What makes a failure safely retryable

Automatic retry is only correct for failures that are genuinely transient. Retrying a deterministic failure wastes minutes and hides a real defect, so the classification matters more than the retry mechanism.

- Safe to retry: network timeouts, registry 5xx, transient DNS failures, a service container that was not ready, a spot instance reclaimed mid-run.
- Not safe to retry: assertion failures, compile errors, lint violations, anything that fails identically on every attempt.
- Ambiguous, and worth investigating rather than retrying: out-of-memory kills, disk exhaustion, and flaky tests. These repeat under load and a retry only hides the trend.
- Always record that a retry happened. A pipeline that silently retries is a pipeline whose real failure rate you do not know.

## FAQ

### What causes Self-Healing CI: Auto-Installing a missing compiler / build tool?

A step that compiles a native extension fails with gcc: command not found, error: command "cc" failed, or a missing C/C++ toolchain. The source is fine; the runner simply lacks a compiler. A human installs the build toolchain and the build passes unchanged.

### How do I fix Self-Healing CI: Auto-Installing a missing compiler / build tool manually?

[object Object]

### Can Self-Healing CI: Auto-Installing a missing compiler / build tool be fixed automatically?

Because the missing tool is named in the error and the remedy is a well-scoped install from a known-safe set, this can be automated safely. A self-healing CI pipeline installs the missing compiler/toolchain, retries the step, and can propose a durable change to your setup so the gap is closed for good - turning a recurring native-build

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
