@@ -208,6 +208,49 @@ def supports_bolt(self) -> bool:
208
208
return False
209
209
210
210
211
+ class DarwinPipeline (Pipeline ):
212
+ def __init__ (self ):
213
+ self .checkout_dir = Path (os .getcwd ())
214
+
215
+ def checkout_path (self ) -> Path :
216
+ return self .checkout_dir
217
+
218
+ def downloaded_llvm_dir (self ) -> Path :
219
+ return self .checkout_path () / "citools" / "clang-rust"
220
+
221
+ def build_root (self ) -> Path :
222
+ return self .checkout_path ()
223
+
224
+ def opt_artifacts (self ) -> Path :
225
+ return Path ("/tmp/tmp-multistage/opt-artifacts" )
226
+
227
+ def build_rustc_perf (self ):
228
+ # rustc-perf version from 2022-07-22
229
+ perf_commit = "3c253134664fdcba862c539d37f0de18557a9a4c"
230
+ rustc_perf_zip_path = self .opt_artifacts () / "perf.zip"
231
+
232
+ def download_rustc_perf ():
233
+ download_file (
234
+ f"https://github.com/rust-lang/rustc-perf/archive/{ perf_commit } .zip" ,
235
+ rustc_perf_zip_path
236
+ )
237
+ with change_cwd (self .opt_artifacts ()):
238
+ unpack_archive (rustc_perf_zip_path )
239
+ move_path (Path (f"rustc-perf-{ perf_commit } " ), self .rustc_perf_dir ())
240
+ delete_file (rustc_perf_zip_path )
241
+
242
+ retry_action (download_rustc_perf , "Download rustc-perf" )
243
+
244
+ with change_cwd (self .rustc_perf_dir ()):
245
+ cmd ([self .cargo_stage_0 (), "build" , "-p" , "collector" ], env = dict (
246
+ RUSTC = str (self .rustc_stage_0 ()),
247
+ RUSTC_BOOTSTRAP = "1"
248
+ ))
249
+
250
+ def supports_bolt (self ) -> bool :
251
+ return False
252
+
253
+
211
254
def get_timestamp () -> float :
212
255
return time .time ()
213
256
@@ -576,6 +619,8 @@ def create_pipeline() -> Pipeline:
576
619
return LinuxPipeline ()
577
620
elif sys .platform in ("cygwin" , "win32" ):
578
621
return WindowsPipeline ()
622
+ elif sys .platform == "darwin" :
623
+ return DarwinPipeline ()
579
624
else :
580
625
raise Exception (f"Optimized build is not supported for platform { sys .platform } " )
581
626
0 commit comments