Skip to content

Commit

Permalink
Workaround for issue in linux Cargo binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre committed Apr 8, 2022
1 parent 5c38caf commit 950f963
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion crate_universe/src/lockfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit 950f963

Please sign in to comment.