Skip to content

Commit 925baa8

Browse files
authored
Rollup merge of rust-lang#108613 - jyn514:rm-skip-rebuild, r=Mark-Simulacrum
Remove `llvm.skip-rebuild` option This was added to in 2019 to speed up rebuild times when LLVM was modified. Now that download-ci-llvm exists, I don't think it makes sense to support an unsound option like this that can lead to miscompiles; and the code cleanup is nice too. r? `@Mark-Simulacrum` cc `@varkor` rust-lang#65612
2 parents 2f8bf34 + daf99a4 commit 925baa8

File tree

5 files changed

+0
-38
lines changed

5 files changed

+0
-38
lines changed

config.toml.example

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,6 @@ changelog-seen = 2
4646
# Defaults to "if-available" when `channel = "dev"` and "false" otherwise.
4747
#download-ci-llvm = "if-available"
4848

49-
# Indicates whether LLVM rebuild should be skipped when running bootstrap. If
50-
# this is `false` then the compiler's LLVM will be rebuilt whenever the built
51-
# version doesn't have the correct hash. If it is `true` then LLVM will never
52-
# be rebuilt. The default value is `false`.
53-
#skip-rebuild = false
54-
5549
# Indicates whether the LLVM build is a Release or Debug build
5650
#optimize = true
5751

src/bootstrap/config.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ pub struct Config {
112112
pub backtrace_on_ice: bool,
113113

114114
// llvm codegen options
115-
pub llvm_skip_rebuild: bool,
116115
pub llvm_assertions: bool,
117116
pub llvm_tests: bool,
118117
pub llvm_plugins: bool,
@@ -666,7 +665,6 @@ define_config! {
666665
define_config! {
667666
/// TOML representation of how the LLVM build is configured.
668667
struct Llvm {
669-
skip_rebuild: Option<bool> = "skip-rebuild",
670668
optimize: Option<bool> = "optimize",
671669
thin_lto: Option<bool> = "thin-lto",
672670
release_debuginfo: Option<bool> = "release-debuginfo",
@@ -1060,11 +1058,6 @@ impl Config {
10601058
config.mandir = install.mandir.map(PathBuf::from);
10611059
}
10621060

1063-
// We want the llvm-skip-rebuild flag to take precedence over the
1064-
// skip-rebuild config.toml option so we store it separately
1065-
// so that we can infer the right value
1066-
let mut llvm_skip_rebuild = flags.llvm_skip_rebuild;
1067-
10681061
// Store off these values as options because if they're not provided
10691062
// we'll infer default values for them later
10701063
let mut llvm_assertions = None;
@@ -1170,7 +1163,6 @@ impl Config {
11701163
llvm_assertions = llvm.assertions;
11711164
llvm_tests = llvm.tests;
11721165
llvm_plugins = llvm.plugins;
1173-
llvm_skip_rebuild = llvm_skip_rebuild.or(llvm.skip_rebuild);
11741166
set(&mut config.llvm_optimize, llvm.optimize);
11751167
set(&mut config.llvm_thin_lto, llvm.thin_lto);
11761168
set(&mut config.llvm_release_debuginfo, llvm.release_debuginfo);
@@ -1324,7 +1316,6 @@ impl Config {
13241316
// Now that we've reached the end of our configuration, infer the
13251317
// default values for all options that we haven't otherwise stored yet.
13261318

1327-
config.llvm_skip_rebuild = llvm_skip_rebuild.unwrap_or(false);
13281319
config.llvm_assertions = llvm_assertions.unwrap_or(false);
13291320
config.llvm_tests = llvm_tests.unwrap_or(false);
13301321
config.llvm_plugins = llvm_plugins.unwrap_or(false);

src/bootstrap/flags.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ pub struct Flags {
6767
// true => deny, false => warn
6868
pub deny_warnings: Option<bool>,
6969

70-
pub llvm_skip_rebuild: Option<bool>,
71-
7270
pub rust_profile_use: Option<String>,
7371
pub rust_profile_generate: Option<String>,
7472

@@ -249,14 +247,6 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
249247
opts.optopt("", "error-format", "rustc error format", "FORMAT");
250248
opts.optflag("", "json-output", "use message-format=json");
251249
opts.optopt("", "color", "whether to use color in cargo and rustc output", "STYLE");
252-
opts.optopt(
253-
"",
254-
"llvm-skip-rebuild",
255-
"whether rebuilding llvm should be skipped \
256-
a VALUE of TRUE indicates that llvm will not be rebuilt \
257-
VALUE overrides the skip-rebuild option in config.toml.",
258-
"VALUE",
259-
);
260250
opts.optopt(
261251
"",
262252
"rust-profile-generate",
@@ -714,9 +704,6 @@ Arguments:
714704
.collect::<Vec<_>>(),
715705
include_default_paths: matches.opt_present("include-default-paths"),
716706
deny_warnings: parse_deny_warnings(&matches),
717-
llvm_skip_rebuild: matches.opt_str("llvm-skip-rebuild").map(|s| s.to_lowercase()).map(
718-
|s| s.parse::<bool>().expect("`llvm-skip-rebuild` should be either true or false"),
719-
),
720707
color: matches
721708
.opt_get_default("color", Color::Auto)
722709
.expect("`color` should be `always`, `never`, or `auto`"),

src/bootstrap/native.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,6 @@ pub fn prebuilt_llvm_config(
108108
let stamp = out_dir.join("llvm-finished-building");
109109
let stamp = HashStamp::new(stamp, builder.in_tree_llvm_info.sha());
110110

111-
if builder.config.llvm_skip_rebuild && stamp.path.exists() {
112-
builder.info(
113-
"Warning: \
114-
Using a potentially stale build of LLVM; \
115-
This may not behave well.",
116-
);
117-
return Ok(res);
118-
}
119-
120111
if stamp.is_done() {
121112
if stamp.hash.is_none() {
122113
builder.info(

src/doc/rustc/src/platform-support/armeb-unknown-linux-gnueabi.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Therefore, you can build Rust with support for the target by adding it to the ta
2626
```toml
2727
[llvm]
2828
download-ci-llvm = false
29-
skip-rebuild = true
3029
optimize = true
3130
ninja = true
3231
targets = "ARM;X86"

0 commit comments

Comments
 (0)