@@ -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" )
@@ -733,9 +733,19 @@ def update_submodules(self):
733
733
self .update_submodule (module [0 ], module [1 ], recorded_submodules )
734
734
print ("Submodules updated in %.2f seconds" % (time () - start_time ))
735
735
736
+ def set_normal_environment (self ):
737
+ """Set download URL for normal environment"""
738
+ if 'RUSTUP_DIST_SERVER' in os .environ :
739
+ self ._download_url = os .environ ['RUSTUP_DIST_SERVER' ]
740
+ else :
741
+ self ._download_url = 'https://static.rust-lang.org'
742
+
736
743
def set_dev_environment (self ):
737
744
"""Set download URL for development environment"""
738
- self ._download_url = 'https://dev-static.rust-lang.org'
745
+ if 'RUSTUP_DEV_DIST_SERVER' in os .environ :
746
+ self ._download_url = os .environ ['RUSTUP_DEV_DIST_SERVER' ]
747
+ else :
748
+ self ._download_url = 'https://dev-static.rust-lang.org'
739
749
740
750
def check_vendored_status (self ):
741
751
"""Check that vendoring is configured properly"""
@@ -828,6 +838,8 @@ def bootstrap(help_triggered):
828
838
829
839
if 'dev' in data :
830
840
build .set_dev_environment ()
841
+ else :
842
+ build .set_normal_environment ()
831
843
832
844
build .update_submodules ()
833
845
0 commit comments