From 950f963f554e427b6987ef784286865d60d511bc Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Fri, 8 Apr 2022 07:19:10 -0700 Subject: [PATCH] Workaround for issue in linux Cargo binaries --- crate_universe/src/lockfile.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crate_universe/src/lockfile.rs b/crate_universe/src/lockfile.rs index 91f48321a8..6c4fc27e73 100644 --- a/crate_universe/src/lockfile.rs +++ b/crate_universe/src/lockfile.rs @@ -199,7 +199,19 @@ impl Digest { } let version = String::from_utf8(output.stdout)?; - Ok(version) + + // 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) + } } }