Skip to content

Commit 4d18ea5

Browse files
committed
Revert global default for download-rustc to false
And only use `download-rustc = "if-unchanged"` for the `library` and `tools` profile defaults.
1 parent ee4a56e commit 4d18ea5

File tree

7 files changed

+31
-10
lines changed

7 files changed

+31
-10
lines changed

Diff for: config.example.toml

+10-7
Original file line numberDiff line numberDiff line change
@@ -496,15 +496,18 @@
496496
#
497497
#debug = false
498498

499-
# Whether to download the stage 1 and 2 compilers from CI.
500-
# This is useful if you are working on tools, doc-comments, or library (you will be able to build
501-
# the standard library without needing to build the compiler).
499+
# Whether to download the stage 1 and 2 compilers from CI. This is useful if you
500+
# are working on tools, doc-comments, or library (you will be able to build the
501+
# standard library without needing to build the compiler).
502502
#
503-
# Set this to "if-unchanged" if you are working on `src/tools`, `tests` or `library` (on CI, `library`
504-
# changes triggers in-tree compiler build) to speed up the build process.
503+
# Set this to "if-unchanged" if you are working on `src/tools`, `tests` or
504+
# `library` (on CI, `library` changes triggers in-tree compiler build) to speed
505+
# up the build process if you don't need to build a compiler from the latest
506+
# commit from `master`.
505507
#
506-
# Set this to `true` to always download or `false` to always use the in-tree compiler.
507-
#download-rustc = "if-unchanged"
508+
# Set this to `true` to always download or `false` to always use the in-tree
509+
# compiler.
510+
#download-rustc = false
508511

509512
# Number of codegen units to use for each compiler invocation. A value of 0
510513
# means "the number of cores on this machine", and 1+ is passed through to the

Diff for: src/bootstrap/defaults/config.compiler.toml

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ lto = "off"
1919
# Forces frame pointers to be used with `-Cforce-frame-pointers`.
2020
# This can be helpful for profiling at a small performance cost.
2121
frame-pointers = true
22+
# Compiler contributors often want to build rustc even without any changes to
23+
# e.g. check that it builds locally and check the baseline behavior of a
24+
# compiler built from latest `master` commit.
2225
download-rustc = false
2326

2427
[llvm]

Diff for: src/bootstrap/defaults/config.dist.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ download-ci-llvm = false
1616
# We have several defaults in bootstrap that depend on whether the channel is `dev` (e.g. `omit-git-hash` and `download-ci-llvm`).
1717
# Make sure they don't get set when installing from source.
1818
channel = "nightly"
19+
# Never download a rustc, distributions must build a fresh compiler.
1920
download-rustc = false
2021
lld = true
2122
# Build the llvm-bitcode-linker

Diff for: src/bootstrap/defaults/config.library.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ bench-stage = 0
1010
incremental = true
1111
# Make the compiler and standard library faster to build, at the expense of a ~20% runtime slowdown.
1212
lto = "off"
13-
download-rustc = false
13+
# Download rustc by default for library profile if compiler-affecting
14+
# directories are not modified. For CI this is disabled.
15+
download-rustc = "if-unchanged"
1416

1517
[llvm]
1618
# Will download LLVM from CI if available on your platform.

Diff for: src/bootstrap/defaults/config.tools.toml

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
[rust]
44
# This greatly increases the speed of rebuilds, especially when there are only minor changes. However, it makes the initial build slightly slower.
55
incremental = true
6+
# Most commonly, tools contributors do not need to modify the compiler, so
7+
# downloading a CI rustc is a good default for tools profile.
8+
download-rustc = "if-unchanged"
69

710
[build]
811
# Document with the in-tree rustdoc by default, since `download-rustc` makes it quick to compile.

Diff for: src/bootstrap/src/core/config/config.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -2782,8 +2782,12 @@ impl Config {
27822782

27832783
// If `download-rustc` is not set, default to rebuilding.
27842784
let if_unchanged = match download_rustc {
2785-
None => self.rust_info.is_managed_git_subrepository(),
2786-
Some(StringOrBool::Bool(false)) => return None,
2785+
// Globally default for `download-rustc` to `false`, because some contributors don't use
2786+
// profiles for reasons such as:
2787+
// - They need to seemlessly switch between compiler/library work.
2788+
// - They don't want to use compiler profile because they need to override too many
2789+
// things and it's easier to not use a profile.
2790+
None | Some(StringOrBool::Bool(false)) => return None,
27872791
Some(StringOrBool::Bool(true)) => false,
27882792
Some(StringOrBool::String(s)) if s == "if-unchanged" => {
27892793
if !self.rust_info.is_managed_git_subrepository() {

Diff for: src/bootstrap/src/utils/change_tracker.rs

+5
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
300300
severity: ChangeSeverity::Info,
301301
summary: "`download-rustc='if-unchanged'` is now a default option for library profile.",
302302
},
303+
ChangeInfo {
304+
change_id: 133068,
305+
severity: ChangeSeverity::Info,
306+
summary: "Reverted `download-rustc` defaults; global default is now `false`, and only use `'if-unchanged'` default for library and tools profile.",
307+
},
303308
];

0 commit comments

Comments
 (0)