Skip to content

Commit bb4d1c3

Browse files
committed
Auto merge of rust-lang#117435 - SparrowLii:nightly_parallel, r=oli-obk
enable parallel rustc front end in nightly builds Refers to the [MCP](rust-lang/compiler-team#681), this pr does: 1. Enable the parallel front end in nightly builds, and keep the default number of threads as 1. Then users can use the parallel rustc front end via -Z threads=n option. 2. Set it up to serial front end for beta/stable builds via bootstrap. 3. Switch over the alt builders from parallel rustc to serial, so we have artifacts without parallel to test against the artifacts with parallel. r? `@oli-obk` cc `@cjgillot` `@nnethercote` `@bjorn3` `@Kobzol`
2 parents a026bd4 + 248dd14 commit bb4d1c3

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

config.example.toml

+6-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#
3131
# If `change-id` does not match the version that is currently running,
3232
# `x.py` will prompt you to update it and check the related PR for more details.
33-
change-id = 116998
33+
change-id = 117435
3434

3535
# =============================================================================
3636
# Tweaking how LLVM is compiled
@@ -553,10 +553,11 @@ change-id = 116998
553553
# Whether to always use incremental compilation when building rustc
554554
#incremental = false
555555

556-
# Build a multi-threaded rustc
557-
# FIXME(#75760): Some UI tests fail when this option is enabled.
558-
# NOTE: This option is NOT SUPPORTED. See #48685.
559-
#parallel-compiler = false
556+
# Build a multi-threaded rustc. This allows users to use parallel rustc
557+
# via the unstable option `-Z threads=n`.
558+
# Since stable/beta channels only allow using stable features,
559+
# `parallel-compiler = false` should be set for these channels.
560+
#parallel-compiler = true
560561

561562
# The default linker that will be hard-coded into the generated
562563
# compiler for targets that don't specify a default linker explicitly

src/bootstrap/src/core/config/config.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,7 @@ impl Config {
10721072
config.bindir = "bin".into();
10731073
config.dist_include_mingw_linker = true;
10741074
config.dist_compression_profile = "fast".into();
1075+
config.rustc_parallel = true;
10751076

10761077
config.stdout_is_tty = std::io::stdout().is_terminal();
10771078
config.stderr_is_tty = std::io::stderr().is_terminal();
@@ -1429,7 +1430,9 @@ impl Config {
14291430
set(&mut config.use_lld, rust.use_lld);
14301431
set(&mut config.lld_enabled, rust.lld);
14311432
set(&mut config.llvm_tools_enabled, rust.llvm_tools);
1432-
config.rustc_parallel = rust.parallel_compiler.unwrap_or(false);
1433+
config.rustc_parallel = rust
1434+
.parallel_compiler
1435+
.unwrap_or(config.channel == "dev" || config.channel == "nightly");
14331436
config.rustc_default_linker = rust.default_linker;
14341437
config.musl_root = rust.musl_root.map(PathBuf::from);
14351438
config.save_toolstates = rust.save_toolstates.map(PathBuf::from);

src/bootstrap/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const LLD_FILE_NAMES: &[&str] = &["ld.lld", "ld64.lld", "lld-link", "wasm-ld"];
7777
///
7878
/// If you make any major changes (such as adding new values or changing default values), please
7979
/// ensure that the associated PR ID is added to the end of this list.
80-
pub const CONFIG_CHANGE_HISTORY: &[usize] = &[115898, 116998];
80+
pub const CONFIG_CHANGE_HISTORY: &[usize] = &[115898, 116998, 117435];
8181

8282
/// Extra --check-cfg to add when building
8383
/// (Mode restriction, config name, config values (if any))

src/ci/run.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ if [ "$DEPLOY$DEPLOY_ALT" = "1" ]; then
9898
if [ "$NO_LLVM_ASSERTIONS" = "1" ]; then
9999
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"
100100
elif [ "$DEPLOY_ALT" != "" ]; then
101-
if [ "$NO_PARALLEL_COMPILER" = "" ]; then
102-
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.parallel-compiler"
101+
if [ "$ALT_PARALLEL_COMPILER" = "" ]; then
102+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.parallel-compiler=false"
103103
fi
104104
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-assertions"
105105
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.verify-llvm-ir"

0 commit comments

Comments
 (0)