Sporadic "error[E0463]: can't find crate for..." Build Error
⚓ Rust 📅 2025-10-07 👤 surdeus 👁️ 5Hello!
I'm getting error[E0463]: can't find crate for... build error and it just started recently. It only seems to be happening in --release builds, from clean, and it goes away on rebuild, which means it triggers nearly everytime in CI.
The crate that is mentioned in the error message differs between CI builds and local builds. The error comes from an intermediate crate (ie, given top-level crate A which depends on lib B which depends on lib C, it's an error in lib B about C not being found, all three of which are in the same workspace). All crate dependencies are correctly specified in the Cargo.toml files; the intermediate libraries build successfully on their own, and on rebuilds things proceed successfully.
Also weird is that in release-mode builds only, I'm seeing a warning about a conflicting output file name for yet another intermediate workspace library, though this conflict isn't related to any of the other "can't find crate" messages.
I'm stumped. Any thoughts/ideas?
1 post - 1 participant
🏷️ Rust_feed