Skip to content

Conversation

hjiayz
Copy link

@hjiayz hjiayz commented Jan 7, 2017

windows:
set RUST_DIST_URL_REPLACE=https://pkgserver.com/path/=http://pkgmirror.com/path/
linux:
export RUST_DIST_URL_REPLACE=https://pkgserver.com/path/=http://pkgmirror.com/path/

Signed-off-by: hjiayz [email protected]

@hjiayz hjiayz changed the title add environment variable RUST_DIST_URL_RELPACE for pkg mirror add environment variable RUST_DIST_URL_REPLACE for pkg mirror Jan 7, 2017
@brson
Copy link
Contributor

brson commented Jan 24, 2017

Thanks for the patch @hjiayz, and sorry for taking so long to get back to you.

Out of curiosity, can you say more about what you will use this for? Is it to replace HTTPS with HTTP per your example?

I guess I can't see an obvious reason not to do this, except that this is the third solution yet for replacing URLs in the manifests. I'll think about it a bit and make a decision tomorrow.

@Diggsey
Copy link
Contributor

Diggsey commented May 17, 2017

@brson Did you come to a decision?

@brson
Copy link
Contributor

brson commented Jun 9, 2017

@Diggsey My current inclination is that without further evidence of demand, or indication of the use cases, I'd rather not move on something like this yet.

As formulated here, this allows one to locate the binaries on some third-party server, while the manifests remain on the official server, or possibly this is combined with RUSTUP_DIST_SERVER in order to redirect both manifests and the bins. Feels a bit awkward.

If the use case is for mirroring static.rust-lang.org, then I might expect a tool that does that mirroring while rewriting the manifests to contain the correct urls and rebuilding the manifest hashes. Maybe, though rewriting the manifests and changing the hashes seems pretty suspicious from a security perspective. Maybe the manifest format is just wrong and shouldn't contain absolute URLs.

The issue of mirroring static.rust-lang.org is particularly important for the Chinese Rust community, and does need a solution.

@brson
Copy link
Contributor

brson commented Jun 9, 2017

It does seem like RUSTUP_DIST_SERVER does this same replacement. That is, if you download the manifest from a mirror using RUSTUP_DIST_SERVER, rustup will also download the bins from that mirror. So this solution must be only for cases where the manifest is on a different server?

@bors
Copy link
Contributor

bors commented Jun 10, 2017

☔ The latest upstream changes (presumably #1148) made this pull request unmergeable. Please resolve the merge conflicts.

@hjiayz hjiayz closed this Oct 28, 2017
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.

4 participants