@@ -121,9 +121,6 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
121
121
. use_bolt ( use_bolt)
122
122
. skipped_tests ( skipped_tests)
123
123
. build ( ) ?;
124
- with_log_group ( "Building rustc-perf" , || {
125
- Ok :: < ( ) , anyhow:: Error > ( download_rustc_perf ( & env) ?)
126
- } ) ?;
127
124
128
125
( env, shared. build_args )
129
126
}
@@ -139,17 +136,15 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
139
136
. host_llvm_dir ( Utf8PathBuf :: from ( "/rustroot" ) )
140
137
. artifact_dir ( Utf8PathBuf :: from ( "/tmp/tmp-multistage/opt-artifacts" ) )
141
138
. 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" ) ) )
142
141
. shared_llvm ( true )
143
142
. use_bolt ( true )
144
143
. skipped_tests ( vec ! [
145
144
// Fails because of linker errors, as of June 2023.
146
145
"tests/ui/process/nofile-limit.rs" . to_string( ) ,
147
146
] )
148
147
. 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
- } ) ?;
153
148
154
149
( env, shared. build_args )
155
150
}
@@ -173,10 +168,6 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
173
168
] )
174
169
. build ( ) ?;
175
170
176
- with_log_group ( "Building rustc-perf" , || {
177
- Ok :: < ( ) , anyhow:: Error > ( download_rustc_perf ( & env) ?)
178
- } ) ?;
179
-
180
171
( env, shared. build_args )
181
172
}
182
173
} ;
@@ -190,6 +181,11 @@ fn execute_pipeline(
190
181
) -> anyhow:: Result < ( ) > {
191
182
reset_directory ( & env. artifact_dir ( ) ) ?;
192
183
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
+
193
189
// Stage 1: Build PGO instrumented rustc
194
190
// We use a normal build of LLVM, because gathering PGO profiles for LLVM and `rustc` at the
195
191
// same time can cause issues, because the host and in-tree LLVM versions can diverge.
0 commit comments