From 8becfed1c984a7efbba993a64c409d0c403848cd Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 1 Mar 2023 11:33:37 -0600 Subject: [PATCH] Remove the option to disable `llvm-version-check` We don't support old versions of LLVM; there's no reason to have an easy way to force bootstrap to use them anyway. If someone really needs to use an unsupported version, they can modify bootstrap to change the version range. --- config.toml.example | 5 ----- src/bootstrap/CHANGELOG.md | 1 + src/bootstrap/config.rs | 4 ---- src/bootstrap/configure.py | 1 - src/bootstrap/native.rs | 4 ---- 5 files changed, 1 insertion(+), 14 deletions(-) diff --git a/config.toml.example b/config.toml.example index 69eb228a2d5a0..07d2aefa98981 100644 --- a/config.toml.example +++ b/config.toml.example @@ -81,11 +81,6 @@ changelog-seen = 2 # or alternatively ... #ccache = "/path/to/ccache" -# If an external LLVM root is specified, we automatically check the version by -# default to make sure it's within the range that we're expecting, but setting -# this flag will indicate that this version check should not be done. -#version-check = true - # When true, link libstdc++ statically into the rustc_llvm. # This is useful if you don't want to use the dynamic version of that # library provided by LLVM. diff --git a/src/bootstrap/CHANGELOG.md b/src/bootstrap/CHANGELOG.md index 4105fa5ec9600..648eb553c78c1 100644 --- a/src/bootstrap/CHANGELOG.md +++ b/src/bootstrap/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - `remote-test-server`'s `verbose` argument has been removed in favor of the `--verbose` flag - `remote-test-server`'s `remote` argument has been removed in favor of the `--bind` flag. Use `--bind 0.0.0.0:12345` to replicate the behavior of the `remote` argument. - `x.py fmt` now formats only files modified between the merge-base of HEAD and the last commit in the master branch of the rust-lang repository and the current working directory. To restore old behaviour, use `x.py fmt .`. The check mode is not affected by this change. [#105702](https://github.com/rust-lang/rust/pull/105702) +- The `llvm.version-check` config option has been removed. Older versions were never supported. If you still need to support older versions (e.g. you are applying custom patches), patch `check_llvm_version` in bootstrap to change the minimum version. [#108619](https://github.com/rust-lang/rust/pull/108619) ### Non-breaking changes diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 05e742549499b..8eef3da172618 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -119,7 +119,6 @@ pub struct Config { pub llvm_optimize: bool, pub llvm_thin_lto: bool, pub llvm_release_debuginfo: bool, - pub llvm_version_check: bool, pub llvm_static_stdcpp: bool, /// `None` if `llvm_from_ci` is true and we haven't yet downloaded llvm. #[cfg(not(test))] @@ -674,7 +673,6 @@ define_config! { tests: Option = "tests", plugins: Option = "plugins", ccache: Option = "ccache", - version_check: Option = "version-check", static_libstdcpp: Option = "static-libstdcpp", ninja: Option = "ninja", targets: Option = "targets", @@ -806,7 +804,6 @@ impl Config { let mut config = Config::default(); config.llvm_optimize = true; config.ninja_in_file = true; - config.llvm_version_check = true; config.llvm_static_stdcpp = false; config.backtrace = true; config.rust_optimize = true; @@ -1174,7 +1171,6 @@ impl Config { set(&mut config.llvm_optimize, llvm.optimize); set(&mut config.llvm_thin_lto, llvm.thin_lto); set(&mut config.llvm_release_debuginfo, llvm.release_debuginfo); - set(&mut config.llvm_version_check, llvm.version_check); set(&mut config.llvm_static_stdcpp, llvm.static_libstdcpp); if let Some(v) = llvm.link_shared { config.llvm_link_shared.set(Some(v)); diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index 04e798e3949d9..00f242452a195 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -44,7 +44,6 @@ def v(*args): o("llvm-static-stdcpp", "llvm.static-libstdcpp", "statically link to libstdc++ for LLVM") o("llvm-link-shared", "llvm.link-shared", "prefer shared linking to LLVM (llvm-config --link-shared)") o("rpath", "rust.rpath", "build rpaths into rustc itself") -o("llvm-version-check", "llvm.version-check", "check if the LLVM version is supported, build anyway") o("codegen-tests", "rust.codegen-tests", "run the tests/codegen tests") o("option-checking", None, "complain about unrecognized options in this configure script") o("ninja", "llvm.ninja", "build LLVM using the Ninja generator (for MSVC, requires building in the correct environment)") diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 21157b02a78ef..37f6720150ee1 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -549,10 +549,6 @@ fn get_built_llvm_lib_path(llvm_config_path: &Path) -> PathBuf { } fn check_llvm_version(builder: &Builder<'_>, llvm_config: &Path) { - if !builder.config.llvm_version_check { - return; - } - if builder.config.dry_run() { return; }