Open
Description
This issue is a tracker for updating crates.io to support binary dependencies. I'm not sure when we should pull the trigger to add this, since this is not a reversible decision.
#12421 added support for bindeps in a registry. This requires adding 3 new fields to the index for dependencies, as well as the publish protocol.
Copying my notes from #10405, but I think these are now outdated. However, the general gist should still be the same.
Update crates.io
This should be done later, closer to when we are gearing up to stabilize bindeps. Adding the fields to the index is a permanent decision, so we need to be sure it has the right design.
- Add fields to
EncodableCrateDependency
, this is the structure it receives from cargo. - Add fields to
Dependency
, this is the structure it uses for serializing to the index. - The
v
field here needs to be set to 3 if it contains a dependency with an artifact dependency. (See commentary above about possibly passing thev
field in via the JSON API so that a registry does not need to process it.) - Consider adding some input validation. For example, it may want to put limits on the lengths of strings. I don't think it needs to otherwise be very restrictive, but crates.io people may have further ideas.
- Add the appropriate tests. I think it would go somewhere in
src/tests/krate/publish.rs
. - Consider whether or not the artifact information should be displayed on the website. If the crates.io team would like to track this information, then it would also need to be stored in the database (which means also doing a schema update). The model is defined around here. I am no expert in diesel, so I can't provide much more guidance here. Talk with the crates.io team to see if this is something desired.