@@ -109,6 +109,10 @@ enum EnvironmentCmd {
109
109
#[ clap( flatten) ]
110
110
shared : SharedArgs ,
111
111
} ,
112
+ MacCi {
113
+ #[ clap( flatten) ]
114
+ shared : SharedArgs ,
115
+ }
112
116
}
113
117
114
118
/// For a fast try build, we want to only build the bare minimum of components to get a
@@ -197,6 +201,26 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
197
201
198
202
( env, shared. build_args )
199
203
}
204
+ EnvironmentCmd :: MacCi { shared } => {
205
+ let target_triple =
206
+ std:: env:: var ( "PGO_HOST" ) . expect ( "PGO_HOST environment variable missing" ) ;
207
+
208
+ let checkout_dir: Utf8PathBuf = std:: env:: current_dir ( ) ?. try_into ( ) ?;
209
+ let env = EnvironmentBuilder :: default ( )
210
+ . host_tuple ( target_triple)
211
+ . python_binary ( "python3" . to_string ( ) )
212
+ . checkout_dir ( checkout_dir. clone ( ) )
213
+ . host_llvm_dir ( "/opt/homebrew/Cellar/llvm/20.1.2" . into ( ) )
214
+ . artifact_dir ( checkout_dir. join ( "opt-artifacts" ) )
215
+ . build_dir ( checkout_dir)
216
+ . shared_llvm ( false )
217
+ . use_bolt ( false )
218
+ . run_tests ( false )
219
+ . skipped_tests ( vec ! [ ] )
220
+ . build ( ) ?;
221
+
222
+ ( env, shared. build_args )
223
+ }
200
224
} ;
201
225
Ok ( ( env, args) )
202
226
}
@@ -256,6 +280,9 @@ fn execute_pipeline(
256
280
// Here we build a PGO instrumented LLVM, reusing the previously PGO optimized rustc.
257
281
// Then we use the instrumented LLVM to gather LLVM PGO profiles.
258
282
let llvm_pgo_profile = timer. section ( "Stage 2 (LLVM PGO)" , |stage| {
283
+ if 1 + 1 == 2 {
284
+ return Err ( anyhow:: anyhow!( "disabled" ) ) ;
285
+ }
259
286
// Remove the previous, uninstrumented build of LLVM.
260
287
clear_llvm_files ( env) ?;
261
288
@@ -278,7 +305,7 @@ fn execute_pipeline(
278
305
clear_llvm_files ( env) ?;
279
306
280
307
Ok ( profile)
281
- } ) ? ;
308
+ } ) ;
282
309
283
310
let bolt_profiles = if env. use_bolt ( ) {
284
311
// Stage 3: Build BOLT instrumented LLVM
@@ -290,7 +317,7 @@ fn execute_pipeline(
290
317
stage. section ( "Build PGO optimized LLVM" , |stage| {
291
318
Bootstrap :: build ( env)
292
319
. with_llvm_bolt_ldflags ( )
293
- . llvm_pgo_optimize ( & llvm_pgo_profile)
320
+ . llvm_pgo_optimize ( & llvm_pgo_profile? )
294
321
. avoid_rustc_rebuild ( )
295
322
. run ( stage)
296
323
} ) ?;
@@ -342,7 +369,6 @@ fn execute_pipeline(
342
369
} ;
343
370
344
371
let mut dist = Bootstrap :: dist ( env, & dist_args)
345
- . llvm_pgo_optimize ( & llvm_pgo_profile)
346
372
. rustc_pgo_optimize ( & rustc_pgo_profile)
347
373
. avoid_rustc_rebuild ( ) ;
348
374
0 commit comments