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

RFC for support of alternate registries in cargo #2006

Closed
wants to merge 7 commits into from
11 changes: 11 additions & 0 deletions text/0000-alternate-registries.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ so we propose relaxing a check which ensures that the source for a dependency ma
registry. We propose that this only performs the check only if the dependency is not the
default registry, thus allowing private crates to reference public crates on crates.io.

## Making it easier for users using an alternate crates.io registry
When a user selects a specific crate the Cargo.toml fragment would be updated to include the
registry URL, thus allowing users to easily copy and paste into their projects Cargo.toml
file.

# How We Teach This
[how-we-teach-this]: #how-we-teach-this

Expand All @@ -102,6 +107,12 @@ plus has the ability to have crates pushed to it, however this has the following
* It requires crates.io to be able to combine two registries, or requires a radical change to the way crates.io works
* The current proposal could be extended to support this, if a caching server is added at a later stage

## Including registry definitions in a global location
We considered using a global configuration file (eg ~/.cargo/config) to allow a registry to

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think broad "we believe" statements like this are as truthful as they could be.

Future readers will no doubt read this as something everyone in this discussion agreed on which isn't the case.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, that was a reflection of discussions that I had within our company prior to submitting the RFC, not intended as a full reflection of the discussion here as I thought it would be useful to include.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cargo will look up the directory tree for .cargo/config files, so it is possible to have, for example, ~/some/path/my-project/.cargo/config rather than globally.

I think Cargo.toml is a better place for this information since it's intended to be checked in and shared while .cargo/config files are meant to be ignored and personal, but I wanted to make sure you knew about .cargo/config being an option.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know they can, but I just think that logically they belong in the Cargo.toml for the use cases I am trying to solve.

be specified, however this was ruled out on the basis that we believe that the registry to
use for dependencies is tightly linked to the project and hence it would be wrong to move
this into global configuration.

# Unresolved questions
[unresolved]: #unresolved-questions
As mentioned in the design section, this does not answer all of the questions for
Expand Down