diff --git a/config.toml.example b/config.toml.example index dd886879b14..a7968bca7be 100644 --- a/config.toml.example +++ b/config.toml.example @@ -240,10 +240,6 @@ changelog-seen = 2 # Indicate whether git submodules are managed and updated automatically. #submodules = true -# Update git submodules only when the checked out commit in the submodules differs -# from what is committed in the main rustc repo. -#fast-submodules = true - # The path to (or name of) the GDB executable to use. This is only used for # executing the debuginfo test suite. #gdb = "gdb" diff --git a/src/bootstrap/CHANGELOG.md b/src/bootstrap/CHANGELOG.md index 5324c6bde4e..add73ebd44b 100644 --- a/src/bootstrap/CHANGELOG.md +++ b/src/bootstrap/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - The options `infodir`, `localstatedir`, and `gpg-password-file` are no longer allowed in config.toml. Previously, they were ignored without warning. Note that `infodir` and `localstatedir` are still accepted by `./configure`, with a warning. [#82451](https://github.com/rust-lang/rust/pull/82451) - Add options for enabling overflow checks, one for std (`overflow-checks-std`) and one for everything else (`overflow-checks`). Both default to false. - Change the names for `dist` commands to match the component they generate. [#90684](https://github.com/rust-lang/rust/pull/90684) +- The `build.fast-submodules` option has been removed. Fast submodule checkouts are enabled unconditionally. Automatic submodule handling can still be disabled with `build.submodules = false`. ### Non-breaking changes diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 6d46ea26e6a..916c8e5d187 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -926,23 +926,19 @@ class RustBuild(object): return config return default_build_triple(self.verbose) - def check_submodule(self, module, slow_submodules): - if not slow_submodules: - checked_out = subprocess.Popen(["git", "rev-parse", "HEAD"], - cwd=os.path.join(self.rust_root, module), - stdout=subprocess.PIPE) - return checked_out - else: - return None + def check_submodule(self, module): + checked_out = subprocess.Popen(["git", "rev-parse", "HEAD"], + cwd=os.path.join(self.rust_root, module), + stdout=subprocess.PIPE) + return checked_out def update_submodule(self, module, checked_out, recorded_submodules): module_path = os.path.join(self.rust_root, module) - if checked_out is not None: - default_encoding = sys.getdefaultencoding() - checked_out = checked_out.communicate()[0].decode(default_encoding).strip() - if recorded_submodules[module] == checked_out: - return + default_encoding = sys.getdefaultencoding() + checked_out = checked_out.communicate()[0].decode(default_encoding).strip() + if recorded_submodules[module] == checked_out: + return print("Updating submodule", module) @@ -991,12 +987,8 @@ class RustBuild(object): git_version_str = require(['git', '--version']).split()[2].decode(default_encoding) self.git_version = distutils.version.LooseVersion(git_version_str) - slow_submodules = self.get_toml('fast-submodules') == "false" start_time = time() - if slow_submodules: - print('Unconditionally updating submodules') - else: - print('Updating only changed submodules') + print('Updating only changed submodules') default_encoding = sys.getdefaultencoding() # Only update submodules that are needed to build bootstrap. These are needed because Cargo # currently requires everything in a workspace to be "locally present" when starting a @@ -1022,7 +1014,7 @@ class RustBuild(object): filtered_submodules = [] submodules_names = [] for module in submodules: - check = self.check_submodule(module, slow_submodules) + check = self.check_submodule(module) filtered_submodules.append((module, check)) submodules_names.append(module) recorded = subprocess.Popen(["git", "ls-tree", "HEAD"] + submodules_names, diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index e39c9fa1c5a..f9acd52274f 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -50,7 +50,6 @@ pub struct Config { pub ninja_in_file: bool, pub verbose: usize, pub submodules: Option, - pub fast_submodules: bool, pub compiler_docs: bool, pub docs_minification: bool, pub docs: bool, @@ -517,7 +516,6 @@ struct Build { compiler_docs: Option = "compiler-docs", docs_minification: Option = "docs-minification", submodules: Option = "submodules", - fast_submodules: Option = "fast-submodules", gdb: Option = "gdb", nodejs: Option = "nodejs", npm: Option = "npm", @@ -705,7 +703,6 @@ pub fn default_opts() -> Config { config.rust_optimize = true; config.rust_optimize_tests = true; config.submodules = None; - config.fast_submodules = true; config.docs = true; config.docs_minification = true; config.rust_rpath = true; @@ -847,7 +844,6 @@ pub fn parse(args: &[String]) -> Config { set(&mut config.compiler_docs, build.compiler_docs); set(&mut config.docs_minification, build.docs_minification); set(&mut config.docs, build.docs); - set(&mut config.fast_submodules, build.fast_submodules); set(&mut config.locked_deps, build.locked_deps); set(&mut config.vendor, build.vendor); set(&mut config.full_bootstrap, build.full_bootstrap); diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index a4e35bf6d47..769382525fb 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -556,27 +556,24 @@ fn dir_is_empty(dir: &Path) -> bool { } // check_submodule - if self.config.fast_submodules { - let checked_out_hash = output( - Command::new("git").args(&["rev-parse", "HEAD"]).current_dir(&absolute_path), - ); - // update_submodules - let recorded = output( - Command::new("git") - .args(&["ls-tree", "HEAD"]) - .arg(relative_path) - .current_dir(&self.config.src), - ); - let actual_hash = recorded - .split_whitespace() - .nth(2) - .unwrap_or_else(|| panic!("unexpected output `{}`", recorded)); + let checked_out_hash = + output(Command::new("git").args(&["rev-parse", "HEAD"]).current_dir(&absolute_path)); + // update_submodules + let recorded = output( + Command::new("git") + .args(&["ls-tree", "HEAD"]) + .arg(relative_path) + .current_dir(&self.config.src), + ); + let actual_hash = recorded + .split_whitespace() + .nth(2) + .unwrap_or_else(|| panic!("unexpected output `{}`", recorded)); - // update_submodule - if actual_hash == checked_out_hash.trim_end() { - // already checked out - return; - } + // update_submodule + if actual_hash == checked_out_hash.trim_end() { + // already checked out + return; } println!("Updating submodule {}", relative_path.display());