@@ -66,7 +66,7 @@ def download(path, url, probably_big, verbose):
66
66
def _download (path , url , probably_big , verbose , exception ):
67
67
if probably_big or verbose :
68
68
print ("downloading {}" .format (url ))
69
- # see http://serverfault.com/questions/301128/how-to-download
69
+ # See http://serverfault.com/questions/301128/how-to-download.
70
70
if sys .platform == 'win32' :
71
71
run (["PowerShell.exe" , "/nologo" , "-Command" ,
72
72
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;" ,
@@ -79,7 +79,7 @@ def _download(path, url, probably_big, verbose, exception):
79
79
else :
80
80
option = "-s"
81
81
run (["curl" , option ,
82
- "-y" , "30" , "-Y" , "10" , # timeout if speed is < 10 bytes/sec for > 30 seconds
82
+ "-y" , "30" , "-Y" , "10" , # timeout if speed is < 10 bytes/sec for > 30 seconds
83
83
"--connect-timeout" , "30" , # timeout if cannot connect within 30 seconds
84
84
"--retry" , "3" , "-Sf" , "-o" , path , url ],
85
85
verbose = verbose ,
@@ -131,7 +131,7 @@ def run(args, verbose=False, exception=False, **kwargs):
131
131
if verbose :
132
132
print ("running: " + ' ' .join (args ))
133
133
sys .stdout .flush ()
134
- # Use Popen here instead of call() as it apparently allows powershell on
134
+ # Use ` Popen` here instead of ` call()` as it apparently allows powershell on
135
135
# Windows to not lock up waiting for input presumably.
136
136
ret = subprocess .Popen (args , ** kwargs )
137
137
code = ret .wait ()
@@ -660,6 +660,7 @@ def bootstrap_binary(self):
660
660
661
661
def build_bootstrap (self ):
662
662
"""Build bootstrap"""
663
+
663
664
build_dir = os .path .join (self .build_dir , "bootstrap" )
664
665
if self .clean and os .path .exists (build_dir ):
665
666
shutil .rmtree (build_dir )
@@ -680,7 +681,7 @@ def build_bootstrap(self):
680
681
env ["LIBRARY_PATH" ] = os .path .join (self .bin_root (), "lib" ) + \
681
682
(os .pathsep + env ["LIBRARY_PATH" ]) \
682
683
if "LIBRARY_PATH" in env else ""
683
- # preserve existing RUSTFLAGS
684
+ # Preserve existing ` RUSTFLAGS`.
684
685
env .setdefault ("RUSTFLAGS" , "" )
685
686
env ["RUSTFLAGS" ] += " -Cdebuginfo=2"
686
687
@@ -748,7 +749,7 @@ def update_submodule(self, module, checked_out, recorded_submodules):
748
749
"--init" , "--recursive" , "--progress" , module ],
749
750
cwd = self .rust_root , verbose = self .verbose , exception = True )
750
751
except RuntimeError :
751
- # Some versions of git don't support --progress.
752
+ # Some versions of Git don't support ` --progress` .
752
753
run (["git" , "submodule" , "update" ,
753
754
"--init" , "--recursive" , module ],
754
755
cwd = self .rust_root , verbose = self .verbose )
@@ -763,7 +764,7 @@ def update_submodules(self):
763
764
self .get_toml ('submodules' ) == "false" :
764
765
return
765
766
766
- # check the existence of ' git' command
767
+ # Check for the existence of the ` git` executable.
767
768
try :
768
769
subprocess .check_output (['git' , '--version' ])
769
770
except (subprocess .CalledProcessError , OSError ):
@@ -878,7 +879,7 @@ def bootstrap(help_triggered):
878
879
args = [a for a in sys .argv if a != '-h' and a != '--help' ]
879
880
args , _ = parser .parse_known_args (args )
880
881
881
- # Configure initial bootstrap
882
+ # Configure initial bootstrap.
882
883
build = RustBuild ()
883
884
build .rust_root = args .src or os .path .abspath (os .path .join (__file__ , '../../..' ))
884
885
build .verbose = args .verbose
@@ -944,7 +945,7 @@ def main():
944
945
"""Entry point for the bootstrap process"""
945
946
start_time = time ()
946
947
947
- # x.py help <cmd> ...
948
+ # ` x.py help <cmd> ...`
948
949
if len (sys .argv ) > 1 and sys .argv [1 ] == 'help' :
949
950
sys .argv = [sys .argv [0 ], '-h' ] + sys .argv [2 :]
950
951
0 commit comments