@@ -24,15 +24,15 @@ use nextest_runner::{
24
24
errors:: { TargetTripleError , WriteTestListError } ,
25
25
input:: InputHandlerKind ,
26
26
list:: {
27
- BinaryList , OutputFormat , RustTestArtifact , SerializableFormat , TestExecuteContext ,
28
- TestList ,
27
+ BinaryList , OutputFormat , RustBuildMeta , RustTestArtifact , SerializableFormat ,
28
+ TestExecuteContext , TestList , TestListState ,
29
29
} ,
30
30
partition:: PartitionerBuilder ,
31
31
platform:: { BuildPlatforms , HostPlatform , PlatformLibdir , TargetPlatform } ,
32
32
redact:: Redactor ,
33
33
reporter:: {
34
34
events:: { FinalRunStats , RunStatsFailureKind } ,
35
- highlight_end, structured, FinalStatusLevel , ReporterBuilder , StatusLevel ,
35
+ highlight_end, structured, EventAggregator , FinalStatusLevel , ReporterBuilder , StatusLevel ,
36
36
TestOutputDisplay , TestOutputErrorSlice ,
37
37
} ,
38
38
reuse_build:: { archive_to_file, ArchiveReporter , PathMapper , ReuseBuildInfo } ,
@@ -611,20 +611,14 @@ impl TestBuildFilter {
611
611
test_filter_builder : TestFilterBuilder ,
612
612
env : EnvironmentMap ,
613
613
ecx : & EvalContext < ' _ > ,
614
- reuse_build : & ReuseBuildInfo ,
614
+ rust_build_meta : RustBuildMeta < TestListState > ,
615
+ path_mapper : & PathMapper ,
615
616
) -> Result < TestList < ' g > > {
616
- let path_mapper = make_path_mapper (
617
- reuse_build,
618
- graph,
619
- & binary_list. rust_build_meta . target_directory ,
620
- ) ?;
621
-
622
- let rust_build_meta = binary_list. rust_build_meta . map_paths ( & path_mapper) ;
623
617
let test_artifacts = RustTestArtifact :: from_binary_list (
624
618
graph,
625
619
binary_list,
626
620
& rust_build_meta,
627
- & path_mapper,
621
+ path_mapper,
628
622
self . platform_filter . into ( ) ,
629
623
) ?;
630
624
TestList :: new (
@@ -1420,12 +1414,11 @@ impl BaseApp {
1420
1414
let binary_list = self . build_binary_list ( ) ?;
1421
1415
let path_mapper = PathMapper :: noop ( ) ;
1422
1416
1423
- let build_platforms = binary_list. rust_build_meta . build_platforms . clone ( ) ;
1424
1417
let pcx = ParseContext :: new ( self . graph ( ) ) ;
1425
1418
let ( _, config) = self . load_config ( & pcx) ?;
1426
1419
let profile = self
1427
1420
. load_profile ( & config) ?
1428
- . apply_build_platforms ( & build_platforms) ;
1421
+ . into_evaluatable ( & binary_list . rust_build_meta . build_platforms ) ;
1429
1422
1430
1423
let redactor = if should_redact ( ) {
1431
1424
Redactor :: build_active ( & binary_list. rust_build_meta )
@@ -1502,11 +1495,6 @@ impl BaseApp {
1502
1495
let profile = config
1503
1496
. profile ( profile_name)
1504
1497
. map_err ( ExpectedError :: profile_not_found) ?;
1505
- let store_dir = profile. store_dir ( ) ;
1506
- std:: fs:: create_dir_all ( store_dir) . map_err ( |err| ExpectedError :: StoreDirCreateError {
1507
- store_dir : store_dir. to_owned ( ) ,
1508
- err,
1509
- } ) ?;
1510
1498
Ok ( profile)
1511
1499
}
1512
1500
}
@@ -1569,6 +1557,8 @@ impl App {
1569
1557
binary_list : Arc < BinaryList > ,
1570
1558
test_filter_builder : TestFilterBuilder ,
1571
1559
ecx : & EvalContext < ' _ > ,
1560
+ rust_build_meta : RustBuildMeta < TestListState > ,
1561
+ path_mapper : & PathMapper ,
1572
1562
) -> Result < TestList > {
1573
1563
let env = EnvironmentMap :: new ( & self . base . cargo_configs ) ;
1574
1564
self . build_filter . compute_test_list (
@@ -1579,7 +1569,8 @@ impl App {
1579
1569
test_filter_builder,
1580
1570
env,
1581
1571
ecx,
1582
- & self . base . reuse_build ,
1572
+ rust_build_meta,
1573
+ path_mapper,
1583
1574
)
1584
1575
}
1585
1576
@@ -1617,16 +1608,29 @@ impl App {
1617
1608
. base
1618
1609
. load_runner ( & binary_list. rust_build_meta . build_platforms ) ;
1619
1610
let profile =
1620
- profile. apply_build_platforms ( & binary_list. rust_build_meta . build_platforms ) ;
1611
+ profile. into_evaluatable ( & binary_list. rust_build_meta . build_platforms ) ;
1621
1612
let ctx = TestExecuteContext {
1622
1613
profile_name : profile. name ( ) ,
1623
1614
double_spawn,
1624
1615
target_runner,
1625
1616
} ;
1626
1617
let ecx = profile. filterset_ecx ( ) ;
1627
1618
1628
- let test_list =
1629
- self . build_test_list ( & ctx, binary_list, test_filter_builder, & ecx) ?;
1619
+ let path_mapper = make_path_mapper (
1620
+ & self . base . reuse_build ,
1621
+ self . base . graph ( ) ,
1622
+ & binary_list. rust_build_meta . target_directory ,
1623
+ ) ?;
1624
+ let rust_build_meta = binary_list. rust_build_meta . map_paths ( & path_mapper) ;
1625
+
1626
+ let test_list = self . build_test_list (
1627
+ & ctx,
1628
+ binary_list,
1629
+ test_filter_builder,
1630
+ & ecx,
1631
+ rust_build_meta,
1632
+ & path_mapper,
1633
+ ) ?;
1630
1634
1631
1635
let mut writer = output_writer. stdout_writer ( ) ;
1632
1636
test_list. write (
@@ -1673,15 +1677,29 @@ impl App {
1673
1677
1674
1678
let double_spawn = self . base . load_double_spawn ( ) ;
1675
1679
let target_runner = self . base . load_runner ( & build_platforms) ;
1676
- let profile = profile. apply_build_platforms ( & build_platforms) ;
1680
+ let profile = profile. into_evaluatable ( & build_platforms) ;
1677
1681
let ctx = TestExecuteContext {
1678
1682
profile_name : profile. name ( ) ,
1679
1683
double_spawn,
1680
1684
target_runner,
1681
1685
} ;
1682
1686
let ecx = profile. filterset_ecx ( ) ;
1683
1687
1684
- let test_list = self . build_test_list ( & ctx, binary_list, test_filter_builder, & ecx) ?;
1688
+ let path_mapper = make_path_mapper (
1689
+ & self . base . reuse_build ,
1690
+ self . base . graph ( ) ,
1691
+ & binary_list. rust_build_meta . target_directory ,
1692
+ ) ?;
1693
+ let rust_build_meta = binary_list. rust_build_meta . map_paths ( & path_mapper) ;
1694
+
1695
+ let test_list = self . build_test_list (
1696
+ & ctx,
1697
+ binary_list,
1698
+ test_filter_builder,
1699
+ & ecx,
1700
+ rust_build_meta,
1701
+ & path_mapper,
1702
+ ) ?;
1685
1703
1686
1704
let mut writer = output_writer. stdout_writer ( ) ;
1687
1705
@@ -1712,7 +1730,8 @@ impl App {
1712
1730
let ( version_only_config, config) = self . base . load_config ( & pcx) ?;
1713
1731
let profile = self . base . load_profile ( & config) ?;
1714
1732
1715
- // Construct this here so that errors are reported before the build step.
1733
+ // Construct this here so that errors are reported before the build
1734
+ // step.
1716
1735
let mut structured_reporter = structured:: StructuredReporter :: new ( ) ;
1717
1736
match reporter_opts. message_format {
1718
1737
MessageFormat :: Human => { }
@@ -1752,19 +1771,40 @@ impl App {
1752
1771
let test_filter_builder = self . build_filter . make_test_filter_builder ( filter_exprs) ?;
1753
1772
1754
1773
let binary_list = self . base . build_binary_list ( ) ?;
1755
- let build_platforms = & binary_list. rust_build_meta . build_platforms . clone ( ) ;
1774
+ let path_mapper = make_path_mapper (
1775
+ & self . base . reuse_build ,
1776
+ self . base . graph ( ) ,
1777
+ & binary_list. rust_build_meta . target_directory ,
1778
+ ) ?;
1779
+ let rust_build_meta = binary_list. rust_build_meta . map_paths ( & path_mapper) ;
1780
+
1781
+ let profile = profile. into_evaluatable ( & binary_list. rust_build_meta . build_platforms ) ;
1782
+
1783
+ // This is the earliest point where we can create the aggregator, since
1784
+ // we need the remapped target directory which is only available after
1785
+ // the test list is built.
1786
+ let aggregator = EventAggregator :: new ( & profile, & rust_build_meta. target_directory ) ?;
1787
+
1756
1788
let double_spawn = self . base . load_double_spawn ( ) ;
1757
- let target_runner = self . base . load_runner ( build_platforms) ;
1789
+ let target_runner = self
1790
+ . base
1791
+ . load_runner ( & binary_list. rust_build_meta . build_platforms ) ;
1758
1792
1759
- let profile = profile. apply_build_platforms ( build_platforms) ;
1760
1793
let ctx = TestExecuteContext {
1761
1794
profile_name : profile. name ( ) ,
1762
1795
double_spawn,
1763
1796
target_runner,
1764
1797
} ;
1765
1798
let ecx = profile. filterset_ecx ( ) ;
1766
1799
1767
- let test_list = self . build_test_list ( & ctx, binary_list, test_filter_builder, & ecx) ?;
1800
+ let test_list = self . build_test_list (
1801
+ & ctx,
1802
+ binary_list,
1803
+ test_filter_builder,
1804
+ & ecx,
1805
+ rust_build_meta,
1806
+ & path_mapper,
1807
+ ) ?;
1768
1808
1769
1809
let output = output_writer. reporter_output ( ) ;
1770
1810
let should_colorize = self
@@ -1805,7 +1845,13 @@ impl App {
1805
1845
let mut reporter = reporter_opts
1806
1846
. to_builder ( no_capture, should_colorize)
1807
1847
. set_verbose ( self . base . output . verbose )
1808
- . build ( & test_list, & profile, output, structured_reporter) ;
1848
+ . build (
1849
+ & test_list,
1850
+ & profile,
1851
+ output,
1852
+ aggregator,
1853
+ structured_reporter,
1854
+ ) ;
1809
1855
1810
1856
configure_handle_inheritance ( no_capture) ?;
1811
1857
let run_stats = runner. try_execute ( |event| {
0 commit comments