@@ -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
fn is_try_build ( ) -> bool {
@@ -191,6 +195,26 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
191
195
192
196
( env, shared. build_args )
193
197
}
198
+ EnvironmentCmd :: MacCi { shared } => {
199
+ let target_triple =
200
+ std:: env:: var ( "PGO_HOST" ) . expect ( "PGO_HOST environment variable missing" ) ;
201
+
202
+ let checkout_dir: Utf8PathBuf = std:: env:: current_dir ( ) ?. try_into ( ) ?;
203
+ let env = EnvironmentBuilder :: default ( )
204
+ . host_tuple ( target_triple)
205
+ . python_binary ( "python3" . to_string ( ) )
206
+ . checkout_dir ( checkout_dir. clone ( ) )
207
+ . host_llvm_dir ( "/opt/homebrew/Cellar/llvm/20.1.2" . into ( ) )
208
+ . artifact_dir ( checkout_dir. join ( "opt-artifacts" ) )
209
+ . build_dir ( checkout_dir)
210
+ . shared_llvm ( false )
211
+ . use_bolt ( false )
212
+ . run_tests ( false )
213
+ . skipped_tests ( vec ! [ ] )
214
+ . build ( ) ?;
215
+
216
+ ( env, shared. build_args )
217
+ }
194
218
} ;
195
219
Ok ( ( env, args) )
196
220
}
@@ -250,6 +274,9 @@ fn execute_pipeline(
250
274
// Here we build a PGO instrumented LLVM, reusing the previously PGO optimized rustc.
251
275
// Then we use the instrumented LLVM to gather LLVM PGO profiles.
252
276
let llvm_pgo_profile = timer. section ( "Stage 2 (LLVM PGO)" , |stage| {
277
+ if 1 + 1 == 2 {
278
+ return Err ( anyhow:: anyhow!( "disabled" ) ) ;
279
+ }
253
280
// Remove the previous, uninstrumented build of LLVM.
254
281
clear_llvm_files ( env) ?;
255
282
@@ -272,7 +299,7 @@ fn execute_pipeline(
272
299
clear_llvm_files ( env) ?;
273
300
274
301
Ok ( profile)
275
- } ) ? ;
302
+ } ) ;
276
303
277
304
let bolt_profiles = if env. use_bolt ( ) {
278
305
// Stage 3: Build BOLT instrumented LLVM
@@ -284,7 +311,7 @@ fn execute_pipeline(
284
311
stage. section ( "Build PGO optimized LLVM" , |stage| {
285
312
Bootstrap :: build ( env)
286
313
. with_llvm_bolt_ldflags ( )
287
- . llvm_pgo_optimize ( & llvm_pgo_profile)
314
+ . llvm_pgo_optimize ( & llvm_pgo_profile? )
288
315
. avoid_rustc_rebuild ( )
289
316
. run ( stage)
290
317
} ) ?;
@@ -336,7 +363,6 @@ fn execute_pipeline(
336
363
} ;
337
364
338
365
let mut dist = Bootstrap :: dist ( env, & dist_args)
339
- . llvm_pgo_optimize ( & llvm_pgo_profile)
340
366
. rustc_pgo_optimize ( & rustc_pgo_profile)
341
367
. avoid_rustc_rebuild ( ) ;
342
368
0 commit comments