@@ -12,8 +12,6 @@ use failure::{Error, ResultExt, SyncFailure};
12
12
use futures:: stream:: Stream ;
13
13
use futures:: sync:: mpsc:: { unbounded as unbounded_channel, UnboundedReceiver , UnboundedSender } ;
14
14
use log:: { debug, error, info, warn} ;
15
- use rust_sysroot:: git:: Commit as GitCommit ;
16
- use rust_sysroot:: sysroot:: Sysroot ;
17
15
use std:: collections:: BTreeMap ;
18
16
use std:: collections:: HashSet ;
19
17
use std:: env;
@@ -27,8 +25,10 @@ use std::thread::{self, JoinHandle};
27
25
28
26
mod execute;
29
27
mod outrepo;
28
+ mod sysroot;
30
29
31
30
use crate :: execute:: { Benchmark , Profiler } ;
31
+ use crate :: sysroot:: Sysroot ;
32
32
33
33
#[ derive( Debug , Copy , Clone ) ]
34
34
pub struct Compiler < ' a > {
@@ -199,7 +199,7 @@ fn send_home(d: &collected::Request) {
199
199
200
200
fn bench_commit (
201
201
repo : Option < & outrepo:: Repo > ,
202
- commit : & GitCommit ,
202
+ commit : & Commit ,
203
203
triple : & str ,
204
204
build_kinds : & [ BuildKind ] ,
205
205
run_kinds : & [ RunKind ] ,
@@ -215,10 +215,7 @@ fn bench_commit(
215
215
216
216
if call_home {
217
217
send_home ( & collected:: Request :: BenchmarkCommit {
218
- commit : Commit {
219
- sha : commit. sha . clone ( ) ,
220
- date : Date ( commit. date ) ,
221
- } ,
218
+ commit : commit. clone ( ) ,
222
219
benchmarks : benchmarks. iter ( ) . map ( |b| b. name . clone ( ) ) . collect ( ) ,
223
220
} ) ;
224
221
}
@@ -231,10 +228,7 @@ fn bench_commit(
231
228
if call_home {
232
229
send_home ( & collected:: Request :: BenchmarkDone {
233
230
benchmark : benchmark. name . clone ( ) ,
234
- commit : Commit {
235
- sha : commit. sha . clone ( ) ,
236
- date : Date ( commit. date ) ,
237
- } ,
231
+ commit : commit. clone ( ) ,
238
232
} ) ;
239
233
}
240
234
results. insert ( benchmark. name . clone ( ) , result. clone ( ) ) ;
@@ -261,10 +255,7 @@ fn bench_commit(
261
255
if call_home {
262
256
send_home ( & collected:: Request :: BenchmarkDone {
263
257
benchmark : benchmark. name . clone ( ) ,
264
- commit : Commit {
265
- sha : commit. sha . clone ( ) ,
266
- date : Date ( commit. date ) ,
267
- } ,
258
+ commit : commit. clone ( ) ,
268
259
} ) ;
269
260
}
270
261
@@ -273,10 +264,7 @@ fn bench_commit(
273
264
}
274
265
275
266
CommitData {
276
- commit : Commit {
277
- sha : commit. sha . clone ( ) ,
278
- date : Date ( commit. date ) ,
279
- } ,
267
+ commit : commit. clone ( ) ,
280
268
triple : triple. to_string ( ) ,
281
269
benchmarks : results,
282
270
}
@@ -416,9 +404,7 @@ fn main_result() -> Result<i32, Error> {
416
404
let get_out_repo =
417
405
|allow_new_dir| outrepo:: Repo :: open ( get_out_dir ( ) , allow_new_dir, use_remote) ;
418
406
419
- let get_commits = || {
420
- rust_sysroot:: get_commits ( rust_sysroot:: EPOCH_COMMIT , "master" ) . map_err ( SyncFailure :: new)
421
- } ;
407
+ let get_commits = || collector:: git:: get_rust_commits ( ) ;
422
408
423
409
let ret = match matches. subcommand ( ) {
424
410
( "bench_commit" , Some ( sub_m) ) => {
@@ -429,15 +415,13 @@ fn main_result() -> Result<i32, Error> {
429
415
. cloned ( )
430
416
. unwrap_or_else ( || {
431
417
warn ! ( "utilizing fake commit!" ) ;
432
- rust_sysroot :: git :: Commit {
418
+ Commit {
433
419
sha : commit. to_string ( ) ,
434
- date : Date :: ymd_hms ( 2000 , 01 , 01 , 0 , 0 , 0 ) . 0 ,
435
- summary : String :: new ( ) ,
420
+ date : Date :: ymd_hms ( 2000 , 01 , 01 , 0 , 0 , 0 ) ,
436
421
}
437
422
} ) ;
438
423
let out_repo = get_out_repo ( false ) ?;
439
- let sysroot = Sysroot :: install ( & commit, "x86_64-unknown-linux-gnu" , false , false )
440
- . map_err ( SyncFailure :: new) ?;
424
+ let sysroot = Sysroot :: install ( & commit. sha , commit. date . 0 , "x86_64-unknown-linux-gnu" ) ?;
441
425
let build_kinds = & [ BuildKind :: Check , BuildKind :: Debug , BuildKind :: Opt ] ;
442
426
let run_kinds = RunKind :: all ( ) ;
443
427
out_repo. success ( & bench_commit (
@@ -469,11 +453,10 @@ fn main_result() -> Result<i32, Error> {
469
453
// arbitrary identifier, not a commit SHA. But that's ok for local
470
454
// runs, because `commit` is only used when producing the output
471
455
// files, not for interacting with a repo.
472
- let commit = GitCommit {
456
+ let commit = Commit {
473
457
sha : id. to_string ( ) ,
474
458
// Drop the nanoseconds; we don't want that level of precision.
475
- date : Utc :: now ( ) . with_nanosecond ( 0 ) . unwrap ( ) ,
476
- summary : String :: new ( ) ,
459
+ date : Date ( Utc :: now ( ) . with_nanosecond ( 0 ) . unwrap ( ) ) ,
477
460
} ;
478
461
let rustc_path = PathBuf :: from ( rustc) . canonicalize ( ) ?;
479
462
let cargo_path = PathBuf :: from ( cargo) . canonicalize ( ) ?;
@@ -502,10 +485,9 @@ fn main_result() -> Result<i32, Error> {
502
485
( "bench_published" , Some ( sub_m) ) => {
503
486
let id = sub_m. value_of ( "ID" ) . unwrap ( ) ;
504
487
let repo = get_out_repo ( false ) ?;
505
- let commit = rust_sysroot :: git :: Commit {
488
+ let commit = Commit {
506
489
sha : String :: from ( "<none>" ) ,
507
- date : Date :: ymd_hms ( 2010 , 01 , 01 , 0 , 0 , 0 ) . 0 ,
508
- summary : String :: new ( ) ,
490
+ date : Date :: ymd_hms ( 2010 , 01 , 01 , 0 , 0 , 0 ) ,
509
491
} ;
510
492
let cfg = rustup:: Cfg :: from_env ( Arc :: new ( |_| { } ) ) . map_err ( SyncFailure :: new) ?;
511
493
let toolchain = rustup:: Toolchain :: from ( & cfg, id)
@@ -574,13 +556,13 @@ fn main_result() -> Result<i32, Error> {
574
556
. cloned ( )
575
557
. unwrap_or_else ( || {
576
558
warn ! ( "utilizing fake commit!" ) ;
577
- rust_sysroot :: git :: Commit {
559
+ Commit {
578
560
sha : commit. to_string ( ) ,
579
- date : Date :: ymd_hms ( 2000 , 01 , 01 , 0 , 0 , 0 ) . 0 ,
580
- summary : String :: new ( ) ,
561
+ date : Date :: ymd_hms ( 2000 , 01 , 01 , 0 , 0 , 0 ) ,
581
562
}
582
563
} ) ;
583
- if let Ok ( sysroot) = Sysroot :: install ( & commit, "x86_64-unknown-linux-gnu" , false , false )
564
+ if let Ok ( sysroot) =
565
+ Sysroot :: install ( & commit. sha , commit. date . 0 , "x86_64-unknown-linux-gnu" )
584
566
{
585
567
let result = out_repo. success ( & bench_commit (
586
568
Some ( & out_repo) ,
@@ -674,8 +656,8 @@ fn main_result() -> Result<i32, Error> {
674
656
675
657
( "test_benchmarks" , Some ( _) ) => {
676
658
if let Some ( commit) = get_commits ( ) ?. last ( ) {
677
- let sysroot = Sysroot :: install ( commit , "x86_64-unknown-linux-gnu" , false , false )
678
- . map_err ( SyncFailure :: new ) ?;
659
+ let sysroot =
660
+ Sysroot :: install ( & commit . sha , commit . date . 0 , "x86_64-unknown-linux-gnu" ) ?;
679
661
// filter out servo benchmarks as they simply take too long
680
662
bench_commit (
681
663
None ,
0 commit comments