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

Add a deploy to heroku button and instructions on running a mirror! #440

Merged
merged 6 commits into from
Sep 26, 2016

Conversation

carols10cents
Copy link
Member

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! 👣


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
Copy link
Member Author

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.

Copy link
Member

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.

@alexcrichton
Copy link
Member

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",
Copy link
Member

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?

Copy link
Member Author

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.
@carols10cents
Copy link
Member Author

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

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

Thanks @carols10cents!

bors added a commit to rust-lang/cargo that referenced this pull request Sep 27, 2016
…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!
@carols10cents
Copy link
Member Author

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

@carols10cents carols10cents deleted the app-json branch September 27, 2016 13:03
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.

2 participants