-
Notifications
You must be signed in to change notification settings - Fork 892
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
Change upstream via $RUSTUP_DIST_SERVER #521
Conversation
Thanks for the PR. This is an important consideration. I'm a little worried about the proliferation of these env vars that modify the download. It seems to me that most people would expect setting |
I agree we should be using |
@brson @Diggsey Is it acceptable to change the value of |
I agree with @brson that this may be one too may be one too many config variables, I'd expect solutions here along the lines of:
|
@alexcrichton IMO, this is a case that should be handled by What do you think? |
In my mind the purpose of the manifest is just metadata for the distribution, so it's fine for that to get modified somewhat arbitrarily. (i.e. I'd probably still personally go towards that route) |
It does make it more difficult to create a mirror though. Couldn't we just avoid the problem by using relative paths in the manifest files? |
This is a good point. The manifest already contains It's worth noting that I expect there to eventually be functionality to merge external manifests into the manifest definition, so e.g. @steveklabnik can publish intermezzos bins that work with the normal toolchain. Those manifests would point to resources on a different servo. I consider that use case pretty niche though and don't anticipate problematic interactions with this URL-replacement feature. |
Yes. Possibly. I recall that @alexcrichton and I discussed this and made the conscious decision to use full paths, but don't recall why. Using relative paths would have strange interactions with the above feature I mentioned where we might merge two different manifests from two different sources. |
I wouldn't mind switching to a different variable as the one source of configuration, I largely just wouldn't want to have quite a large myriad of ways to configure rustup. |
c8723d5
to
a4aa240
Compare
I have updated my code, replacing the urls with |
@Diggsey @alexcrichton @brson |
Any progress? |
Thanks for the updates @knight42. I'm glad you left the backwards-compatibility code in. Good idea. I'd prefer if the loading of Would you also change the use of I'd still like to see what @Diggsey thinks of this solution since he created the |
I'm for this: the deviation from |
Add public member `dist_server: String` For the convenience of modifying the urls written in manifests, since the update functions can only access `temp_cfg`. In addition, the constructor function of `temp_cfg` accepts an additional `dist_root_server` now.
Add two public members to `struct Cfg`: `dist_root_url: String` `dist_root_server: String` The reason I changed the type of `dist_root_url` from Cow<str> to String is that I have to modify the original str and using String seems a bit handier.
c8e5a4b
to
98b7286
Compare
6ff67a2
to
9763334
Compare
@@ -93,7 +107,8 @@ impl Cfg { | |||
gpg_key: gpg_key, | |||
notify_handler: notify_handler, | |||
env_override: env_override, | |||
dist_root_url: dist_root_url, | |||
dist_root_url: dist_root, |
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 patch looks great now, but is it possible to remove this dist_root_url
field completely? Looks like it's mainly used by rustup_dist::dist
, so that module can just be changed to append "/dist".
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.
@brson BTW, AppVeyor is goddamn slow 💔 |
@knight42 Yeah, free accounts have zero parallelism, so the builds have to run sequentially. |
Could this be merged now? |
Thanks so much @knight42! |
cc #1467 |
The downloads from the original https://static.rust-lang.org/ are rather slow in some regions, e.g. China. It is reasonable to enable users to choose other mirror sites.
Besides, I doubt that setting
RUSTUP_DIST_ROOT
is able to alter the root URL for downloading Rust toolchains and updates, since the urls written in the manifest files are still something likehttps://static.rust-lang.org/dist/2016-05-24/rust-1.9.0-aarch64-unknown-linux-gnu.tar.gz
, which makes no difference.