You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(generate-lockfile): Add unstable --publish-time flag (#16265)
### What does this PR try to resolve?
Implementation for #5221, #15491
Tracking issues: #16270, #16271
Use cases:
- Improved reproduction steps using cargo scripts without including a
lockfile
- Debugging issues in the past
- Manual stop gap for #15973
This seemed like the shortest path to testing the proposed `pubtime`
index entries (#15491) so we can unblock other work on it like #15973.
While this has some big caveats, the design is straightforward.
In contrast, #15973 has a lot more design questions (is this a
resolver-wide setting or a per-registry setting, what formats are
accepted, etc) that could slow down development and testing `pubtime`.
### How to test and review this PR?
Unresolved questions (deferred to the tracking issues):
- How do we compensate for the caveats, with one option being to leave
this perma-unstable?
- How should we deal with Summary `pubtime` parse errors?
- How strict should we be on the Summary `pubtime` format?
- Should we offer a convenient way of getting a compatible timestamp?
Future possibilities:
- Ability to lock to a timestamp with `cargo update` updating the
timestamp (could be useful for cargo scripts)
Copy file name to clipboardExpand all lines: crates/cargo-util-schemas/index.schema.json
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,13 @@
68
68
"null"
69
69
]
70
70
},
71
+
"pubtime": {
72
+
"description": "The publish time for the package. Unstable.\n\nIn ISO8601 with UTC timezone (e.g. 2025-11-12T19:30:12Z)",
73
+
"type": [
74
+
"string",
75
+
"null"
76
+
]
77
+
},
71
78
"v": {
72
79
"description": "The schema version for this entry.\n\nIf this is None, it defaults to version `1`. Entries with unknown\nversions are ignored.\n\nVersion `2` schema adds the `features2` field.\n\nVersion `3` schema adds `artifact`, `bindep_targes`, and `lib` for\nartifact dependencies support.\n\nThis provides a method to safely introduce changes to index entries\nand allow older versions of cargo to ignore newer entries it doesn't\nunderstand. This is honored as of 1.51, so unfortunately older\nversions will ignore it, and potentially misinterpret version 2 and\nnewer entries.\n\nThe intent is that versions older than 1.51 will work with a\npre-existing `Cargo.lock`, but they may not correctly process `cargo\nupdate` or build a lock from scratch. In that case, cargo may\nincorrectly select a new package that uses a new index schema. A\nworkaround is to downgrade any packages that are incompatible with the\n`--precise` flag of `cargo update`.",
0 commit comments