-
Notifications
You must be signed in to change notification settings - Fork 601
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
Add a deploy to heroku button and instructions on running a mirror! #440
Conversation
|
||
3. Commit and push to wherever you will be hosting your index (ex: github, | ||
gitlab, an internal git server) | ||
4. In your cargo project, replace the crates.io source with your source by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crap this is still in nightly cargo only, isn't it... I'll look up the versions and specify them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah might be worth mentioning that as well as the dates it'll be released into stable Rust.
Thanks @carols10cents! Excited to see progress on this! I'll leave a few comments but otherwise I'm fine merging. |
"required": false | ||
}, | ||
"GIT_REPO_CHECKOUT": "./tmp/index-co", | ||
"GIT_REPO_URL": "https://github.com/rust-lang/crates.io-index.git", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This in theory needs to be the mirror of the index, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory, yes, and eventually it will need to be in practice, but for the moment it doesn't actually matter since client-side cargo is the only thing that uses the index. I'll update the instructions though so that people have it set for when we do start using it.
And that it requires the version of cargo that comes with currently-beta rustc 1.12.0.
And move that variable to the top and ones less likely to ever need to be set to the bottom.
Just realized that even if my PR gets merged, this won't be released with rustc for a while.
@alexcrichton : I updated the instructions to address all your comments, thank you!! 🎉 |
Thanks @carols10cents! |
…chton Make crates-io registry URL optional in config; ignore all changes to source.crates-io Hi! When I was working on the instructions for source replacement [in this crates.io PR](rust-lang/crates.io#440), I found that when I'm replacing `source.crates-io`, [I still have to specify some value for `registry`](https://github.com/rust-lang/crates.io/pull/440/files#diff-04c6e90faac2675aa89e2176d2eec7d8R177), or else I get this: ``` error: no source URL specified for `source.crates-io`, need either `registry` or `local-registry` defined ``` This seems weird and annoying to me: cargo definitely knows the registry URL for crates-io, and I'm trying to replace it anyway. So the first commit in this PR makes it optional, so that you don't have to specify a registry url for crates-io: it uses `SourceId::crates_io`, like it would if we didn't have any source configs at all. ~~The second commit in this PR might go too far, and/or might break existing uses of cargo, I'm not sure. In my opinion, `source.crates-io` should only be able to be replaced and never changed directly-- crates-io should always be crates-io, and I should be able to assume that in any project. So the second commit ignores all modifications to `source.crates-io`'s `registry`, `local-registry`, and `directory`, and warns that they're being ignored.~~ ~~I tried to search github to see if anyone was using these keys with `source.crates-io`, but since github's search ignores `.` (ARE YOU LISTENING GITHUB? I WOULD LIKE TO SEARCH WITH PUNCTUATION PLEASE), there's a lot of false positives to wade through. I didn't see anything in the first few pages though.~~ I'm happy to make whatever modifications to this!
YAAAYYYY!!! :) :) <3 <3 <3 |
I am able to install crates from a heroku instance created using this app.json, at https://cratesio-mirror.herokuapp.com/ !
I have an index mirror at https://gitlab.com/integer32llc/crates.io-index that I'm updating every 10 min. I tested out installing a crate through this index and my mirror server, updating that crate on crates.io, verifying that a
cargo update
does not see the update, waiting until my index fetches the changes, then getting the update with acargo update
run after that.It's still probably not doing what people would expect when they hear "mirror", so I tried to add clear caveats about what this does and does not do right now.
Again, this is a baby step in a series of baby steps I hope to help with, but I think it's a step worth taking! 👣