Skip to content

Commit a112c1f

Browse files
committed
feat(index): Stabilize pubtime
1 parent 331a495 commit a112c1f

File tree

4 files changed

+27
-12
lines changed

4 files changed

+27
-12
lines changed

crates/cargo-util-schemas/index.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
]
7070
},
7171
"pubtime": {
72-
"description": "The publish time for the package. Unstable.\n\nIn ISO8601 with UTC timezone (e.g. 2025-11-12T19:30:12Z)\n\nThis should be the original publish time and not changed on any status changes,\nlike [`IndexPackage::yanked`].",
72+
"description": "The publish time of this package version (optional).\n\nThe format is a subset of ISO8601:\n- `yyyy-mm-ddThh:mm:ssZ`\n- no fractional seconds\n- always `Z` for UTC timezone, no timezone offsets supported\n- fields are 0-padded\n\nExample: 2025-11-12T19:30:12Z\n\nThis should be the original publish time and not changed on any status changes,\nlike [`IndexPackage::yanked`].",
7373
"type": [
7474
"string",
7575
"null"

crates/cargo-util-schemas/src/index.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,15 @@ pub struct IndexPackage<'a> {
4646
/// can be `None` if published before then or if not set in the manifest.
4747
#[cfg_attr(feature = "unstable-schema", schemars(with = "Option<String>"))]
4848
pub rust_version: Option<RustVersion>,
49-
/// The publish time for the package. Unstable.
49+
/// The publish time of this package version (optional).
5050
///
51-
/// In ISO8601 with UTC timezone (e.g. 2025-11-12T19:30:12Z)
51+
/// The format is a subset of ISO8601:
52+
/// - `yyyy-mm-ddThh:mm:ssZ`
53+
/// - no fractional seconds
54+
/// - always `Z` for UTC timezone, no timezone offsets supported
55+
/// - fields are 0-padded
56+
///
57+
/// Example: 2025-11-12T19:30:12Z
5258
///
5359
/// This should be the original publish time and not changed on any status changes,
5460
/// like [`IndexPackage::yanked`].

src/doc/src/reference/registry-index.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,20 @@ explaining the format of the entry.
218218
}
219219
// The minimal supported Rust version (optional)
220220
// This must be a valid version requirement without an operator (e.g. no `=`)
221-
"rust_version": "1.60"
221+
"rust_version": "1.60",
222+
// The publish time of this package version (optional).
223+
//
224+
// The format is a subset of ISO8601:
225+
// - `yyyy-mm-ddThh:mm:ssZ`
226+
// - no fractional seconds
227+
// - always `Z` for UTC timezone, no timezone offsets supported
228+
// - fields are 0-padded
229+
//
230+
// Example: 2025-11-12T19:30:12Z
231+
//
232+
// This should be the original publish time and not changed on any status changes,
233+
// like `yanked`.
234+
"pubtime": "2025-11-12T19:30:12Z"
222235
}
223236
```
224237

src/doc/src/reference/unstable.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,14 +1843,6 @@ Specify which packages participate in [feature unification](../reference/feature
18431843
* `package`: Dependency features are considered on a package-by-package basis,
18441844
preferring duplicate builds of dependencies when different sets of features are activated by the packages.
18451845

1846-
## pubtime
1847-
1848-
* Original Issue: [#15491](https://github.com/rust-lang/cargo/issues/15491)
1849-
* Tracking Issue: [#16270](https://github.com/rust-lang/cargo/issues/16270)
1850-
1851-
Documentation updates:
1852-
- Add `pubtime` field to the Index Summary description
1853-
18541846
## lockfile-publish-time
18551847

18561848
* Original Issue: [#5221](https://github.com/rust-lang/cargo/issues/5221)
@@ -2273,3 +2265,7 @@ See <https://github.com/rust-lang/cargo/issues/7614> for the reason for its remo
22732265
Support for including extra configuration files via the `include` config key
22742266
has been stabilized in 1.93.0.
22752267
See the [`include` config documentation](config.md#include) for more.
2268+
2269+
## pubtime
2270+
2271+
The `pubtime` index field has been stabilized in Rust 1.94.0.

0 commit comments

Comments
 (0)