@@ -894,7 +894,6 @@ define_config! {
894
894
define_config ! {
895
895
struct Dist {
896
896
sign_folder: Option <String > = "sign-folder" ,
897
- gpg_password_file: Option <String > = "gpg-password-file" ,
898
897
upload_addr: Option <String > = "upload-addr" ,
899
898
src_tarball: Option <bool > = "src-tarball" ,
900
899
missing_tools: Option <bool > = "missing-tools" ,
@@ -1070,7 +1069,6 @@ define_config! {
1070
1069
debuginfo_level_tools: Option <DebuginfoLevel > = "debuginfo-level-tools" ,
1071
1070
debuginfo_level_tests: Option <DebuginfoLevel > = "debuginfo-level-tests" ,
1072
1071
split_debuginfo: Option <String > = "split-debuginfo" ,
1073
- run_dsymutil: Option <bool > = "run-dsymutil" ,
1074
1072
backtrace: Option <bool > = "backtrace" ,
1075
1073
incremental: Option <bool > = "incremental" ,
1076
1074
parallel_compiler: Option <bool > = "parallel-compiler" ,
@@ -1349,20 +1347,64 @@ impl Config {
1349
1347
config. changelog_seen = toml. changelog_seen ;
1350
1348
config. change_id = toml. change_id ;
1351
1349
1352
- let build = toml. build . unwrap_or_default ( ) ;
1353
- if let Some ( file_build) = build. build {
1350
+ let Build {
1351
+ build,
1352
+ host,
1353
+ target,
1354
+ build_dir,
1355
+ cargo,
1356
+ rustc,
1357
+ rustfmt,
1358
+ docs,
1359
+ compiler_docs,
1360
+ library_docs_private_items,
1361
+ docs_minification,
1362
+ submodules,
1363
+ gdb,
1364
+ nodejs,
1365
+ npm,
1366
+ python,
1367
+ reuse,
1368
+ locked_deps,
1369
+ vendor,
1370
+ full_bootstrap,
1371
+ extended,
1372
+ tools,
1373
+ verbose,
1374
+ sanitizers,
1375
+ profiler,
1376
+ cargo_native_static,
1377
+ low_priority,
1378
+ configure_args,
1379
+ local_rebuild,
1380
+ print_step_timings,
1381
+ print_step_rusage,
1382
+ check_stage,
1383
+ doc_stage,
1384
+ build_stage,
1385
+ test_stage,
1386
+ install_stage,
1387
+ dist_stage,
1388
+ bench_stage,
1389
+ patch_binaries_for_nix,
1390
+ // This field is only used by bootstrap.py
1391
+ metrics : _,
1392
+ android_ndk,
1393
+ } = toml. build . unwrap_or_default ( ) ;
1394
+
1395
+ if let Some ( file_build) = build {
1354
1396
config. build = TargetSelection :: from_user ( & file_build) ;
1355
1397
} ;
1356
1398
1357
- set ( & mut config. out , flags. build_dir . or_else ( || build . build_dir . map ( PathBuf :: from) ) ) ;
1399
+ set ( & mut config. out , flags. build_dir . or_else ( || build_dir. map ( PathBuf :: from) ) ) ;
1358
1400
// NOTE: Bootstrap spawns various commands with different working directories.
1359
1401
// To avoid writing to random places on the file system, `config.out` needs to be an absolute path.
1360
1402
if !config. out . is_absolute ( ) {
1361
1403
// `canonicalize` requires the path to already exist. Use our vendored copy of `absolute` instead.
1362
1404
config. out = crate :: utils:: helpers:: absolute ( & config. out ) ;
1363
1405
}
1364
1406
1365
- config. initial_rustc = if let Some ( rustc) = build . rustc {
1407
+ config. initial_rustc = if let Some ( rustc) = rustc {
1366
1408
if !flags. skip_stage0_validation {
1367
1409
config. check_build_rustc_version ( & rustc) ;
1368
1410
}
@@ -1372,8 +1414,7 @@ impl Config {
1372
1414
config. out . join ( config. build . triple ) . join ( "stage0/bin/rustc" )
1373
1415
} ;
1374
1416
1375
- config. initial_cargo = build
1376
- . cargo
1417
+ config. initial_cargo = cargo
1377
1418
. map ( |cargo| {
1378
1419
t ! ( PathBuf :: from( cargo) . canonicalize( ) , "`initial_cargo` not found on disk" )
1379
1420
} )
@@ -1388,58 +1429,59 @@ impl Config {
1388
1429
1389
1430
config. hosts = if let Some ( TargetSelectionList ( arg_host) ) = flags. host {
1390
1431
arg_host
1391
- } else if let Some ( file_host) = build . host {
1432
+ } else if let Some ( file_host) = host {
1392
1433
file_host. iter ( ) . map ( |h| TargetSelection :: from_user ( h) ) . collect ( )
1393
1434
} else {
1394
1435
vec ! [ config. build]
1395
1436
} ;
1396
1437
config. targets = if let Some ( TargetSelectionList ( arg_target) ) = flags. target {
1397
1438
arg_target
1398
- } else if let Some ( file_target) = build . target {
1439
+ } else if let Some ( file_target) = target {
1399
1440
file_target. iter ( ) . map ( |h| TargetSelection :: from_user ( h) ) . collect ( )
1400
1441
} else {
1401
1442
// If target is *not* configured, then default to the host
1402
1443
// toolchains.
1403
1444
config. hosts . clone ( )
1404
1445
} ;
1405
1446
1406
- config. nodejs = build . nodejs . map ( PathBuf :: from) ;
1407
- config. npm = build . npm . map ( PathBuf :: from) ;
1408
- config. gdb = build . gdb . map ( PathBuf :: from) ;
1409
- config. python = build . python . map ( PathBuf :: from) ;
1410
- config. reuse = build . reuse . map ( PathBuf :: from) ;
1411
- config. submodules = build . submodules ;
1412
- config. android_ndk = build . android_ndk ;
1413
- set ( & mut config. low_priority , build . low_priority ) ;
1414
- set ( & mut config. compiler_docs , build . compiler_docs ) ;
1415
- set ( & mut config. library_docs_private_items , build . library_docs_private_items ) ;
1416
- set ( & mut config. docs_minification , build . docs_minification ) ;
1417
- set ( & mut config. docs , build . docs ) ;
1418
- set ( & mut config. locked_deps , build . locked_deps ) ;
1419
- set ( & mut config. vendor , build . vendor ) ;
1420
- set ( & mut config. full_bootstrap , build . full_bootstrap ) ;
1421
- set ( & mut config. extended , build . extended ) ;
1422
- config. tools = build . tools ;
1423
- set ( & mut config. verbose , build . verbose ) ;
1424
- set ( & mut config. sanitizers , build . sanitizers ) ;
1425
- set ( & mut config. profiler , build . profiler ) ;
1426
- set ( & mut config. cargo_native_static , build . cargo_native_static ) ;
1427
- set ( & mut config. configure_args , build . configure_args ) ;
1428
- set ( & mut config. local_rebuild , build . local_rebuild ) ;
1429
- set ( & mut config. print_step_timings , build . print_step_timings ) ;
1430
- set ( & mut config. print_step_rusage , build . print_step_rusage ) ;
1431
- config. patch_binaries_for_nix = build . patch_binaries_for_nix ;
1447
+ config. nodejs = nodejs. map ( PathBuf :: from) ;
1448
+ config. npm = npm. map ( PathBuf :: from) ;
1449
+ config. gdb = gdb. map ( PathBuf :: from) ;
1450
+ config. python = python. map ( PathBuf :: from) ;
1451
+ config. reuse = reuse. map ( PathBuf :: from) ;
1452
+ config. submodules = submodules;
1453
+ config. android_ndk = android_ndk;
1454
+ set ( & mut config. low_priority , low_priority) ;
1455
+ set ( & mut config. compiler_docs , compiler_docs) ;
1456
+ set ( & mut config. library_docs_private_items , library_docs_private_items) ;
1457
+ set ( & mut config. docs_minification , docs_minification) ;
1458
+ set ( & mut config. docs , docs) ;
1459
+ set ( & mut config. locked_deps , locked_deps) ;
1460
+ set ( & mut config. vendor , vendor) ;
1461
+ set ( & mut config. full_bootstrap , full_bootstrap) ;
1462
+ set ( & mut config. extended , extended) ;
1463
+ config. tools = tools;
1464
+ set ( & mut config. verbose , verbose) ;
1465
+ set ( & mut config. sanitizers , sanitizers) ;
1466
+ set ( & mut config. profiler , profiler) ;
1467
+ set ( & mut config. cargo_native_static , cargo_native_static) ;
1468
+ set ( & mut config. configure_args , configure_args) ;
1469
+ set ( & mut config. local_rebuild , local_rebuild) ;
1470
+ set ( & mut config. print_step_timings , print_step_timings) ;
1471
+ set ( & mut config. print_step_rusage , print_step_rusage) ;
1472
+ config. patch_binaries_for_nix = patch_binaries_for_nix;
1432
1473
1433
1474
config. verbose = cmp:: max ( config. verbose , flags. verbose as usize ) ;
1434
1475
1435
1476
if let Some ( install) = toml. install {
1436
- config. prefix = install. prefix . map ( PathBuf :: from) ;
1437
- config. sysconfdir = install. sysconfdir . map ( PathBuf :: from) ;
1438
- config. datadir = install. datadir . map ( PathBuf :: from) ;
1439
- config. docdir = install. docdir . map ( PathBuf :: from) ;
1440
- set ( & mut config. bindir , install. bindir . map ( PathBuf :: from) ) ;
1441
- config. libdir = install. libdir . map ( PathBuf :: from) ;
1442
- config. mandir = install. mandir . map ( PathBuf :: from) ;
1477
+ let Install { prefix, sysconfdir, docdir, bindir, libdir, mandir, datadir } = install;
1478
+ config. prefix = prefix. map ( PathBuf :: from) ;
1479
+ config. sysconfdir = sysconfdir. map ( PathBuf :: from) ;
1480
+ config. datadir = datadir. map ( PathBuf :: from) ;
1481
+ config. docdir = docdir. map ( PathBuf :: from) ;
1482
+ set ( & mut config. bindir , bindir. map ( PathBuf :: from) ) ;
1483
+ config. libdir = libdir. map ( PathBuf :: from) ;
1484
+ config. mandir = mandir. map ( PathBuf :: from) ;
1443
1485
}
1444
1486
1445
1487
// Store off these values as options because if they're not provided
@@ -1462,9 +1504,63 @@ impl Config {
1462
1504
let mut omit_git_hash = None ;
1463
1505
1464
1506
if let Some ( rust) = toml. rust {
1465
- set ( & mut config. channel , rust. channel ) ;
1466
-
1467
- config. download_rustc_commit = config. download_ci_rustc_commit ( rust. download_rustc ) ;
1507
+ let Rust {
1508
+ optimize : optimize_toml,
1509
+ debug : debug_toml,
1510
+ codegen_units,
1511
+ codegen_units_std,
1512
+ debug_assertions : debug_assertions_toml,
1513
+ debug_assertions_std : debug_assertions_std_toml,
1514
+ overflow_checks : overflow_checks_toml,
1515
+ overflow_checks_std : overflow_checks_std_toml,
1516
+ debug_logging : debug_logging_toml,
1517
+ debuginfo_level : debuginfo_level_toml,
1518
+ debuginfo_level_rustc : debuginfo_level_rustc_toml,
1519
+ debuginfo_level_std : debuginfo_level_std_toml,
1520
+ debuginfo_level_tools : debuginfo_level_tools_toml,
1521
+ debuginfo_level_tests : debuginfo_level_tests_toml,
1522
+ split_debuginfo,
1523
+ backtrace,
1524
+ incremental,
1525
+ parallel_compiler,
1526
+ default_linker,
1527
+ channel,
1528
+ description,
1529
+ musl_root,
1530
+ rpath,
1531
+ verbose_tests,
1532
+ optimize_tests,
1533
+ codegen_tests,
1534
+ omit_git_hash : omit_git_hash_toml,
1535
+ dist_src,
1536
+ save_toolstates,
1537
+ codegen_backends,
1538
+ lld,
1539
+ llvm_tools,
1540
+ deny_warnings,
1541
+ backtrace_on_ice,
1542
+ verify_llvm_ir,
1543
+ thin_lto_import_instr_limit,
1544
+ remap_debuginfo,
1545
+ jemalloc,
1546
+ test_compare_mode,
1547
+ llvm_libunwind,
1548
+ control_flow_guard,
1549
+ ehcont_guard,
1550
+ new_symbol_mangling,
1551
+ profile_generate,
1552
+ profile_use,
1553
+ download_rustc,
1554
+ lto,
1555
+ validate_mir_opts,
1556
+ stack_protector,
1557
+ strip,
1558
+ lld_mode,
1559
+ } = rust;
1560
+
1561
+ set ( & mut config. channel , channel) ;
1562
+
1563
+ config. download_rustc_commit = config. download_ci_rustc_commit ( download_rustc) ;
1468
1564
// This list is incomplete, please help by expanding it!
1469
1565
if config. download_rustc_commit . is_some ( ) {
1470
1566
// We need the channel used by the downloaded compiler to match the one we set for rustdoc;
@@ -1481,44 +1577,43 @@ impl Config {
1481
1577
}
1482
1578
}
1483
1579
1484
- debug = rust. debug ;
1485
- debug_assertions = rust. debug_assertions ;
1486
- debug_assertions_std = rust. debug_assertions_std ;
1487
- overflow_checks = rust. overflow_checks ;
1488
- overflow_checks_std = rust. overflow_checks_std ;
1489
- debug_logging = rust. debug_logging ;
1490
- debuginfo_level = rust. debuginfo_level ;
1491
- debuginfo_level_rustc = rust. debuginfo_level_rustc ;
1492
- debuginfo_level_std = rust. debuginfo_level_std ;
1493
- debuginfo_level_tools = rust. debuginfo_level_tools ;
1494
- debuginfo_level_tests = rust. debuginfo_level_tests ;
1495
-
1496
- config. rust_split_debuginfo = rust
1497
- . split_debuginfo
1580
+ debug = debug_toml;
1581
+ debug_assertions = debug_assertions_toml;
1582
+ debug_assertions_std = debug_assertions_std_toml;
1583
+ overflow_checks = overflow_checks_toml;
1584
+ overflow_checks_std = overflow_checks_std_toml;
1585
+ debug_logging = debug_logging_toml;
1586
+ debuginfo_level = debuginfo_level_toml;
1587
+ debuginfo_level_rustc = debuginfo_level_rustc_toml;
1588
+ debuginfo_level_std = debuginfo_level_std_toml;
1589
+ debuginfo_level_tools = debuginfo_level_tools_toml;
1590
+ debuginfo_level_tests = debuginfo_level_tests_toml;
1591
+
1592
+ config. rust_split_debuginfo = split_debuginfo
1498
1593
. as_deref ( )
1499
1594
. map ( SplitDebuginfo :: from_str)
1500
1595
. map ( |v| v. expect ( "invalid value for rust.split_debuginfo" ) )
1501
1596
. unwrap_or ( SplitDebuginfo :: default_for_platform ( & config. build . triple ) ) ;
1502
- optimize = rust . optimize ;
1503
- omit_git_hash = rust . omit_git_hash ;
1504
- config. rust_new_symbol_mangling = rust . new_symbol_mangling ;
1505
- set ( & mut config. rust_optimize_tests , rust . optimize_tests ) ;
1506
- set ( & mut config. codegen_tests , rust . codegen_tests ) ;
1507
- set ( & mut config. rust_rpath , rust . rpath ) ;
1508
- set ( & mut config. rust_strip , rust . strip ) ;
1509
- config. rust_stack_protector = rust . stack_protector ;
1510
- set ( & mut config. jemalloc , rust . jemalloc ) ;
1511
- set ( & mut config. test_compare_mode , rust . test_compare_mode ) ;
1512
- set ( & mut config. backtrace , rust . backtrace ) ;
1513
- config. description = rust . description ;
1514
- set ( & mut config. rust_dist_src , rust . dist_src ) ;
1515
- set ( & mut config. verbose_tests , rust . verbose_tests ) ;
1597
+ optimize = optimize_toml ;
1598
+ omit_git_hash = omit_git_hash_toml ;
1599
+ config. rust_new_symbol_mangling = new_symbol_mangling;
1600
+ set ( & mut config. rust_optimize_tests , optimize_tests) ;
1601
+ set ( & mut config. codegen_tests , codegen_tests) ;
1602
+ set ( & mut config. rust_rpath , rpath) ;
1603
+ set ( & mut config. rust_strip , strip) ;
1604
+ config. rust_stack_protector = stack_protector;
1605
+ set ( & mut config. jemalloc , jemalloc) ;
1606
+ set ( & mut config. test_compare_mode , test_compare_mode) ;
1607
+ set ( & mut config. backtrace , backtrace) ;
1608
+ config. description = description;
1609
+ set ( & mut config. rust_dist_src , dist_src) ;
1610
+ set ( & mut config. verbose_tests , verbose_tests) ;
1516
1611
// in the case "false" is set explicitly, do not overwrite the command line args
1517
- if let Some ( true ) = rust . incremental {
1612
+ if let Some ( true ) = incremental {
1518
1613
config. incremental = true ;
1519
1614
}
1520
- set ( & mut config. lld_mode , rust . lld_mode ) ;
1521
- set ( & mut config. lld_enabled , rust . lld ) ;
1615
+ set ( & mut config. lld_mode , lld_mode) ;
1616
+ set ( & mut config. lld_enabled , lld) ;
1522
1617
1523
1618
if matches ! ( config. lld_mode, LldMode :: SelfContained )
1524
1619
&& !config. lld_enabled
@@ -1529,32 +1624,30 @@ impl Config {
1529
1624
) ;
1530
1625
}
1531
1626
1532
- set ( & mut config. llvm_tools_enabled , rust. llvm_tools ) ;
1533
- config. rustc_parallel = rust
1534
- . parallel_compiler
1535
- . unwrap_or ( config. channel == "dev" || config. channel == "nightly" ) ;
1536
- config. rustc_default_linker = rust. default_linker ;
1537
- config. musl_root = rust. musl_root . map ( PathBuf :: from) ;
1538
- config. save_toolstates = rust. save_toolstates . map ( PathBuf :: from) ;
1627
+ set ( & mut config. llvm_tools_enabled , llvm_tools) ;
1628
+ config. rustc_parallel =
1629
+ parallel_compiler. unwrap_or ( config. channel == "dev" || config. channel == "nightly" ) ;
1630
+ config. rustc_default_linker = default_linker;
1631
+ config. musl_root = musl_root. map ( PathBuf :: from) ;
1632
+ config. save_toolstates = save_toolstates. map ( PathBuf :: from) ;
1539
1633
set (
1540
1634
& mut config. deny_warnings ,
1541
1635
match flags. warnings {
1542
1636
Warnings :: Deny => Some ( true ) ,
1543
1637
Warnings :: Warn => Some ( false ) ,
1544
- Warnings :: Default => rust . deny_warnings ,
1638
+ Warnings :: Default => deny_warnings,
1545
1639
} ,
1546
1640
) ;
1547
- set ( & mut config. backtrace_on_ice , rust. backtrace_on_ice ) ;
1548
- set ( & mut config. rust_verify_llvm_ir , rust. verify_llvm_ir ) ;
1549
- config. rust_thin_lto_import_instr_limit = rust. thin_lto_import_instr_limit ;
1550
- set ( & mut config. rust_remap_debuginfo , rust. remap_debuginfo ) ;
1551
- set ( & mut config. control_flow_guard , rust. control_flow_guard ) ;
1552
- set ( & mut config. ehcont_guard , rust. ehcont_guard ) ;
1553
- config. llvm_libunwind_default = rust
1554
- . llvm_libunwind
1555
- . map ( |v| v. parse ( ) . expect ( "failed to parse rust.llvm-libunwind" ) ) ;
1556
-
1557
- if let Some ( ref backends) = rust. codegen_backends {
1641
+ set ( & mut config. backtrace_on_ice , backtrace_on_ice) ;
1642
+ set ( & mut config. rust_verify_llvm_ir , verify_llvm_ir) ;
1643
+ config. rust_thin_lto_import_instr_limit = thin_lto_import_instr_limit;
1644
+ set ( & mut config. rust_remap_debuginfo , remap_debuginfo) ;
1645
+ set ( & mut config. control_flow_guard , control_flow_guard) ;
1646
+ set ( & mut config. ehcont_guard , ehcont_guard) ;
1647
+ config. llvm_libunwind_default =
1648
+ llvm_libunwind. map ( |v| v. parse ( ) . expect ( "failed to parse rust.llvm-libunwind" ) ) ;
1649
+
1650
+ if let Some ( ref backends) = codegen_backends {
1558
1651
let available_backends = vec ! [ "llvm" , "cranelift" , "gcc" ] ;
1559
1652
1560
1653
config. rust_codegen_backends = backends. iter ( ) . map ( |s| {
@@ -1572,16 +1665,13 @@ impl Config {
1572
1665
} ) . collect ( ) ;
1573
1666
}
1574
1667
1575
- config. rust_codegen_units = rust. codegen_units . map ( threads_from_config) ;
1576
- config. rust_codegen_units_std = rust. codegen_units_std . map ( threads_from_config) ;
1577
- config. rust_profile_use = flags. rust_profile_use . or ( rust. profile_use ) ;
1578
- config. rust_profile_generate = flags. rust_profile_generate . or ( rust. profile_generate ) ;
1579
- config. rust_lto = rust
1580
- . lto
1581
- . as_deref ( )
1582
- . map ( |value| RustcLto :: from_str ( value) . unwrap ( ) )
1583
- . unwrap_or_default ( ) ;
1584
- config. rust_validate_mir_opts = rust. validate_mir_opts ;
1668
+ config. rust_codegen_units = codegen_units. map ( threads_from_config) ;
1669
+ config. rust_codegen_units_std = codegen_units_std. map ( threads_from_config) ;
1670
+ config. rust_profile_use = flags. rust_profile_use . or ( profile_use) ;
1671
+ config. rust_profile_generate = flags. rust_profile_generate . or ( profile_generate) ;
1672
+ config. rust_lto =
1673
+ lto. as_deref ( ) . map ( |value| RustcLto :: from_str ( value) . unwrap ( ) ) . unwrap_or_default ( ) ;
1674
+ config. rust_validate_mir_opts = validate_mir_opts;
1585
1675
} else {
1586
1676
config. rust_profile_use = flags. rust_profile_use ;
1587
1677
config. rust_profile_generate = flags. rust_profile_generate ;
@@ -1595,43 +1685,71 @@ impl Config {
1595
1685
config. rust_info = GitInfo :: new ( config. omit_git_hash , & config. src ) ;
1596
1686
1597
1687
if let Some ( llvm) = toml. llvm {
1598
- match llvm. ccache {
1688
+ let Llvm {
1689
+ optimize : optimize_toml,
1690
+ thin_lto,
1691
+ release_debuginfo,
1692
+ assertions,
1693
+ tests,
1694
+ plugins,
1695
+ ccache,
1696
+ static_libstdcpp,
1697
+ ninja,
1698
+ targets,
1699
+ experimental_targets,
1700
+ link_jobs,
1701
+ link_shared,
1702
+ version_suffix,
1703
+ clang_cl,
1704
+ cflags,
1705
+ cxxflags,
1706
+ ldflags,
1707
+ use_libcxx,
1708
+ use_linker,
1709
+ allow_old_toolchain,
1710
+ polly,
1711
+ clang,
1712
+ enable_warnings,
1713
+ download_ci_llvm,
1714
+ build_config,
1715
+ } = llvm;
1716
+ match ccache {
1599
1717
Some ( StringOrBool :: String ( ref s) ) => config. ccache = Some ( s. to_string ( ) ) ,
1600
1718
Some ( StringOrBool :: Bool ( true ) ) => {
1601
1719
config. ccache = Some ( "ccache" . to_string ( ) ) ;
1602
1720
}
1603
1721
Some ( StringOrBool :: Bool ( false ) ) | None => { }
1604
1722
}
1605
- set ( & mut config. ninja_in_file , llvm . ninja ) ;
1606
- llvm_assertions = llvm . assertions ;
1607
- llvm_tests = llvm . tests ;
1608
- llvm_plugins = llvm . plugins ;
1609
- set ( & mut config. llvm_optimize , llvm . optimize ) ;
1610
- set ( & mut config. llvm_thin_lto , llvm . thin_lto ) ;
1611
- set ( & mut config. llvm_release_debuginfo , llvm . release_debuginfo ) ;
1612
- set ( & mut config. llvm_static_stdcpp , llvm . static_libstdcpp ) ;
1613
- if let Some ( v) = llvm . link_shared {
1723
+ set ( & mut config. ninja_in_file , ninja) ;
1724
+ llvm_assertions = assertions;
1725
+ llvm_tests = tests;
1726
+ llvm_plugins = plugins;
1727
+ set ( & mut config. llvm_optimize , optimize_toml ) ;
1728
+ set ( & mut config. llvm_thin_lto , thin_lto) ;
1729
+ set ( & mut config. llvm_release_debuginfo , release_debuginfo) ;
1730
+ set ( & mut config. llvm_static_stdcpp , static_libstdcpp) ;
1731
+ if let Some ( v) = link_shared {
1614
1732
config. llvm_link_shared . set ( Some ( v) ) ;
1615
1733
}
1616
- config. llvm_targets = llvm . targets . clone ( ) ;
1617
- config. llvm_experimental_targets = llvm . experimental_targets . clone ( ) ;
1618
- config. llvm_link_jobs = llvm . link_jobs ;
1619
- config. llvm_version_suffix = llvm . version_suffix . clone ( ) ;
1620
- config. llvm_clang_cl = llvm . clang_cl . clone ( ) ;
1621
-
1622
- config. llvm_cflags = llvm . cflags . clone ( ) ;
1623
- config. llvm_cxxflags = llvm . cxxflags . clone ( ) ;
1624
- config. llvm_ldflags = llvm . ldflags . clone ( ) ;
1625
- set ( & mut config. llvm_use_libcxx , llvm . use_libcxx ) ;
1626
- config. llvm_use_linker = llvm . use_linker . clone ( ) ;
1627
- config. llvm_allow_old_toolchain = llvm . allow_old_toolchain . unwrap_or ( false ) ;
1628
- config. llvm_polly = llvm . polly . unwrap_or ( false ) ;
1629
- config. llvm_clang = llvm . clang . unwrap_or ( false ) ;
1630
- config. llvm_enable_warnings = llvm . enable_warnings . unwrap_or ( false ) ;
1631
- config. llvm_build_config = llvm . build_config . clone ( ) . unwrap_or ( Default :: default ( ) ) ;
1734
+ config. llvm_targets = targets. clone ( ) ;
1735
+ config. llvm_experimental_targets = experimental_targets. clone ( ) ;
1736
+ config. llvm_link_jobs = link_jobs;
1737
+ config. llvm_version_suffix = version_suffix. clone ( ) ;
1738
+ config. llvm_clang_cl = clang_cl. clone ( ) ;
1739
+
1740
+ config. llvm_cflags = cflags. clone ( ) ;
1741
+ config. llvm_cxxflags = cxxflags. clone ( ) ;
1742
+ config. llvm_ldflags = ldflags. clone ( ) ;
1743
+ set ( & mut config. llvm_use_libcxx , use_libcxx) ;
1744
+ config. llvm_use_linker = use_linker. clone ( ) ;
1745
+ config. llvm_allow_old_toolchain = allow_old_toolchain. unwrap_or ( false ) ;
1746
+ config. llvm_polly = polly. unwrap_or ( false ) ;
1747
+ config. llvm_clang = clang. unwrap_or ( false ) ;
1748
+ config. llvm_enable_warnings = enable_warnings. unwrap_or ( false ) ;
1749
+ config. llvm_build_config = build_config. clone ( ) . unwrap_or ( Default :: default ( ) ) ;
1632
1750
1633
1751
let asserts = llvm_assertions. unwrap_or ( false ) ;
1634
- config. llvm_from_ci = config. parse_download_ci_llvm ( llvm . download_ci_llvm , asserts) ;
1752
+ config. llvm_from_ci = config. parse_download_ci_llvm ( download_ci_llvm, asserts) ;
1635
1753
1636
1754
if config. llvm_from_ci {
1637
1755
// None of the LLVM options, except assertions, are supported
@@ -1640,31 +1758,31 @@ impl Config {
1640
1758
// explicitly set. The defaults and CI defaults don't
1641
1759
// necessarily match but forcing people to match (somewhat
1642
1760
// arbitrary) CI configuration locally seems bad/hard.
1643
- check_ci_llvm ! ( llvm . optimize ) ;
1644
- check_ci_llvm ! ( llvm . thin_lto) ;
1645
- check_ci_llvm ! ( llvm . release_debuginfo) ;
1761
+ check_ci_llvm ! ( optimize_toml ) ;
1762
+ check_ci_llvm ! ( thin_lto) ;
1763
+ check_ci_llvm ! ( release_debuginfo) ;
1646
1764
// CI-built LLVM can be either dynamic or static. We won't know until we download it.
1647
- check_ci_llvm ! ( llvm . link_shared) ;
1648
- check_ci_llvm ! ( llvm . static_libstdcpp) ;
1649
- check_ci_llvm ! ( llvm . targets) ;
1650
- check_ci_llvm ! ( llvm . experimental_targets) ;
1651
- check_ci_llvm ! ( llvm . link_jobs) ;
1652
- check_ci_llvm ! ( llvm . clang_cl) ;
1653
- check_ci_llvm ! ( llvm . version_suffix) ;
1654
- check_ci_llvm ! ( llvm . cflags) ;
1655
- check_ci_llvm ! ( llvm . cxxflags) ;
1656
- check_ci_llvm ! ( llvm . ldflags) ;
1657
- check_ci_llvm ! ( llvm . use_libcxx) ;
1658
- check_ci_llvm ! ( llvm . use_linker) ;
1659
- check_ci_llvm ! ( llvm . allow_old_toolchain) ;
1660
- check_ci_llvm ! ( llvm . polly) ;
1661
- check_ci_llvm ! ( llvm . clang) ;
1662
- check_ci_llvm ! ( llvm . build_config) ;
1663
- check_ci_llvm ! ( llvm . plugins) ;
1765
+ check_ci_llvm ! ( link_shared) ;
1766
+ check_ci_llvm ! ( static_libstdcpp) ;
1767
+ check_ci_llvm ! ( targets) ;
1768
+ check_ci_llvm ! ( experimental_targets) ;
1769
+ check_ci_llvm ! ( link_jobs) ;
1770
+ check_ci_llvm ! ( clang_cl) ;
1771
+ check_ci_llvm ! ( version_suffix) ;
1772
+ check_ci_llvm ! ( cflags) ;
1773
+ check_ci_llvm ! ( cxxflags) ;
1774
+ check_ci_llvm ! ( ldflags) ;
1775
+ check_ci_llvm ! ( use_libcxx) ;
1776
+ check_ci_llvm ! ( use_linker) ;
1777
+ check_ci_llvm ! ( allow_old_toolchain) ;
1778
+ check_ci_llvm ! ( polly) ;
1779
+ check_ci_llvm ! ( clang) ;
1780
+ check_ci_llvm ! ( build_config) ;
1781
+ check_ci_llvm ! ( plugins) ;
1664
1782
}
1665
1783
1666
1784
// NOTE: can never be hit when downloading from CI, since we call `check_ci_llvm!(thin_lto)` above.
1667
- if config. llvm_thin_lto && llvm . link_shared . is_none ( ) {
1785
+ if config. llvm_thin_lto && link_shared. is_none ( ) {
1668
1786
// If we're building with ThinLTO on, by default we want to link
1669
1787
// to LLVM shared, to avoid re-doing ThinLTO (which happens in
1670
1788
// the link step) with each stage.
@@ -1730,17 +1848,26 @@ impl Config {
1730
1848
build_target. llvm_filecheck = Some ( ci_llvm_bin. join ( exe ( "FileCheck" , config. build ) ) ) ;
1731
1849
}
1732
1850
1733
- if let Some ( t) = toml. dist {
1734
- config. dist_sign_folder = t. sign_folder . map ( PathBuf :: from) ;
1735
- config. dist_upload_addr = t. upload_addr ;
1736
- config. dist_compression_formats = t. compression_formats ;
1737
- set ( & mut config. dist_compression_profile , t. compression_profile ) ;
1738
- set ( & mut config. rust_dist_src , t. src_tarball ) ;
1739
- set ( & mut config. missing_tools , t. missing_tools ) ;
1740
- set ( & mut config. dist_include_mingw_linker , t. include_mingw_linker )
1851
+ if let Some ( dist) = toml. dist {
1852
+ let Dist {
1853
+ sign_folder,
1854
+ upload_addr,
1855
+ src_tarball,
1856
+ missing_tools,
1857
+ compression_formats,
1858
+ compression_profile,
1859
+ include_mingw_linker,
1860
+ } = dist;
1861
+ config. dist_sign_folder = sign_folder. map ( PathBuf :: from) ;
1862
+ config. dist_upload_addr = upload_addr;
1863
+ config. dist_compression_formats = compression_formats;
1864
+ set ( & mut config. dist_compression_profile , compression_profile) ;
1865
+ set ( & mut config. rust_dist_src , src_tarball) ;
1866
+ set ( & mut config. missing_tools , missing_tools) ;
1867
+ set ( & mut config. dist_include_mingw_linker , include_mingw_linker)
1741
1868
}
1742
1869
1743
- if let Some ( r) = build . rustfmt {
1870
+ if let Some ( r) = rustfmt {
1744
1871
* config. initial_rustfmt . borrow_mut ( ) = if r. exists ( ) {
1745
1872
RustfmtState :: SystemToolchain ( r)
1746
1873
} else {
@@ -1781,20 +1908,20 @@ impl Config {
1781
1908
let download_rustc = config. download_rustc_commit . is_some ( ) ;
1782
1909
// See https://github.com/rust-lang/compiler-team/issues/326
1783
1910
config. stage = match config. cmd {
1784
- Subcommand :: Check { .. } => flags. stage . or ( build . check_stage ) . unwrap_or ( 0 ) ,
1911
+ Subcommand :: Check { .. } => flags. stage . or ( check_stage) . unwrap_or ( 0 ) ,
1785
1912
// `download-rustc` only has a speed-up for stage2 builds. Default to stage2 unless explicitly overridden.
1786
1913
Subcommand :: Doc { .. } => {
1787
- flags. stage . or ( build . doc_stage ) . unwrap_or ( if download_rustc { 2 } else { 0 } )
1914
+ flags. stage . or ( doc_stage) . unwrap_or ( if download_rustc { 2 } else { 0 } )
1788
1915
}
1789
1916
Subcommand :: Build { .. } => {
1790
- flags. stage . or ( build . build_stage ) . unwrap_or ( if download_rustc { 2 } else { 1 } )
1917
+ flags. stage . or ( build_stage) . unwrap_or ( if download_rustc { 2 } else { 1 } )
1791
1918
}
1792
1919
Subcommand :: Test { .. } => {
1793
- flags. stage . or ( build . test_stage ) . unwrap_or ( if download_rustc { 2 } else { 1 } )
1920
+ flags. stage . or ( test_stage) . unwrap_or ( if download_rustc { 2 } else { 1 } )
1794
1921
}
1795
- Subcommand :: Bench { .. } => flags. stage . or ( build . bench_stage ) . unwrap_or ( 2 ) ,
1796
- Subcommand :: Dist { .. } => flags. stage . or ( build . dist_stage ) . unwrap_or ( 2 ) ,
1797
- Subcommand :: Install { .. } => flags. stage . or ( build . install_stage ) . unwrap_or ( 2 ) ,
1922
+ Subcommand :: Bench { .. } => flags. stage . or ( bench_stage) . unwrap_or ( 2 ) ,
1923
+ Subcommand :: Dist { .. } => flags. stage . or ( dist_stage) . unwrap_or ( 2 ) ,
1924
+ Subcommand :: Install { .. } => flags. stage . or ( install_stage) . unwrap_or ( 2 ) ,
1798
1925
// These are all bootstrap tools, which don't depend on the compiler.
1799
1926
// The stage we pass shouldn't matter, but use 0 just in case.
1800
1927
Subcommand :: Clean { .. }
0 commit comments