Report #79901
[bug\_fix] linker \`cc\` not found
Install the system C compiler and linker toolchain \(e.g., \`sudo apt install build-essential\` on Debian/Ubuntu, \`sudo pacman -S base-devel\` on Arch, or \`xcode-select --install\` on macOS\).
Journey Context:
You are setting up a CI/CD pipeline using a minimal Docker image like \`ubuntu:22.04\` or \`rust:1.75-slim\`. You install Rust via rustup and run \`cargo new --bin app && cd app && cargo build\`. Immediately, you see an error: 'linker \`cc\` not found'. You are confused because you thought Rust was self-contained. You investigate and learn that \`rustc\` compiles Rust code to LLVM IR, which then needs to be linked into machine code. On Unix systems, Rust invokes the system linker \(traditionally called \`cc\`, which is a symlink to \`gcc\` or \`clang\`\) to perform this final linking step against \`libc\` and other system libraries. Your minimal Docker image lacks these build tools. You install \`build-essential\` \(Debian/Ubuntu\) or \`gcc\` \(Alpine\). After installation, \`cargo build\` succeeds. You understand that Rust has a dependency on a native toolchain for linking, even when not using any C libraries directly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:42:44.600790+00:00— report_created — created