Skip to content

Fix manifest schema generation: TomlDebugInfo enum-variants doesn't renamed#17202

Merged
weihanglo merged 1 commit into
rust-lang:masterfrom
boozook:fix/schema-manifest-enum-17201
Jul 12, 2026
Merged

Fix manifest schema generation: TomlDebugInfo enum-variants doesn't renamed#17202
weihanglo merged 1 commit into
rust-lang:masterfrom
boozook:fix/schema-manifest-enum-17201

Conversation

@boozook

@boozook boozook commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

fixes #17201, no breaking changes.

Fixes manifest schema and attributes used for its generation — missed rename-attr for TomlDebugInfo.

  • added schemars(rename_all = "kebab-case") for TomlDebugInfo
  • fixed case in the schema used in test

What does this PR try to resolve?

issue: #17201

Motivation

  1. Public schema in master branch is wrong and currently should not be used for manifest validation.
  2. Schema-generation should be fixed.
  3. I want to fix it madly (I heavily using nightly toolchain, schemas everywhere and I suffer from this error).

How to test and review this PR?

  1. get taplo (or any tool that you prefer to validate vs. schemas)
  2. cargo init
  3. add to Cargo.toml options that is TomlDebugInfo's enum-variants:
    [profile.dev]
    debug = "Full"
  4. validate any your Cargo.toml with taplo:
taplo check Cargo.toml —verbose \
  --schema=https://raw.githubusercontent.com/rust-lang/cargo/refs/heads/master/crates/cargo-util-schemas/manifest.schema.json
  1. ☝🏻this shows that Cargo.toml (from step 2) is valid for scheme that is currently in master-branch
  2. validate any your Cargo.toml with cargo:
    run cargo check for a crate with that Cargo.toml (from steps 2, 3) — cargo must throw deserialization error, so manifest is invalid

After applying this patch (PR) with fixed schema, that manifest will be invalid in same way as for cargo.


LLM/ML/AI usage disclosure: I'm a retrograde, Luddite kind of person who loves to write code by hand and using my brain; I don't use models, I make decisions and make mistakes on my own, I've been writing code for over twenty years, and I respect myself and other engineers, so AI was not used.

@rustbot rustbot added A-manifest Area: Cargo.toml issues S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 11, 2026
@rustbot

rustbot commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @epage (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage, weihanglo

Comment thread crates/cargo-util-schemas/src/manifest/mod.rs
@weihanglo

Copy link
Copy Markdown
Member

https://github.com/rust-lang/cargo/actions/runs/29160031492/job/86563420773?pr=17202

Checking for bumps of changed packages
     BumpCheck head commit `937da855e948a7ae640b2c88d5c132877682e91d`
     BumpCheck compare against `crates-io`
      Updating crates.io index
     BumpCheck compare against `f40cc7a13a8ebe3dd0a35b1e0e37a1e26c8bb0e5`
  error: Detected changes in these crates but no version bump found:
    [email protected]

You might want to bump a patch version for along with the fix :)

@boozook

boozook commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. Bumped, but lock doesn't touched to prevent any conflicts. I can push updated lock if needed.

Upd: uh, seems it needed, okay, just a moment.

Should I force-push all commits as one?

Should I update dependents of cargo-util-schemas because of this?

@boozook
boozook requested a review from weihanglo July 11, 2026 19:24

@weihanglo weihanglo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Would you mind cleaning up commit history? I feel like maybe squash would work?

View changes since this review

- add `schemars(rename_all = "kebab-case")`,
- add aliases for variants
- fix the schema used in test.
- bump `cargo-util-schemas`

fixes rust-lang#17201
@boozook
boozook force-pushed the fix/schema-manifest-enum-17201 branch from 2d94517 to e953287 Compare July 12, 2026 05:55
@boozook

boozook commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

Everything is done, as I hope.

@weihanglo weihanglo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weihanglo
weihanglo added this pull request to the merge queue Jul 12, 2026
Merged via the queue into rust-lang:master with commit 3d357a9 Jul 12, 2026
31 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 12, 2026
@boozook
boozook deleted the fix/schema-manifest-enum-17201 branch July 17, 2026 10:38
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Jul 18, 2026
Update cargo submodule

