Skip to content

Commit

Permalink
Update reindeer to look for cargo lock version 4
Browse files Browse the repository at this point in the history
Summary:
1.83.0 uses version 4 for cargo lockfile. Lockfile v4 was stabilized in 1.78.0.

https://github.com/rust-lang/cargo/blob/master/src/cargo/core/resolver/resolve.rs#L89-L95

Adds awareness of url encoding to SourceId, which AFAICT does not impact any Meta-internal usages of rust today?

Reviewed By: dtolnay

Differential Revision: D67436425

fbshipit-source-id: 3a6d21f7f306438c209c21698d31324c07c93afd
  • Loading branch information
capickett authored and facebook-github-bot committed Dec 19, 2024
1 parent 6c7af99 commit c30e65f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lockfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::Paths;
#[derive(Deserialize, Debug)]
pub struct Lockfile {
#[allow(dead_code)]
pub version: Hopefully3,
pub version: Hopefully4,
#[serde(rename = "package")]
pub packages: Vec<LockfilePackage>,
}
Expand Down Expand Up @@ -53,7 +53,7 @@ impl Lockfile {
}

#[derive(Debug)]
pub struct Hopefully3;
pub struct Hopefully4;

#[derive(Deserialize, Debug)]
pub struct LockfilePackage {
Expand All @@ -63,15 +63,15 @@ pub struct LockfilePackage {
pub checksum: Option<String>,
}

impl<'de> Deserialize<'de> for Hopefully3 {
impl<'de> Deserialize<'de> for Hopefully4 {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
{
let version = usize::deserialize(deserializer)?;
if version != 3 {
if version != 4 {
log::warn!("Unrecognized Cargo.lock format version: {}", version);
}
Ok(Hopefully3)
Ok(Hopefully4)
}
}

0 comments on commit c30e65f

Please sign in to comment.