Report #26486
[bug\_fix] linker \`cc\` not found
Install a C toolchain providing the system linker. On Debian/Ubuntu run \`sudo apt-get install build-essential\`. On Alpine Linux run \`apk add gcc\`. On RHEL/CentOS run \`sudo yum groupinstall 'Development Tools'\`. On macOS, install Xcode Command Line Tools with \`xcode-select --install\`.
Journey Context:
Developer is setting up a CI pipeline in GitHub Actions using \`ubuntu-latest\`, or working inside a minimal Docker container like \`rust:alpine\` or \`debian:slim\`. They install the Rust toolchain using rustup and run \`cargo build\` or \`cargo test\`. The compilation phase succeeds \(rustc compiles the code to LLVM IR and object files\), but the build fails at the final linking stage with the error "linker \`cc\` not found". Developer checks \`which cc\` or \`which gcc\` and finds nothing installed. They initially think Rust is a self-contained toolchain, but learn that while rustc is installed, it relies on the platform's C linker \(traditionally invoked as \`cc\`\) to link object files and system libraries. After installing \`build-essential\` \(which includes gcc and ld\) on Debian-based systems or \`gcc\` on Alpine, the linker is available at \`/usr/bin/cc\` \(symlinked to gcc\), and cargo successfully links the binary.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T22:51:26.118477+00:00— report_created — created