29 commits in 59800466c5c41c444d264b1010b4d57e85a7117f..3efb1f477e99b42974b982d939fd100303cdf7db
2026-07-07 15:52:22 +0000 to 2026-07-17 23:53:19 +0000
- refactor(context): normalize in `homedir` instead (rust-lang/cargo#17222)
- chore(ci): reflect doc folder move in book deployment (rust-lang/cargo#17235)
- refactor(ops): Have cargo-metadata's ops match the command name (rust-lang/cargo#17233)
- chore: Flatten src (rust-lang/cargo#17231)
- chore: Flatten `src` (rust-lang/cargo#17230)
- chore(ci): remove stale libsecret packages (rust-lang/cargo#17229)
- perf: Lazily initialize git2 fetch transports  (rust-lang/cargo#17226)
- test(trim-paths): re-enable lldb debugger tests  (rust-lang/cargo#17223)
- Include SBOM outputs in fingerprints (rust-lang/cargo#17216)
- Update cfg_aliases to 0.2.2 (rust-lang/cargo#17225)
- test(trim-paths): exercise GDB on windows-gnu (rust-lang/cargo#17221)
- feat(profile): Disable incremental compilation under CI by default (rust-lang/cargo#17220)
- Remove myself from review rotation (rust-lang/cargo#17219)
- Fix typo in comment in sync (rust-lang/cargo#17217)
- docs(ref): Improve handing of built-in profiles (rust-lang/cargo#17213)
- fix: dont apply host-config gating to stable behavior (rust-lang/cargo#17198)
- chore(deps): update msrv (rust-lang/cargo#17192)
- test: fix race in cargo_compile_with_invalid_code_in_deps (rust-lang/cargo#17203)
- Rename `-Zno-embed-metadata` to `-Zembed-metadata=no` (rust-lang/cargo#17149)
- fix(source): incorrect duplicate package warning (rust-lang/cargo#17204)
- Fix manifest schema generation: `TomlDebugInfo` enum-variants doesn't renamed (rust-lang/cargo#17202)
- Reduce library search path length in new build dir layout (rust-lang/cargo#17191)
- fix(install): Move --debug to Compilation options (rust-lang/cargo#17199)
- chore(ci): dogfood `build.warnings` (rust-lang/cargo#17195)
- docs(lints): Better match clippy in lint section titles (rust-lang/cargo#17190)
- chore: bump to 0.100.0; update changelog (rust-lang/cargo#17189)
- docs(ref): Clarify MSRV for lints (rust-lang/cargo#17184)
- docs(report): add missing entry for `cargo report future-incompatibilities` (rust-lang/cargo#17188)
- Reduce rustc `-L` args used in the new `build-dir` layout (rust-lang/cargo#17168)
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Jul 18, 2026
Update cargo submodule

29 commits in 59800466c5c41c444d264b1010b4d57e85a7117f..3efb1f477e99b42974b982d939fd100303cdf7db
2026-07-07 15:52:22 +0000 to 2026-07-17 23:53:19 +0000
- refactor(context): normalize in `homedir` instead (rust-lang/cargo#17222)
- chore(ci): reflect doc folder move in book deployment (rust-lang/cargo#17235)
- refactor(ops): Have cargo-metadata's ops match the command name (rust-lang/cargo#17233)
- chore: Flatten src (rust-lang/cargo#17231)
- chore: Flatten `src` (rust-lang/cargo#17230)
- chore(ci): remove stale libsecret packages (rust-lang/cargo#17229)
- perf: Lazily initialize git2 fetch transports  (rust-lang/cargo#17226)
- test(trim-paths): re-enable lldb debugger tests  (rust-lang/cargo#17223)
- Include SBOM outputs in fingerprints (rust-lang/cargo#17216)
- Update cfg_aliases to 0.2.2 (rust-lang/cargo#17225)
- test(trim-paths): exercise GDB on windows-gnu (rust-lang/cargo#17221)
- feat(profile): Disable incremental compilation under CI by default (rust-lang/cargo#17220)
- Remove myself from review rotation (rust-lang/cargo#17219)
- Fix typo in comment in sync (rust-lang/cargo#17217)
- docs(ref): Improve handing of built-in profiles (rust-lang/cargo#17213)
- fix: dont apply host-config gating to stable behavior (rust-lang/cargo#17198)
- chore(deps): update msrv (rust-lang/cargo#17192)
- test: fix race in cargo_compile_with_invalid_code_in_deps (rust-lang/cargo#17203)
- Rename `-Zno-embed-metadata` to `-Zembed-metadata=no` (rust-lang/cargo#17149)
- fix(source): incorrect duplicate package warning (rust-lang/cargo#17204)
- Fix manifest schema generation: `TomlDebugInfo` enum-variants doesn't renamed (rust-lang/cargo#17202)
- Reduce library search path length in new build dir layout (rust-lang/cargo#17191)
- fix(install): Move --debug to Compilation options (rust-lang/cargo#17199)
- chore(ci): dogfood `build.warnings` (rust-lang/cargo#17195)
- docs(lints): Better match clippy in lint section titles (rust-lang/cargo#17190)
- chore: bump to 0.100.0; update changelog (rust-lang/cargo#17189)
- docs(ref): Clarify MSRV for lints (rust-lang/cargo#17184)
- docs(report): add missing entry for `cargo report future-incompatibilities` (rust-lang/cargo#17188)
- Reduce rustc `-L` args used in the new `build-dir` layout (rust-lang/cargo#17168)
@rustbot rustbot added this to the 1.99.0 milestone Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-manifest Area: Cargo.toml issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong enum variants in the schema

4 participants