The cargo.eclass cargo_crate_uris function fails when the crate has prerelease information in the version number. An example of a widely used crate which recently had this problem is error_chain (https://crates.io/crates/error-chain/0.11.0-rc.2). It attempts to get the package from https://crates.io/api/v1/crates/error-chain-0.11.0/rc.2/download instead of from https://crates.io/api/v1/crates/error-chain/0.11.0-rc.2/download, because the variable expansion breaks the crate name at the last hyphen. Crates on crates.io follow the semantic version spec (http://semver.org/) which allows for dashes in the version number when specifying a pre-release version.
I've fixed this (somewhat crudely) in 22e6f49add5eb11715f230a50790c0eecf4f5f1f: --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -31,9 +31,14 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo" cargo_crate_uris() { local crate for crate in "$@"; do - local name version url + local name version url pretag name="${crate%-*}" version="${crate##*-}" + pretag="[a-zA-Z]+" + if [[ $version =~ $pretag ]]; then + version="${name##*-}-${version}" + name="${name%-*}" + fi url="https://crates.io/api/v1/crates/${name}/${version}/download -> ${crate}.crate" echo "${url}" done This at least let me bump cargo to 0.21.0, which indeed suffers from the error-chain rc dependency mentioned.