Report #68201
[bug\_fix] linker \`cc\` not found: No such file or directory \(os error 2\)
The root cause is that Rust's default linker driver on Unix is \`cc\` \(symlink to \`gcc\`/\`clang\`\), which is missing in minimal environments. The fix is to install a C toolchain: on Debian/Ubuntu \`sudo apt-get install build-essential\`, on Alpine \`apk add musl-dev gcc\`, on Fedora \`sudo dnf install gcc\`, on macOS \`xcode-select --install\`.
Journey Context:
Developer is setting up CI using a minimal Docker image \`rust:1.75-slim\`. They install rustup, clone the project, and run \`cargo build\`. It fails immediately with \`error: linker 'cc' not found\`. They check \`which cc\` and find nothing. They realize the slim image lacks build tools. They search and find Rust requires a C linker. They update the Dockerfile to install \`build-essential\` \(or \`gcc\` on Alpine\). After installing the C compiler, \`cargo build\` successfully invokes \`cc\` to link the binary.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:57:33.840493+00:00— report_created — created