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鈥檒l 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

Merged
merged 6 commits into from Sep 26, 2016

Conversation

Projects
None yet
2 participants
@carols10cents
Copy link
Member

carols10cents commented Sep 10, 2016

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 a cargo 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! 馃懀

README.md Outdated

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

This comment has been minimized.

@carols10cents

carols10cents Sep 13, 2016

Member

Crap this is still in nightly cargo only, isn't it... I'll look up the versions and specify them.

This comment has been minimized.

@alexcrichton

alexcrichton Sep 14, 2016

Member

Ah yeah might be worth mentioning that as well as the dates it'll be released into stable Rust.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Sep 14, 2016

Thanks @carols10cents! Excited to see progress on this! I'll leave a few comments but otherwise I'm fine merging.

app.json Outdated
"required": false
},
"GIT_REPO_CHECKOUT": "./tmp/index-co",
"GIT_REPO_URL": "https://github.com/rust-lang/crates.io-index.git",

This comment has been minimized.

@alexcrichton

alexcrichton Sep 14, 2016

Member

This in theory needs to be the mirror of the index, right?

This comment has been minimized.

@carols10cents

carols10cents Sep 21, 2016

Member

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.

app.json Outdated
"url": "https://github.com/rcaught/heroku-buildpack-cmake"
},
{
"url": "https://github.com/alexcrichton/heroku-buildpack-rust"

This comment has been minimized.

@alexcrichton

alexcrichton Sep 14, 2016

Member

I wonder, can revisions be specified here as well?

This comment has been minimized.

@carols10cents

carols10cents Sep 21, 2016

Member

They can indeed! I will do so!

README.md Outdated
@@ -121,3 +121,62 @@ For more information on using ember-cli, visit

For more information on using cargo, visit
[doc.crates.io](http://doc.crates.io/).

## Deploy a read-only, download-API-only mirror

This comment has been minimized.

@alexcrichton

alexcrichton Sep 14, 2016

Member

Could this section perhaps also mention that this is a work-in-progress? Ideally we'd make all deployment a one-click operation, but hopefully coming soon!

carols10cents added some commits Sep 21, 2016

Add disclaimers that mirror deployment is a work-in-progress
And that it requires the version of cargo that comes with currently-beta
rustc 1.12.0.
Add instructions to set GIT_REPO_URL env var
And move that variable to the top and ones less likely to ever need to
be set to the bottom.
Leave registry URL for replaced source in cargo config instructions
Just realized that even if my PR gets merged, this won't be released
with rustc for a while.
@carols10cents

This comment has been minimized.

Copy link
Member

carols10cents commented Sep 21, 2016

@alexcrichton : I updated the instructions to address all your comments, thank you!! 馃帀

@alexcrichton alexcrichton merged commit 2fb4e73 into rust-lang:master Sep 26, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Sep 26, 2016

Thanks @carols10cents!

bors added a commit to rust-lang/cargo that referenced this pull request Sep 27, 2016

Auto merge of #3089 - carols10cents:crates-io-registry-url, r=alexcri鈥
鈥hton

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!
@carols10cents

This comment has been minimized.

Copy link
Member

carols10cents commented Sep 27, 2016

YAAAYYYY!!! :) :) <3 <3 <3

@carols10cents carols10cents deleted the integer32llc:app-json branch Sep 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment