Skip to content

Commit 743efe4

Browse files
authored
Merge pull request #2301 from sfackler/alt-registries-tweaks
Update RFC 2141
2 parents c892139 + 203c644 commit 743efe4

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

text/2141-alternative-registries.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,15 @@ A valid registry index meets the following criteria:
182182

183183
```json
184184
{
185-
"dl": "https://my-crates-server.com/api/v1/crates",
185+
"dl": "https://my-crates-server.com/api/v1/crates/{crate}/{version}/download",
186186
"api": "https://my-crates-server.com/",
187187
"allowed-registries": ["https://github.com/rust-lang/crates.io-index", "https://my-intranet:8080/index"]
188188
}
189189
```
190190

191-
The `dl` key is required specifies where Cargo can download the tarballs containing the source
192-
files of the crates listed in the registry.
191+
The `dl` key is required and specifies where Cargo can download the tarballs containing the source
192+
files of the crates listed in the registry. It is templated by the strings `{crate}` and
193+
`{version}` which are replaced with the name and version of the crate to download, respectively.
193194

194195
The `api` key is optional and specifies where Cargo can find the API server that provides the
195196
same API functionality that crates.io does today, such as publishing and searching. Without the
@@ -205,7 +206,9 @@ A valid registry index meets the following criteria:
205206
- There will be a number of directories in the git repository.
206207
- `1/` - holds files for all crates whose names have one letter.
207208
- `2/` - holds files for all crates whose names have two letters.
208-
- `3/` - holds files for all crates whose names have three letters.
209+
- `3/a` etc - for all crates whose names have three letters, their files will
210+
be in a directory named `3`, then a subdirectory named with the first letter
211+
of their name.
209212
- `aa/aa/` etc - for all crates whose names have four or more letters, their
210213
files will be in a directory named with the first and second letters of
211214
their name, then in a subdirectory named with the third and fourth letters
@@ -270,7 +273,9 @@ A valid registry index meets the following criteria:
270273
- `default_features`: whether the parent uses the default features of this dependency or not
271274
- `target`: on which target this dependency is needed
272275
- `kind`: can be `normal`, `build`, or `dev` to be a regular dependency, a build-time
273-
dependency, or a development dependency
276+
dependency, or a development dependency. Note: this is a required field, but a small number of
277+
entries exist in the crates.io index with either a missing or null `kind` field due to
278+
implementation bugs.
274279

275280
If a dependency's registry is not specified, Cargo will assume the dependency can be located in the
276281
current registry. By specifying the registry of a dependency in the index, cargo will have the

0 commit comments

Comments
 (0)