File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1010
1111import argparse
1212import contextlib
13+ import datetime
1314import hashlib
1415import os
1516import shutil
1819import tarfile
1920import tempfile
2021
22+ from time import time
23+
2124
2225def get (url , path , verbose = False ):
2326 sha_url = url + ".sha256"
@@ -118,6 +121,9 @@ def stage0_data(rust_root):
118121 data [a ] = b
119122 return data
120123
124+ def format_build_time (duration ):
125+ return str (datetime .timedelta (seconds = int (duration )))
126+
121127class RustBuild :
122128 def download_stage0 (self ):
123129 cache_dst = os .path .join (self .build_dir , "cache" )
@@ -372,6 +378,8 @@ def main():
372378 rb ._rustc_channel , rb ._rustc_date = data ['rustc' ].split ('-' , 1 )
373379 rb ._cargo_channel , rb ._cargo_date = data ['cargo' ].split ('-' , 1 )
374380
381+ start_time = time ()
382+
375383 # Fetch/build the bootstrap
376384 rb .build = rb .build_triple ()
377385 rb .download_stage0 ()
@@ -390,5 +398,9 @@ def main():
390398 env ["BOOTSTRAP_PARENT_ID" ] = str (os .getpid ())
391399 rb .run (args , env )
392400
401+ end_time = time ()
402+
403+ print ("Build completed in %s" % format_build_time (end_time - start_time ))
404+
393405if __name__ == '__main__' :
394406 main ()
You can’t perform that action at this time.
0 commit comments