Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable parallel rustc front end in nightly builds #117435

Merged
merged 4 commits into from Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions config.example.toml
Expand Up @@ -30,7 +30,7 @@
#
# If `change-id` does not match the version that is currently running,
# `x.py` will prompt you to update it and check the related PR for more details.
change-id = 116998
change-id = 117435

# =============================================================================
# Tweaking how LLVM is compiled
Expand Down Expand Up @@ -553,10 +553,11 @@ change-id = 116998
# Whether to always use incremental compilation when building rustc
#incremental = false

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

# The default linker that will be hard-coded into the generated
# compiler for targets that don't specify a default linker explicitly
Expand Down
5 changes: 4 additions & 1 deletion src/bootstrap/src/core/config/config.rs
Expand Up @@ -1072,6 +1072,7 @@ impl Config {
config.bindir = "bin".into();
config.dist_include_mingw_linker = true;
config.dist_compression_profile = "fast".into();
config.rustc_parallel = true;

config.stdout_is_tty = std::io::stdout().is_terminal();
config.stderr_is_tty = std::io::stderr().is_terminal();
Expand Down Expand Up @@ -1429,7 +1430,9 @@ impl Config {
set(&mut config.use_lld, rust.use_lld);
set(&mut config.lld_enabled, rust.lld);
set(&mut config.llvm_tools_enabled, rust.llvm_tools);
config.rustc_parallel = rust.parallel_compiler.unwrap_or(false);
config.rustc_parallel = rust
.parallel_compiler
.unwrap_or(config.channel == "dev" || config.channel == "nightly");
oli-obk marked this conversation as resolved.
Show resolved Hide resolved
config.rustc_default_linker = rust.default_linker;
config.musl_root = rust.musl_root.map(PathBuf::from);
config.save_toolstates = rust.save_toolstates.map(PathBuf::from);
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/lib.rs
Expand Up @@ -77,7 +77,7 @@ const LLD_FILE_NAMES: &[&str] = &["ld.lld", "ld64.lld", "lld-link", "wasm-ld"];
///
/// If you make any major changes (such as adding new values or changing default values), please
/// ensure that the associated PR ID is added to the end of this list.
pub const CONFIG_CHANGE_HISTORY: &[usize] = &[115898, 116998];
pub const CONFIG_CHANGE_HISTORY: &[usize] = &[115898, 116998, 117435];
Copy link
Member

@RalfJung RalfJung Nov 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you do this, please explain in the PR description what we have to do to update our configs. I was sent here by bootstrap ("WARNING: there have been changes to x.py since you last updated") and now I have no idea what I'm supposed to do.


/// Extra --check-cfg to add when building
/// (Mode restriction, config name, config values (if any))
Expand Down
4 changes: 2 additions & 2 deletions src/ci/run.sh
Expand Up @@ -98,8 +98,8 @@ if [ "$DEPLOY$DEPLOY_ALT" = "1" ]; then
if [ "$NO_LLVM_ASSERTIONS" = "1" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"
elif [ "$DEPLOY_ALT" != "" ]; then
if [ "$NO_PARALLEL_COMPILER" = "" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.parallel-compiler"
if [ "$ALT_PARALLEL_COMPILER" = "" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.parallel-compiler=false"
davidtwco marked this conversation as resolved.
Show resolved Hide resolved
fi
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-assertions"
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.verify-llvm-ir"
Expand Down