Repository navigation
feat(config): Expose config merging, reading, and schemas in a crate - #17705
Conversation
|
r? @Muscraft rustbot has assigned @Muscraft. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
There was a problem hiding this comment.
We've discussed this in today's cargo meeting, and are happy to move forward with a new crate. It is anyway a great refactor!
Things to do after merging this:
- Publish a
cargo-util-configplace holder package with version 0.0.0 (@epage ?) - Add https://crates.io/users/rust-lang-owner as the owner of this, and remove individuals from it (need helps from t-infra, see https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/.E2.9C.94.20Transfer.20.60cargo-util-terminal.60/with/582873081 for similar requests)
| @@ -1,11 +1,10 @@ | |||
| use std::fs; | |||
| use std::path::{Path, PathBuf}; | |||
|
|
|||
| use anyhow::{Context as _, bail}; | |||
| use anyhow::{Context as _, Result, bail}; | |||
There was a problem hiding this comment.
I wish we could have our own Result type for cargo-util-config. Anyway, this is a future work.
There was a problem hiding this comment.
publish.py needs an update I guess.
Line 21 in 4cd8640
|
Thanks for the reminder of the process. I've requested the ownership transfer at #t-infra > Transfer `cargo-util-config` @ 💬. |
Update cargo submodule 15 commits in c07ac2c4d12237effc4b94f4543769b421790045..ede6cefea9731cb595942338824c2f9a610b8189 2026-11-06 19:13:29 +0000 to 2026-11-11 12:33:16 +0000 - chore: bump to 0.103.0; update changelog (rust-lang/cargo#17709) - Update documentation about adding new publishable crates (rust-lang/cargo#17711) - test: Make cross compile test work with annotate-snippets whitespace changes (rust-lang/cargo#17707) - feat(config): Expose config merging, reading, and schemas in a crate (rust-lang/cargo#17705) - feat(schema): Expose SBOM types (rust-lang/cargo#17683) - fix: strip host deps whose debuginfo was weakened already (rust-lang/cargo#17691) - fix: dont strip if any transtive dep has debuginfo on (rust-lang/cargo#17689) - Reduce memory allocation in crate_type.rs (rust-lang/cargo#17706) - fix(doc): do not suggest cargo fix for rustdoc warnings (rust-lang/cargo#17702) - perf(parse): Trade remote manifest diagnostic quality for performance (rust-lang/cargo#17701) - refactor(config): Pull deserialiation into the config layer (rust-lang/cargo#17699) - Use trusted publishing for the home crate (rust-lang/cargo#17703) - refactor(benchsuite): Port to divan (rust-lang/cargo#17700) - fix(schema): Improve deserialization errors and performance (rust-lang/cargo#17697) - fix(lockfile): sort unused patches in Cargo.lock (rust-lang/cargo#17698)
### What does this PR try to resolve? This is a lot of the API polish that was deferred out of rust-lang#17705. ### Notes to reviewers I was looking at the docs generated by `cargo doc` to help with the polishing. Still missing from the API - Changing the error type - Dropping `cargo-util-terminal` as a dep - Cleaning up `Definition` (see rust-lang#17614 (comment)) - Config discovery and include handling Still missing generally - More schema work Future refactors: - Switch from `toml_edit` to `toml_parser` for detecting extra syntax being used --- 🤖 LLM involvement: planning, prototyping, and moving code
What does this PR try to resolve?
This is part of #12883. This moves all but config file discovery to
cargo-util-config.Notes to reviewers
Next steps:
anyhowandcargo-util-terminal, documentation, etc)🤖 LLM involvement: Prototyping and making individual code transformations steps along this path