Skip to content
Latchkey
Rust

Cargo and toolchain failures in CI - fixed.

Debug Rust CI failures: cargo build and dependency errors, lockfile issues, linker problems, toolchain mismatches, and out-of-memory compilation. Reliable fixes for cargo pipelines.

Cargo & dependencies

Resolution, registry, and lockfile errors.

"the X target may not be installed"Fix cargo build --target failures in CI where the target's standard library is not installed - run `rustup ta… "patch ... was not used"Fix the cargo warning/error "patch for X in the [patch] section was not used in the crate graph" in CI - a [p… "429 Too Many Requests"Fix cargo "failed to download ... 429 Too Many Requests" from crates.io in CI - the registry rate-limited the… "Blocking waiting for file lock"Fix cargo "Blocking waiting for file lock on package cache" stalls in CI -- two cargo processes share a cache… "required for offline mode"Fix cargo "error: failed to download ... but --offline was specified" in CI - a crate isn’t in the local cach… "can't ... in the offline mode"Fix cargo "error: can't find `X` in --offline mode" / "no matching package ... in the offline mode" in CI - a… "checksum for ... did not match"Fix cargo "checksum for `X vN` did not match what is in Cargo.lock" in CI - the artifact or index entry diffe… "could not compile ... due to N previous errors"Fix cargo "error: could not compile `X` (lib) due to N previous errors" in CI - this summary line follows rea… "could not find Cargo.toml"Fix cargo "error: could not find Cargo.toml in <dir> or any parent directory" in CI - the job runs in the wro… "believes it's in a workspace when it's not"Fix cargo "current package believes it's in a workspace when it's not" in CI - a parent Cargo.toml has a work… "cyclic package dependency"Fix cargo "cyclic package dependency" in CI -- two workspace crates depend on each other (often through dev-d… "edition ... requires a newer"Fix cargo "feature `edition2024` is required" / "this version of Cargo is older than the edition" in CI - you… "failed to authenticate when downloading repository"Fix cargo "failed to authenticate when downloading repository" in CI - cargo could not present valid credenti… "failed to authenticate ... repository"Fix cargo "failed to authenticate when downloading repository" for a private git dependency in CI - missing S… "failed to authenticate ... git"Fix cargo "failed to authenticate when downloading repository" for a private git dependency in CI -- no SSH k… "failed to authenticate"Fix cargo "error: failed to authenticate to registry" / 401 from a private registry in CI - a missing or wron… "failed to authenticate (git)"Fix cargo "failed to authenticate when downloading repository" for a private git dependency in CI -- missing… "failed to download: TLS"Fix cargo "failed to download from crates.io" with an SSL/TLS error in CI -- a transient TLS handshake failur… "failed to download"Fix transient cargo "error: failed to download from ..." in CI - a dropped or timed-out crate download from t… "SSL ... download" failureFix cargo registry SSL/TLS errors in CI - "SSL certificate problem" / "could not find native root CA". Instal… "failed to get ... as a dependency"Fix cargo "failed to get X as a dependency of package Y" in CI - a wrapper around an index, download, or git-… "workspace member" missingFix cargo "failed to load manifest for workspace member" / "package ... is not a member of workspace" in CI -… "failed to load source for dependency"Fix cargo "failed to load source for dependency" / source replacement errors in CI - a vendored or mirrored s… "failed to load source"Fix cargo "failed to load source for dependency X" in CI - a misconfigured path, git, or registry source that… "failed to parse manifest"Fix cargo "error: failed to parse manifest at Cargo.toml" in CI - invalid TOML, an unknown key, or a malforme… "failed to parse manifest"Fix cargo "error: failed to parse manifest at Cargo.toml" in CI -- invalid TOML, an unknown key, or a malform… "failed to remove ... Permission denied"Fix cargo "failed to remove file ... Permission denied (os error 13)" in CI - cargo cannot write or clean the… "failed to run rustc to learn"Fix cargo "error: failed to run `rustc` to learn about target-specific information" in CI -- the rustc cargo… "failed to run custom build command for \\`openssl-sys\\`"Fix cargo "failed to run custom build command for `openssl-sys`" in CI - the build script could not find Open… "failed to run custom build command"Fix cargo "error: failed to run custom build command for X" in CI -- a build.rs / -sys build script failed. R… "failed to select a version for the requirement"Fix cargo "failed to select a version for the requirement X" in CI - the resolver found no published version… "failed to select a version"Fix cargo "error: failed to select a version for the requirement" in CI - incompatible version requirements b… "failed to update registry"Fix transient cargo "failed to update registry crates-io" / index fetch errors in CI - network blips fetching… "failed to verify the checksum"Fix cargo "error: failed to verify the checksum of X" in CI - a corrupted download or a stale registry cache.… "failed to write ... Cargo.lock"Fix cargo "failed to write Cargo.lock" / read-only file system in CI -- the workspace is mounted read-only or… "feature \\`edition2024\\` is required"Fix cargo "feature `edition2024` is required" / "this version of Cargo is older than the edition" in CI - the… "feature ... does not exist"Fix cargo "the package does not have these features" / "feature X does not exist" in CI - a renamed, removed,… "rustfmt: would format"Fix "cargo fmt --check" failures in CI -- code that does not match rustfmt's formatting makes the check step… "Found argument ... which wasn't expected"Fix cargo "error: Found argument X which wasn't expected, or isn't valid in this context" in CI - a flag or s… "lock file needs to be updated"Fix cargo "the lock file ... needs to be updated but --frozen was passed" in CI -- Cargo.lock is out of sync… "lock file needs to be updated"Fix cargo "the lock file needs to be updated but --locked was passed" in CI - Cargo.toml changed without rege… "lock file version ... requires ... a newer ... Cargo"Fix cargo "lock file version `4` requires `-Znext-lockfile-bump`" / "this version of Cargo is older" in CI -… "multiple matching crates"Fix cargo "multiple matching crates for `X`" in CI -- two versions or sources of a crate are in the graph and… "two packages named the same"Fix cargo "error: two packages named X in this workspace" / "found multiple packages" in CI -- two workspace… "no matching package named ... found"Fix cargo "no matching package named `X` found" in CI - cargo reached the registry but found no crate by that… "no matching package named"Fix cargo "error: no matching package named X found" in CI - a typo, a crate that lives in a workspace/path,… "no such command"Fix cargo "error: no such command: `X`" in CI - a cargo subcommand (audit, nextest, deny, tarpaulin) that isn… "no token found, please run \\`cargo login\\`"Fix cargo "error: no token found for `X`, please run `cargo login`" in CI - a private registry or publish ste… "object not found ... revision"Fix cargo git dependency "failed to find rev" / "object not found" in CI -- a branch, tag, or commit a git =… "requires rustc ... or newer"Fix cargo "package `X` cannot be built because it requires rustc Y or newer" in CI - a dependency's minimum s… "requires rustc Y or newer"Fix cargo "package `X` cannot be built because it requires rustc Y or newer" in CI -- a dependency's rust-ver… "Permission denied (os error 13)"Fix cargo "failed to create directory / Permission denied (os error 13)" in CI -- a target dir owned by root… "requires rustc ... or newer"Fix cargo "package X requires rustc 1.YY or newer" in CI - a dependency’s rust-version (MSRV) is higher than… "requires rustc 1.x or newer"Fix cargo "package X requires rustc Y or newer" / rust-version MSRV failures in CI -- a dependency raised its… "spurious network error"Fix cargo "warning: spurious network error" turning into a failed fetch in CI -- repeated transient errors ex… "spurious network error"Fix cargo "warning: spurious network error" and index update failures in CI - a transient connection drop whi… "test failed, to rerun pass"Fix cargo "error: test failed, to rerun pass `--lib`" in CI - one or more tests failed; the message points at… "the lock file ... but --locked was passed"Fix cargo "the lock file ... needs to be updated but --locked was passed" in CI - Cargo.toml changed since Ca… "this virtual manifest..."Fix cargo "error: this virtual manifest specifies a [workspace], but no package" in CI -- a workspace-root co… "pkg-config ... could not be found"Fix cargo build-script failures where pkg-config cannot find a system library in CI - a -sys crate needs a de… "clippy: -D warnings"Fix cargo clippy failures in CI when run with `-D warnings` -- lints that are warnings locally become hard er… feature unification breakageFix builds that break from cargo feature unification in CI -- one crate enables a feature (e.g. std) that ano… "no tests to run"Fix cargo-nextest "no tests to run" in CI -- a filter expression, missing test target, or wrong package selec… "running 0 tests"Fix cargo test reporting "running 0 tests" in CI - a filter, a missing test target, or a default-features cha… cargo-deny check failedFix cargo-deny / cargo-audit failures in CI - a RUSTSEC advisory, a banned/duplicate crate, or a disallowed l… "cargo test failed"Fix a failing "cargo test" in CI -- a real assertion failure, a panic, or a flaky test. Read the "test result… disabled default featureFix Rust build breaks after setting "default-features = false" in CI - a needed feature (like std or a codec)… duplicate crate versionsDiagnose multiple versions of the same crate in a Rust build with cargo tree --duplicates in CI - slow builds… edition migration errorsFix Rust build errors after bumping the crate edition in CI - bare trait objects, array IntoIterator changes,… feature unification surpriseFix Rust feature-unification surprises in CI - a workspace build enables a feature you didn’t ask for (e.g. d… "error[E0463]: can't find crate"Fix rustc "error[E0463]: can't find crate for `X`" in CI - the compiler could not locate a crate's compiled a… "could not choose a version of cargo"Fix rustup "error: could not choose a version of cargo to run" in CI - no default toolchain is set and the ov…

Build & link

Compiler, linker, and memory failures.

"could not compile (test)"Fix cargo "could not compile `X` (lib test)" in CI -- code or imports that only exist under `cfg(test)` fail… "cyclic package dependency"Fix cargo "error: cyclic package dependency" in CI -- two workspace crates depend on each other in a build cy… "? cannot convert the error"Fix Rust "? couldn't convert the error / error[E0277]" in CI -- the inner error has no From into the return e… "build-script-build: Permission denied"Fix cargo build-script "Permission denied (os error 13)" in CI -- the compiled build script is not executable… "cannot find derive macro"Fix rust "cannot find derive macro `X` in this scope" in CI -- a derive (Serialize, Deserialize) is used with… "cannot find macro"Fix Rust "error: cannot find macro `X` in this scope" in CI - a macro not imported, a missing feature/derive,… "cannot find macro ... in scope"Fix Rust "error: cannot find macro X in this scope" in CI -- a macro needs importing, a feature enabling, or… "cargo build failed"Fix a failing "cargo build" in CI -- a compile error, a missing native dependency, or a transient registry fe… broken intra-doc linkFix cargo doc failing on broken intra-doc links in CI - RUSTDOCFLAGS="-D warnings" turns an unresolved [`Type… cargo llvm-cov failureFix cargo-llvm-cov failures in CI - missing llvm-tools-preview component, no profraw data, or a coverage thre… cargo nextest failureFix cargo-nextest failures in CI - a test failed, leaked, timed out, or was aborted by the per-test slow/leak… "Could not find ... OpenSSL"Fix the openssl-sys "Could not find directory of OpenSSL installation" error in CI - install libssl-dev and p… "could not find native static library"Fix Rust "could not find native static library X, perhaps an -L flag is missing" in CI - install the static l… "could not find native static library"Fix rust "could not find native static library `X`" in CI -- a build script asked to statically link a librar… "could not find system library"Fix the pkg-config "could not find system library X required by the Y crate" error in CI - install the librar… "doctest failed"Fix Rust doctest failures in CI - code examples in /// doc comments are compiled and run by cargo test. Fix t… "env! variable not defined"Fix Rust "environment variable X not defined at compile time" from env! in CI - a build-time env var the buil… "could not compile"Understand cargo "error: could not compile `X` due to N previous errors" in CI - the summary line, not the ca… "linking with `cc` failed"Fix Rust "error: linking with `cc` failed: exit status: 1" in CI - undefined references or missing system lib… "test failed"Understand cargo "error: test failed, to rerun pass ..." in CI - a test panicked or an assertion failed. Read… "E0061: takes N arguments"Fix Rust "error[E0061]: this function takes N arguments but M were supplied" in CI -- a call site has the wro… "E0072: infinite size"Fix Rust "error[E0072]: recursive type X has infinite size" in CI -- a type contains itself directly. Box the… "E0106: missing lifetime"Fix Rust "error[E0106]: missing lifetime specifier" in CI -- a return type or struct holds a reference with n… "E0277: trait not satisfied"Fix Rust "error[E0277]: the trait bound `T: Trait` is not satisfied" in CI - a type doesn’t implement a requi… "E0308: mismatched types"Fix Rust "error[E0308]: mismatched types" in CI -- the type found differs from the type expected. Convert, de… "E0382: borrow of moved value"Fix Rust "error[E0382]: borrow of moved value" in CI - ownership moved out of a value and you used it again.… "E0432: unresolved import"Fix Rust "error[E0432]: unresolved import" in CI - a missing crate, a wrong path, or a feature-gated item tha… "E0432: unresolved import"Fix Rust "error[E0432]: unresolved import X" in CI -- a use path that does not resolve: a missing dependency,… "E0433: failed to resolve"Fix Rust "error[E0433]: failed to resolve: use of undeclared crate or module" in CI - a missing dependency, m… "E0433: failed to resolve"Fix Rust "error[E0433]: failed to resolve: use of undeclared crate or module" in CI -- a path that points at… "E0463: can't find crate"Fix Rust "error[E0463]: can't find crate for X" in CI for a dependency - a missing extern crate, an unbuilt d… "E0502: borrow conflict"Fix Rust "error[E0502]: cannot borrow X as mutable because it is also borrowed as immutable" in CI -- overlap… "E0507: cannot move out"Fix Rust "error[E0507]: cannot move out of X which is behind a shared reference" in CI -- you tried to move a… "E0599: no method named"Fix Rust "error[E0599]: no method named X found for type Y" in CI - a missing trait import, a typo, or an API… "E0658: ... is unstable"Fix Rust "error[E0658]: use of unstable library feature" in CI - code uses a nightly-only feature on stable.… "E0658: unstable feature"Fix Rust "error[E0658]: use of unstable library feature X" in CI -- a nightly-only API or feature gate used o… "E0716: temporary dropped"Fix Rust "error[E0716]: temporary value dropped while borrowed" in CI -- a reference outlives the temporary i… "failed to run custom build command"Fix cargo "error: failed to run custom build command for X" in CI - a crate’s build.rs script failed. Read th… "linker `cc` not found"Fix Rust "error: linker `cc` not found" in CI - rustc needs a system C linker that minimal images don’t ship.… "linker `lld` not found"Fix Rust "linker `lld`/`mold` not found" in CI - a .cargo/config.toml selects a linker the runner doesn’t hav… "undefined reference"Fix rust "linking with `cc` failed" with "undefined reference to ..." in CI -- a C symbol from a -sys crate i… "no global memory allocator"Fix Rust "error: no global memory allocator found but one is required" in CI -- a no_std build pulls in alloc… "proc-macro panicked"Fix Rust "proc-macro X panicked" / custom derive errors in CI - a derive or attribute macro failed on your in… "proc-macro panicked"Fix rust "proc-macro derive panicked" / "custom attribute panicked" in CI -- a procedural macro hit a panic w… "out of memory during codegen"Fix rust "LLVM ERROR: out of memory" during LTO codegen in CI -- fat link-time optimization holds the whole p… ring build failureFix the ring crate build failures in CI - its build script compiles C/asm and needs cc and perl. Install buil… "rustc interrupted by SIGKILL"Fix rust "error: rustc interrupted by signal 9 (SIGKILL)" in CI -- the OOM killer terminated rustc because th… "sccache: failed to start"Fix sccache failures in CI - "failed to start server", "connection to server failed", or a misconfigured RUST… warning denied as errorFix Rust builds where "unused variable" (or other lints) fail CI under -D warnings / deny(warnings) -- the wa… "`test` feature is unstable"Fix Rust "#[bench] / test crate is unstable" in CI - the built-in benchmark harness is nightly-only. Run benc… "Unable to find libclang"Fix the bindgen "Unable to find libclang" build error in CI -- a -sys crate using bindgen needs libclang. Ins… "OUT_DIR not set"Fix Rust build-script errors around OUT_DIR in CI - "environment variable OUT_DIR not defined" or an include!… clippy denied lintsFix CI failing on cargo clippy with -D warnings or clippy::pedantic - lints promoted to errors fail the build… compile killed (exit 137)Fix Rust compilation killed by OOM in CI - rustc SIGKILLed with exit 137 or "signal: 9". Lower codegen-units,… cross linker not foundFix Rust cross-compilation linker errors in CI - "linker aarch64-linux-gnu-gcc not found" for a foreign targe… "E0004: non-exhaustive patterns"Fix rust E0004 "non-exhaustive patterns: `X` not covered" in CI -- a match does not handle every variant, oft… "E0119: conflicting implementations"Fix rust E0119 "conflicting implementations of trait" in CI -- two impls overlap for the same type, often a m… "E0277: `?` cannot convert"Fix rust E0277 where the `?` operator fails because the error type does not implement `From` -- the trait bou… "E0384: cannot assign twice"Fix rust E0384 "cannot assign twice to immutable variable `x`" in CI -- a binding declared without `mut` is r… "E0407: not a member of trait"Fix rust E0407 "method `X` is not a member of trait `Y`" in CI -- an impl defines a method the trait does not… "E0408: not bound in all patterns"Fix rust E0408 "variable `x` is not bound in all patterns" in CI -- an or-pattern binds a name in one arm but… "E0412: cannot find type"Fix rust E0412 "cannot find type `X` in this scope" in CI -- a missing `use`, a typo in the type name, or a t… "E0425: cannot find value"Fix rust E0425 "cannot find value `x` in this scope" in CI -- an undeclared variable, a typo, a function call… "E0515: returns a reference to local"Fix rust E0515 "cannot return reference to local variable" in CI -- a function returns a borrow of data it ow… "E0521: borrowed data escapes"Fix rust E0521 "borrowed data escapes outside of closure/method" in CI -- a borrow with too short a lifetime… "E0596: cannot borrow as mutable"Fix rust E0596 "cannot borrow `x` as mutable, as it is not declared as mutable" in CI -- a binding needs `mut… "E0599: no method on Result"Fix rust E0599 "no method named `X` found for enum `Result`" in CI -- you called a value method on a Result w… "E0786: found invalid metadata"Fix rust "error[E0786]: found invalid metadata files" in CI -- a stale or corrupted target directory (often a… incremental cache corruptionFix Rust "found invalid metadata" / ICE from a corrupted incremental or target cache in CI - clear target/inc… codegen-units memory blowupFix Rust build memory blowups from high codegen-units and debug info in CI - the linker peaks on memory. Lowe… "ring/openssl-sys build failed"Fix ring or openssl-sys build failures in CI caused by a missing perl or nasm -- their build scripts need tho… RUSTFLAGS mismatchFix RUSTFLAGS mismatches in CI - env RUSTFLAGS and .cargo/config.toml flags fighting, causing surprise full r… wasm32 build failureFix Rust wasm32 build failures in CI - a dependency uses std/native code unavailable on wasm, or getrandom ne…

Toolchain

rustup, targets, and edition mismatches.

"failed to run rustc ... target info"Fix cargo "failed to run `rustc` to learn about target-specific information" in CI - a broken toolchain, a mi… "component ... unavailable"Fix rustup "error: component `clippy` is unavailable for download" in CI - a missing component, or a nightly… "unavailable ... for channel"Fix rustup "component X is unavailable for download for channel Y" in CI - a pinned nightly/version lacks a c… "could not choose a version"Fix rustup "could not choose a version of cargo to run" / override toolchain not installed in CI - a rust-too… "E0463: can't find crate for std"Fix Rust "error[E0463]: can't find crate for `std`" / "std not available" in CI - the target’s std isn’t inst… "no default toolchain set"Fix rustup "error: no override and no default toolchain set" in CI - rustup is installed but no toolchain is… wrong-host toolchain, no stdFix Rust builds failing because the toolchain host triple does not match the runner -- e.g. a gnu toolchain o… "override toolchain ... not installed"Fix rustup "error: override toolchain X is not installed" in CI -- a directory override (rustup override set)… "self-update is disabled"Fix rustup "self-update is disabled" / non-default location errors in CI -- a distro-managed rustup blocks to… "rustup: command not found"Fix "rustup: command not found" / "cargo: command not found" in CI - Rust isn’t installed or ~/.cargo/bin isn… target not installedFix cross-compile failures when a Rust target isn’t installed in CI - "target may not be installed". Add the… "the 'cargo' binary ... does not exist"Fix rustup "error: the cargo binary for the active toolchain does not exist" in CI -- a corrupt or partial to… "only accepted on ... nightly"Fix Rust "the `-Z` option is only accepted on the nightly compiler" / unstable feature errors in CI - a night… "toolchain is not installed"Fix rustup "error: toolchain `nightly-...` is not installed" in CI - a channel was requested but never instal… build script panickedFix a Rust build script that panics in CI - build.rs hit an unwrap/expect on a missing env var, file, or tool… plugin not on new toolchainFix a cargo subcommand vanishing after a toolchain change in CI - a plugin installed for one toolchain isn’t… "linker not found (cross)"Fix rust cross-compilation failures in CI where the cross linker is missing -- building for aarch64/arm/musl… "E0152: duplicate lang item"Fix rust "error[E0152]: found duplicate lang item" in CI -- a no_std crate defines a lang item already provid… "E0455: linking modifier"Fix rust "error[E0455]: link kind/modifier is not supported on this target" in CI -- a `#[link]` modifier (li… "E0463: can't find crate"Fix rust "error[E0463]: can't find crate for `proc_macro`" in CI -- the toolchain or target is missing the ho… "E0658: const generics"Fix rust "error[E0658]: ... is unstable" for advanced const generics in CI -- generic_const_exprs and related… rust-toolchain.toml mismatchFix rust-toolchain.toml overriding the CI toolchain - the pinned channel differs from what setup installed, s… "wasm32 std not found"Fix wasm32 build failures in CI caused by the wasm32 target not being installed -- rustc cannot find std for… "could not download file"Fix transient rustup "error: could not download file from static.rust-lang.org" in CI -- a dropped toolchain/…
Explore other topics