Skip to content

Commit 9b85e11

Browse files
committed
Auto merge of #12206 - ehuss:index-version-unique, r=weihanglo
Add a small note about indexes ignoring SemVer build metadata. This adds some clarification to the documentation on how registries need to handle SemVer build metadata, and the uniqueness constraint around version entries. IIRC, some issues in cargo have been fixed, but some still linger (like #7180). crates.io just fixed it so that new duplicates will be rejected.
2 parents 99430e5 + 0ab423d commit 9b85e11

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

+10
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ harder to support older versions of Cargo that lack `{prefix}`/`{lowerprefix}`.
8080
For example, nginx rewrite rules can easily construct `{prefix}` but can't
8181
perform case-conversion to construct `{lowerprefix}`.
8282

83+
### Name restrictions
84+
8385
Registries should consider enforcing limitations on package names added to
8486
their index. Cargo itself allows names with any [alphanumeric], `-`, or `_`
8587
characters. [crates.io] imposes its own limitations, including the following:
@@ -98,6 +100,14 @@ attacks](https://en.wikipedia.org/wiki/IDN_homograph_attack) and other
98100
concerns in [UTR36](https://www.unicode.org/reports/tr36/) and
99101
[UTS39](https://www.unicode.org/reports/tr39/).
100102

103+
### Version uniqueness
104+
105+
Indexes *must* ensure that each version only appears once for each package.
106+
This includes ignoring SemVer build metadata.
107+
For example, the index must *not* contain two entries with a version `1.0.7` and `1.0.7+extra`.
108+
109+
### JSON schema
110+
101111
Each line in a package file contains a JSON object that describes a published
102112
version of the package. The following is a pretty-printed example with comments
103113
explaining the format of the entry.

0 commit comments

Comments
 (0)