Skip to content

Conversation

dacianpascu06
Copy link
Contributor

@dacianpascu06 dacianpascu06 commented Oct 14, 2024

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

@rustbot
Copy link
Collaborator

rustbot commented Oct 14, 2024

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-manifest Area: Cargo.toml issues S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 14, 2024
@epage
Copy link
Contributor

epage commented Oct 14, 2024

Please cleanup the commits for how you'd like them reviewed / merged.

@dacianpascu06 dacianpascu06 force-pushed the 355adcad7 branch 2 times, most recently from 176f98b to 68a3a26 Compare October 14, 2024 21:29
@dacianpascu06 dacianpascu06 force-pushed the 355adcad7 branch 2 times, most recently from 015cf01 to e924dda Compare October 15, 2024 10:30
@epage
Copy link
Contributor

epage commented Oct 23, 2024

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Oct 23, 2024

📌 Commit 1f419ba has been approved by epage

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 23, 2024
@bors
Copy link
Contributor

bors commented Oct 23, 2024

⌛ Testing commit 1f419ba with merge 4d4130a...

bors added a commit that referenced this pull request Oct 23, 2024
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
@weihanglo
Copy link
Member

@bors r-

Looks like some unrelated lockfile updates happened

@bors bors added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 23, 2024
@bors
Copy link
Contributor

bors commented Oct 23, 2024

☀️ Try build successful - checks-actions
Build commit: 4d4130a (4d4130a45e45f6d5fce25edc930725bf99a60c40)

Cargo.lock Outdated
Copy link
Member

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",

@dacianpascu06 dacianpascu06 force-pushed the 355adcad7 branch 2 times, most recently from 14616c6 to e6be9ea Compare October 24, 2024 20:46
@epage
Copy link
Contributor

epage commented Oct 24, 2024

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Oct 24, 2024

📌 Commit 21ce69e has been approved by epage

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. labels Oct 24, 2024
@bors
Copy link
Contributor

bors commented Oct 24, 2024

⌛ Testing commit 21ce69e with merge cf91520...

@bors
Copy link
Contributor

bors commented Oct 24, 2024

☀️ Test successful - checks-actions
Approved by: epage
Pushing cf91520 to master...

@bors bors merged commit cf91520 into rust-lang:master Oct 24, 2024
24 checks passed
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 26, 2024
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)
@rustbot rustbot added this to the 1.84.0 milestone Oct 26, 2024
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 S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants