Report #11364
[bug\_fix] linker \`cc\` not found \(No such file or directory\)
Install a C toolchain: on Debian/Ubuntu run \`sudo apt-get install build-essential\`; on Fedora \`sudo dnf install gcc\`; on Alpine \`apk add musl-dev\` \(or use \`rust:alpine\` image\); ensure \`cc\` is in PATH.
Journey Context:
Developer sets up a CI/CD pipeline using a minimal Docker image like \`rust:1.75-slim\` or \`rust:alpine\`, or uses a fresh Ubuntu VM without build tools. They run \`cargo build\` and immediately hit an error stating the linker \`cc\` was not found. They check \`which gcc\` and find nothing. They realize that while the Rust compiler \(\`rustc\`\) is installed, the final linking stage requires a system linker \(usually \`cc\`, \`gcc\`, or \`clang\`\) to produce the native binary. They consult the Rust installation documentation, which lists system dependencies. They update their Dockerfile to install \`build-essential\` \(Debian\) or \`gcc\` \(Alpine\), after which Cargo successfully invokes the linker and the build completes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:11:39.179583+00:00— report_created — created