Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for issue in linux Cargo binaries #1252

Merged
merged 7 commits into from
Apr 10, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Workaround for issue in linux Cargo binaries
UebelAndre committed Apr 10, 2022

Verified

This commit was signed with the committer’s verified signature.
TanklesXL Robert Attard
commit 1c75c6cdde2bb7f833598090f85654db4b9b04b3
16 changes: 14 additions & 2 deletions crate_universe/src/lockfile.rs
Original file line number Diff line number Diff line change
@@ -198,8 +198,20 @@ impl Digest {
bail!("Failed to query cargo version")
}

let version = String::from_utf8(output.stdout)?;
Ok(version)
let version = String::from_utf8(output.stdout)?.trim().to_owned();

// TODO: There is a bug in the linux binary for Cargo 1.60.0 where
// the commit hash reported by the version is shorter than what's
// reported on other platforms. This conditional here is a hack to
// correct for this difference and ensure lockfile hashes can be
// computed consistently. If a new binary is released then this
// condition should be removed
// https://github.com/rust-lang/cargo/issues/10547
if version == "cargo 1.60.0 (d1fd9fe 2022-03-01)" {
Ok("cargo 1.60.0 (d1fd9fe2c 2022-03-01)".to_owned())
} else {
Ok(version)
}
}
}