@@ -320,7 +320,7 @@ class RustBuild(object):
320
320
def __init__ (self ):
321
321
self .cargo_channel = ''
322
322
self .date = ''
323
- self ._download_url = 'https://static.rust-lang.org '
323
+ self ._download_url = ''
324
324
self .rustc_channel = ''
325
325
self .build = ''
326
326
self .build_dir = os .path .join (os .getcwd (), "build" )
@@ -731,9 +731,19 @@ def update_submodules(self):
731
731
self .update_submodule (module [0 ], module [1 ], recorded_submodules )
732
732
print ("Submodules updated in %.2f seconds" % (time () - start_time ))
733
733
734
+ def set_normal_environment (self ):
735
+ """Set download URL for normal environment"""
736
+ if 'RUSTUP_DIST_SERVER' in os .environ :
737
+ self ._download_url = os .environ ['RUSTUP_DIST_SERVER' ]
738
+ else :
739
+ self ._download_url = 'https://static.rust-lang.org'
740
+
734
741
def set_dev_environment (self ):
735
742
"""Set download URL for development environment"""
736
- self ._download_url = 'https://dev-static.rust-lang.org'
743
+ if 'RUSTUP_DEV_DIST_SERVER' in os .environ :
744
+ self ._download_url = os .environ ['RUSTUP_DEV_DIST_SERVER' ]
745
+ else :
746
+ self ._download_url = 'https://dev-static.rust-lang.org'
737
747
738
748
def check_vendored_status (self ):
739
749
"""Check that vendoring is configured properly"""
@@ -826,6 +836,8 @@ def bootstrap(help_triggered):
826
836
827
837
if 'dev' in data :
828
838
build .set_dev_environment ()
839
+ else :
840
+ build .set_normal_environment ()
829
841
830
842
build .update_submodules ()
831
843
0 commit comments