Skip to content

[DRAFT] Update cargo_metadata to 0.20 and cargo-platform to 0.2#105

Closed
musicinmybrain wants to merge 1 commit intoEmbarkStudios:mainfrom
musicinmybrain:cargo_metadata-0.20
Closed

[DRAFT] Update cargo_metadata to 0.20 and cargo-platform to 0.2#105
musicinmybrain wants to merge 1 commit intoEmbarkStudios:mainfrom
musicinmybrain:cargo_metadata-0.20

Conversation

@musicinmybrain
Copy link
Copy Markdown
Contributor

Checklist

  • I have read the Contributor Guide
  • I have read and agree to the Code of Conduct
  • I have added a description of my changes and why I'd like them included in the section below

Description of Changes

Update cargo_metadata to 0.20 and cargo-platform to 0.2, the last release compatible with the chosen MSRV of 1.85.

It looks like these can be further updated to cargo_metadata 0.23 and cargo-platform 0.3, the latest releases, without additional source-code changes, if the MSRV is advanced to 1.86.

My goal here is to update the packaged cargo-deny in Fedora without having to maintain a rust-cargo_metadata0.19 compat package indefinitely.

The cargo_metadata project doesn’t really keep detailed changelogs, but the changes that required source-code changes can be reviewed in oli-obk/cargo_metadata@0.19.2...0.20.0.

I made a reasonable effort to adapt to the changes in the cargo_metadata API sensibly, but I am not familiar with krates, and I have more experience packaging Rust code than writing it, so review would be appreciated.

I tested this with cargo test --all-features.

Related Issues

N/A

@musicinmybrain musicinmybrain changed the title Update cargo_metadata to 0.20 and cargo-platform to 0.2 [DRAFT] Update cargo_metadata to 0.20 and cargo-platform to 0.2 Dec 11, 2025
@musicinmybrain
Copy link
Copy Markdown
Contributor Author

Oops, this fails when the metadata feature is not enabled, with:

error[E0609]: no field `repr` on type `&std::string::String`
    --> src/builder.rs:1251:54
     |
1251 | ...                   let dsrc = &dsrc.repr;
     |                                        ^^^^ unknown field

That suggests that “peephole” adaptation to cargo_metadata API changes is insufficient, and I need to take a step back and develop a broad understanding of types from cargo_metadata are used in krates’s data structures. I don’t think I’ll have time for that, so I’m going to abandon this PR and proceed with a rust-cargo_metadata0.19 compat package in Fedora for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant