@@ -2,6 +2,8 @@ export build_tarballs, autobuild, build, get_meta_json
22import GitHub: gh_get_json, DEFAULT_API
33import SHA: sha256, sha1
44using TOML, Dates, UUIDs
5+ using TimerOutputs: @timeit , print_timer
6+ using BinaryBuilderBase: BBB_TIMER, reset_bbb_timer!
57using RegistryTools
68import LibGit2
79import PkgLicenses
@@ -193,6 +195,7 @@ function build_tarballs(ARGS, src_name, src_version, sources, script,
193195 compression_format:: String = " gzip" ,
194196 kwargs... )
195197 @nospecialize
198+ reset_bbb_timer! ()
196199 # See if someone has passed in `--help`, and if so, give them the
197200 # assistance they so clearly long for
198201 if " --help" in ARGS
@@ -441,6 +444,8 @@ function build_tarballs(ARGS, src_name, src_version, sources, script,
441444 upload_to_github_releases (deploy_bin_repo, tag, products_dir; verbose= verbose)
442445 end
443446
447+ print_timer (BBB_TIMER; sortby= :firstexec )
448+ println ()
444449 return build_output_meta
445450end
446451
@@ -836,13 +841,14 @@ function autobuild(dir::AbstractString,
836841 end
837842
838843 # We must prepare our sources. Download them, hash them, etc...
839- source_files = download_source .(sources; verbose= verbose)
844+ source_files = @timeit BBB_TIMER " Downloading sources " download_source .(sources; verbose= verbose)
840845
841846 # Our build products will go into ./products
842847 out_path = joinpath (dir, " products" )
843848 try mkpath (out_path) catch ; end
844849
845850 for platform in sort (collect (platforms), by = triplet)
851+ @timeit BBB_TIMER " Building for $(triplet (platform)) " begin
846852 timer = BuildTimer ()
847853 timer. begin_setup = time ()
848854
@@ -928,7 +934,7 @@ function autobuild(dir::AbstractString,
928934 """
929935
930936 dest_prefix = Prefix (BinaryBuilderBase. destdir (prefix. path, concrete_platform))
931- did_succeed = with_logfile (dest_prefix, " $(src_name) .log" ; subdir= src_name) do io
937+ did_succeed = @timeit BBB_TIMER " Running build script " with_logfile (dest_prefix, " $(src_name) .log" ; subdir= src_name) do io
932938 # Let's start the presentations with BinaryBuilder.jl
933939 write (io, " BinaryBuilder.jl version: $(get_bb_version ()) \n\n " )
934940 # Get the list of compilers...
@@ -959,6 +965,7 @@ function autobuild(dir::AbstractString,
959965 # Run an audit of the prefix to ensure it is properly relocatable
960966 timer. begin_audit = time ()
961967 if ! skip_audit
968+ @timeit BBB_TIMER " Auditing build artifacts" begin
962969 audit_result = audit (dest_prefix, src_name;
963970 platform= platform, verbose= verbose,
964971 has_csl = any (getname .(dependencies) .== " CompilerSupportLibraries_jll" ),
@@ -971,6 +978,7 @@ function autobuild(dir::AbstractString,
971978 """ , ' \n ' => ' ' )
972979 error (strip (msg))
973980 end
981+ end # @timeit audit
974982 end
975983 timer. end_audit = time ()
976984
@@ -1075,6 +1083,7 @@ function autobuild(dir::AbstractString,
10751083 rm (build_path; recursive= true )
10761084 end
10771085 verbose && @info " $(timer) "
1086+ end # @timeit platform
10781087 end
10791088
10801089 # Return our product hashes
0 commit comments