Report #15316
[bug\_fix] linking with \`cc\` failed: exit status: 1
Install the required system development packages \(e.g., \`libssl-dev\` and \`pkg-config\` on Debian/Ubuntu, \`openssl-devel\` on RHEL\) so the linker can find native libraries. Alternatively, enable the \`vendored\` feature on the relevant \`-sys\` crate \(e.g., \`openssl\`\) to statically link a bundled copy of the C library.
Journey Context:
A developer clones a Rust project using \`reqwest\` with native-tls or \`diesel\` with PostgreSQL support onto a fresh Linux machine, CI runner, or minimal Docker container \(like \`rust:slim\`\). They run \`cargo build\`. After compiling all Rust dependencies, the build fails with a massive linker error from \`cc\` mentioning \`undefined reference to SSL\_CTX\_new\` or \`cannot find -lssl\`. The developer initially thinks Rust is broken. They search the specific error and find GitHub issues on \`rust-openssl\`. The solution is either installing system packages \(\`apt install libssl-dev pkg-config\`\) or switching to the \`vendored\` feature in their \`Cargo.toml\` to avoid the system dependency entirely, which is preferred for portability in containers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:46:56.499522+00:00— report_created — created