Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for alternative crates.io registries in cargo #4036

Closed
wants to merge 2 commits into from

Conversation

cswindle
Copy link
Contributor

Currently, cargo supports crates.io and local registries, but not non-local non-crates.io registries (e.g. https://github.com/my_awesome_fork/crates.io-index) - see #3917. This PR adds support for such registries to cargo.

There are two main changes:

  1. You can now specify a registry index using the registry key in the packages section of Cargo.toml. When cargo publishing, cargo verifies that the host being published to matches the specified registry index.
  2. Dependencies can now have a registry specified. Cargo will look in that registry rather than crates.io for the dependencies with that key set.

A Cargo.toml using these features might look like:

[package] 
name = "registry-test" 
version = "0.1.0" 
authors = ["Christopher Swindle <[email protected]>"] 
registry = "https://github.com/my_awesome_fork/crates.io-index" 
 
[dependencies] 
libc = { version = "*", registry = "https://github.com/my_second_awesome_fork/crates.io-index" } 

We are also planning on pushing changes to the crates.io repo to allow setting up a private registry, but that requires tidying before we do so.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@cswindle
Copy link
Contributor Author

Is there a problem with continuous-integration/appveyor/branch, it does not seem to have started?

@alexcrichton
Copy link
Member

Thanks for the PR! Always exciting to see movement on this. I'm personally a little wary to see this merged, however, before we've got a more complete picture in our heads for what custom registries might look like. I fear that given the discussion on #3917 everyone's got a slightly different perception of what a custom registry will look like.

I personally feel like this feature to Cargo, when viewed from its entirety, may be deserving of an RFC in rust-lang/rfcs. I think that enough of the community would haven an opinion and like to give feedback that it's worth going through the process.

I'm curious, how would you feel about that?

@cswindle
Copy link
Contributor Author

Thanks for the update. I will sort out an RFC for this over the next few weeks.

@alexcrichton
Copy link
Member

Ok let me know if you need any help! I'm sure @carols10cents would be up for assisting here as well!

@carols10cents
Copy link
Member

Yes! I have thoughts and use cases, some of which I wrote up on #3917. I'm totally up for bouncing ideas around, thinking through implications of decisions on various workflows, answering questions, etc. However I can be helpful, please let me know!

@phrohdoh
Copy link

If I can help (code, discussion, review, etc) move this forward please ping me.
A non-crates.io registry is very relevant to my interests.

@cswindle
Copy link
Contributor Author

I have now created the RFC and sent in the pull request for review (rust-lang/rfcs#2006) so feel free to review/provide comments.

@alexcrichton
Copy link
Member

Thanks @cswindle! I'm gonna close this for now in favor of that RFC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants