@@ -121,9 +121,6 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
121121 . use_bolt ( use_bolt)
122122 . skipped_tests ( skipped_tests)
123123 . build ( ) ?;
124- with_log_group ( "Building rustc-perf" , || {
125- Ok :: < ( ) , anyhow:: Error > ( download_rustc_perf ( & env) ?)
126- } ) ?;
127124
128125 ( env, shared. build_args )
129126 }
@@ -139,17 +136,15 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
139136 . host_llvm_dir ( Utf8PathBuf :: from ( "/rustroot" ) )
140137 . artifact_dir ( Utf8PathBuf :: from ( "/tmp/tmp-multistage/opt-artifacts" ) )
141138 . build_dir ( checkout_dir. join ( "obj" ) )
139+ // /tmp/rustc-perf comes from the x64 dist Dockerfile
140+ . prebuilt_rustc_perf ( Some ( Utf8PathBuf :: from ( "/tmp/rustc-perf" ) ) )
142141 . shared_llvm ( true )
143142 . use_bolt ( true )
144143 . skipped_tests ( vec ! [
145144 // Fails because of linker errors, as of June 2023.
146145 "tests/ui/process/nofile-limit.rs" . to_string( ) ,
147146 ] )
148147 . build ( ) ?;
149- // /tmp/rustc-perf comes from the x64 dist Dockerfile
150- with_log_group ( "Building rustc-perf" , || {
151- Ok :: < ( ) , anyhow:: Error > ( copy_rustc_perf ( & env, Utf8Path :: new ( "/tmp/rustc-perf" ) ) ?)
152- } ) ?;
153148
154149 ( env, shared. build_args )
155150 }
@@ -173,10 +168,6 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
173168 ] )
174169 . build ( ) ?;
175170
176- with_log_group ( "Building rustc-perf" , || {
177- Ok :: < ( ) , anyhow:: Error > ( download_rustc_perf ( & env) ?)
178- } ) ?;
179-
180171 ( env, shared. build_args )
181172 }
182173 } ;
@@ -190,6 +181,11 @@ fn execute_pipeline(
190181) -> anyhow:: Result < ( ) > {
191182 reset_directory ( & env. artifact_dir ( ) ) ?;
192183
184+ with_log_group ( "Building rustc-perf" , || match env. prebuilt_rustc_perf ( ) {
185+ Some ( dir) => copy_rustc_perf ( env, & dir) ,
186+ None => download_rustc_perf ( env) ,
187+ } ) ?;
188+
193189 // Stage 1: Build PGO instrumented rustc
194190 // We use a normal build of LLVM, because gathering PGO profiles for LLVM and `rustc` at the
195191 // same time can cause issues, because the host and in-tree LLVM versions can diverge.
0 commit comments