-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added unstable-schema generation for Cargo.toml #14683
Conversation
r? @weihanglo rustbot has assigned @weihanglo. Use |
Please cleanup the commits for how you'd like them reviewed / merged. |
6a09f21
to
0194d1f
Compare
0194d1f
to
b32db7e
Compare
176f98b
to
68a3a26
Compare
015cf01
to
e924dda
Compare
e924dda
to
1f419ba
Compare
Thanks! @bors r+ |
Added unstable-schema generation for Cargo.toml ### What does this PR try to resolve? Added unstable-schema feature that generates JsonSchema for Cargo.toml See #12883 finished first step of [plan](#12883 (comment)) ### Information In cargo-util-schemas, run cargo test --feature unstable-schema . If there have been any changes to manifest.schema.json, rerun with env variable SNAPSHOTS=overwrite and it will update them. ### How should we test and review this PR? In cargo-util-schemas run cargo test --features unstable-schema and it will generate manifest.schema.json
@bors r- Looks like some unrelated lockfile updates happened |
☀️ Try build successful - checks-actions |
Cargo.lock
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dacianpascu06 could you remove unnecessary lockfile updates from the commit?
This could generate the minimal changes we need:
git checkout HEAD~ -- Cargo.lock
cargo b
The diff should be something like:
diff --git a/Cargo.lock b/Cargo.lock
index a943b8b8c40..dd5ff342bbc 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -327,7 +327,7 @@ dependencies = [
"humantime",
"ignore",
"im-rc",
- "indexmap",
+ "indexmap 2.3.0",
"itertools 0.13.0",
"jobserver",
"lazycell",
@@ -492,10 +492,12 @@ dependencies = [
name = "cargo-util-schemas"
version = "0.7.1"
dependencies = [
+ "schemars",
"semver",
"serde",
"serde-untagged",
"serde-value",
+ "serde_json",
"snapbox",
"thiserror",
"toml",
@@ -902,6 +904,12 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b"
+[[package]]
+name = "dyn-clone"
+version = "1.0.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125"
+
[[package]]
name = "ecdsa"
version = "0.16.9"
@@ -1466,7 +1474,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ddf80e16f3c19ac06ce415a38b8591993d3f73aede049cb561becb5b3a8e242"
dependencies = [
"gix-hash",
- "hashbrown",
+ "hashbrown 0.14.5",
"parking_lot",
]
@@ -1502,7 +1510,7 @@ dependencies = [
"gix-traverse",
"gix-utils",
"gix-validate",
- "hashbrown",
+ "hashbrown 0.14.5",
"itoa 1.0.11",
"libc",
"memmap2",
@@ -1959,6 +1967,12 @@ dependencies = [
"walkdir",
]
+[[package]]
+name = "hashbrown"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
+
[[package]]
name = "hashbrown"
version = "0.14.5"
@@ -1975,7 +1989,7 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "692eaaf7f7607518dd3cef090f1474b61edc5301d8012f09579920df68b725ee"
dependencies = [
- "hashbrown",
+ "hashbrown 0.14.5",
]
[[package]]
@@ -2088,6 +2102,17 @@ dependencies = [
"version_check",
]
+[[package]]
+name = "indexmap"
+version = "1.9.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
+dependencies = [
+ "autocfg",
+ "hashbrown 0.12.3",
+ "serde",
+]
+
[[package]]
name = "indexmap"
version = "2.3.0"
@@ -2095,7 +2120,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0"
dependencies = [
"equivalent",
- "hashbrown",
+ "hashbrown 0.14.5",
]
[[package]]
@@ -3077,6 +3102,32 @@ dependencies = [
"windows-sys 0.52.0",
]
+[[package]]
+name = "schemars"
+version = "0.8.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92"
+dependencies = [
+ "dyn-clone",
+ "indexmap 1.9.3",
+ "schemars_derive",
+ "semver",
+ "serde",
+ "serde_json",
+]
+
+[[package]]
+name = "schemars_derive"
+version = "0.8.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "serde_derive_internals",
+ "syn 2.0.72",
+]
+
[[package]]
name = "scopeguard"
version = "1.2.0"
@@ -3177,6 +3228,17 @@ dependencies = [
"syn 2.0.72",
]
+[[package]]
+name = "serde_derive_internals"
+version = "0.29.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.72",
+]
+
[[package]]
name = "serde_ignored"
version = "0.1.10"
@@ -3557,7 +3619,7 @@ version = "0.22.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d"
dependencies = [
- "indexmap",
+ "indexmap 2.3.0",
"serde",
"serde_spanned",
"toml_datetime",
14616c6
to
e6be9ea
Compare
e6be9ea
to
21ce69e
Compare
Thanks! @bors r+ |
☀️ Test successful - checks-actions |
Update cargo 14 commits in cf53cc54bb593b5ec3dc2be4b1702f50c36d24d5..e75214ea4936d2f2c909a71a1237042cc0e14b07 2024-10-18 13:56:15 +0000 to 2024-10-25 16:34:32 +0000 - refactor(env): remove unnecessary clones (rust-lang/cargo#14730) - test(install): Verify 2024 edition / resolver=3 doesn't affect resolution (rust-lang/cargo#14724) - Fix: trace `config` `[env]` table in dep-info. (rust-lang/cargo#14701) - Added unstable-schema generation for Cargo.toml (rust-lang/cargo#14683) - fix: add source replacement info when no matching package found (rust-lang/cargo#14715) - feat(complete): Include descriptions in zsh (rust-lang/cargo#14726) - refactor(fingerprint): avoid unnecessary fopen calls (rust-lang/cargo#14728) - docs(resolver): Make room for v3 resolver (rust-lang/cargo#14725) - test: add fixes in the sat resolver (rust-lang/cargo#14707) - docs(ci): Don't constrainty latest_deps job by MSRV (rust-lang/cargo#14711) - refactor: use `Iterator::is_sorted` (rust-lang/cargo#14702) - refactor(rustfix): minor refactors (rust-lang/cargo#14710) - chore(deps): update msrv (rust-lang/cargo#14705) - fix(renovate): Switch matchPackageNames to matchDepNames (rust-lang/cargo#14704)
What does this PR try to resolve?
Added unstable-schema feature that generates JsonSchema for Cargo.toml
See #12883
finished first step of plan
Information
In cargo-util-schemas, run
cargo test --features unstable-schema
. If there have been any changes to manifest.schema.json, rerun with env variable SNAPSHOTS=overwrite and it will update them.How should we test and review this PR?
In cargo-util-schemas run cargo test --features unstable-schema and it will generate manifest.schema.json