Skip to content

Commit daf99a4

Browse files
committed
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.
1 parent 6209e6c commit daf99a4

File tree

5 files changed

+0
-38
lines changed

5 files changed

+0
-38
lines changed

config.toml.example

-6
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

-9
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ pub struct Config {
111111
pub backtrace_on_ice: bool,
112112

113113
// llvm codegen options
114-
pub llvm_skip_rebuild: bool,
115114
pub llvm_assertions: bool,
116115
pub llvm_tests: bool,
117116
pub llvm_plugins: bool,
@@ -664,7 +663,6 @@ define_config! {
664663
define_config! {
665664
/// TOML representation of how the LLVM build is configured.
666665
struct Llvm {
667-
skip_rebuild: Option<bool> = "skip-rebuild",
668666
optimize: Option<bool> = "optimize",
669667
thin_lto: Option<bool> = "thin-lto",
670668
release_debuginfo: Option<bool> = "release-debuginfo",
@@ -1057,11 +1055,6 @@ impl Config {
10571055
config.mandir = install.mandir.map(PathBuf::from);
10581056
}
10591057

1060-
// We want the llvm-skip-rebuild flag to take precedence over the
1061-
// skip-rebuild config.toml option so we store it separately
1062-
// so that we can infer the right value
1063-
let mut llvm_skip_rebuild = flags.llvm_skip_rebuild;
1064-
10651058
// Store off these values as options because if they're not provided
10661059
// we'll infer default values for them later
10671060
let mut llvm_assertions = None;
@@ -1166,7 +1159,6 @@ impl Config {
11661159
llvm_assertions = llvm.assertions;
11671160
llvm_tests = llvm.tests;
11681161
llvm_plugins = llvm.plugins;
1169-
llvm_skip_rebuild = llvm_skip_rebuild.or(llvm.skip_rebuild);
11701162
set(&mut config.llvm_optimize, llvm.optimize);
11711163
set(&mut config.llvm_thin_lto, llvm.thin_lto);
11721164
set(&mut config.llvm_release_debuginfo, llvm.release_debuginfo);
@@ -1329,7 +1321,6 @@ impl Config {
13291321
// Now that we've reached the end of our configuration, infer the
13301322
// default values for all options that we haven't otherwise stored yet.
13311323

1332-
config.llvm_skip_rebuild = llvm_skip_rebuild.unwrap_or(false);
13331324
config.llvm_assertions = llvm_assertions.unwrap_or(false);
13341325
config.llvm_tests = llvm_tests.unwrap_or(false);
13351326
config.llvm_plugins = llvm_plugins.unwrap_or(false);

src/bootstrap/flags.rs

-13
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",
@@ -707,9 +697,6 @@ Arguments:
707697
.collect::<Vec<_>>(),
708698
include_default_paths: matches.opt_present("include-default-paths"),
709699
deny_warnings: parse_deny_warnings(&matches),
710-
llvm_skip_rebuild: matches.opt_str("llvm-skip-rebuild").map(|s| s.to_lowercase()).map(
711-
|s| s.parse::<bool>().expect("`llvm-skip-rebuild` should be either true or false"),
712-
),
713700
color: matches
714701
.opt_get_default("color", Color::Auto)
715702
.expect("`color` should be `always`, `never`, or `auto`"),

src/bootstrap/native.rs

-9
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,6 @@ pub fn prebuilt_llvm_config(
109109
let stamp = out_dir.join("llvm-finished-building");
110110
let stamp = HashStamp::new(stamp, builder.in_tree_llvm_info.sha());
111111

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

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

-1
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)