From 1c98b8f9226d0e7a4e0ef42dd558de2857812f7a Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 27 Jul 2024 08:07:53 -0700 Subject: [PATCH] Rename require_and_update_submodule to require_submodule Just trying to be a little less verbose here. --- src/bootstrap/src/core/build_steps/check.rs | 2 +- src/bootstrap/src/core/build_steps/clippy.rs | 2 +- src/bootstrap/src/core/build_steps/compile.rs | 6 +++--- src/bootstrap/src/core/build_steps/dist.rs | 2 +- src/bootstrap/src/core/build_steps/doc.rs | 8 ++++---- src/bootstrap/src/core/build_steps/llvm.rs | 4 ++-- src/bootstrap/src/core/build_steps/test.rs | 6 +++--- src/bootstrap/src/core/build_steps/tool.rs | 8 ++++---- src/bootstrap/src/core/build_steps/vendor.rs | 2 +- src/bootstrap/src/core/builder/tests.rs | 2 +- src/bootstrap/src/lib.rs | 8 ++++---- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs index 5b720ffbc76..3e0bb2884cd 100644 --- a/src/bootstrap/src/core/build_steps/check.rs +++ b/src/bootstrap/src/core/build_steps/check.rs @@ -52,7 +52,7 @@ fn make_run(run: RunConfig<'_>) { } fn run(self, builder: &Builder<'_>) { - builder.require_and_update_submodule("library/stdarch", None); + builder.require_submodule("library/stdarch", None); let target = self.target; let compiler = builder.compiler(builder.top_stage, builder.config.build); diff --git a/src/bootstrap/src/core/build_steps/clippy.rs b/src/bootstrap/src/core/build_steps/clippy.rs index add28f858ef..68abf1e464a 100644 --- a/src/bootstrap/src/core/build_steps/clippy.rs +++ b/src/bootstrap/src/core/build_steps/clippy.rs @@ -125,7 +125,7 @@ fn make_run(run: RunConfig<'_>) { } fn run(self, builder: &Builder<'_>) { - builder.require_and_update_submodule("library/stdarch", None); + builder.require_submodule("library/stdarch", None); let target = self.target; let compiler = builder.compiler(builder.top_stage, builder.config.build); diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 6bea163cdfe..59649058046 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -182,11 +182,11 @@ fn run(self, builder: &Builder<'_>) { return; } - builder.require_and_update_submodule("library/stdarch", None); + builder.require_submodule("library/stdarch", None); // Profiler information requires LLVM's compiler-rt if builder.config.profiler { - builder.require_and_update_submodule( + builder.require_submodule( "src/llvm-project", Some( "The `build.profiler` config option requires `compiler-rt` sources from LLVM.", @@ -461,7 +461,7 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car // That's probably ok? At least, the difference wasn't enforced before. There's a comment in // the compiler_builtins build script that makes me nervous, though: // https://github.com/rust-lang/compiler-builtins/blob/31ee4544dbe47903ce771270d6e3bea8654e9e50/build.rs#L575-L579 - builder.require_and_update_submodule( + builder.require_submodule( "src/llvm-project", Some( "The `build.optimized-compiler-builtins` config option \ diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index 998f083b676..4f4ef29c1d7 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -907,7 +907,7 @@ fn make_run(run: RunConfig<'_>) { /// Creates the `rust-src` installer component fn run(self, builder: &Builder<'_>) -> GeneratedTarball { if !builder.config.dry_run() { - builder.require_and_update_submodule("src/llvm-project", None); + builder.require_submodule("src/llvm-project", None); } let tarball = Tarball::new_targetless(builder, "rust-src"); diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs index 1fbc78a94df..bdd48fa644a 100644 --- a/src/bootstrap/src/core/build_steps/doc.rs +++ b/src/bootstrap/src/core/build_steps/doc.rs @@ -54,7 +54,7 @@ fn make_run(run: RunConfig<'_>) { fn run(self, builder: &Builder<'_>) { $( let path = submodule_helper!( $path, submodule $( = $submodule )? ); - builder.require_and_update_submodule(path, None); + builder.require_submodule(path, None); )? builder.ensure(RustbookSrc { target: self.target, @@ -224,7 +224,7 @@ fn make_run(run: RunConfig<'_>) { /// * Index page /// * Redirect pages fn run(self, builder: &Builder<'_>) { - builder.require_and_update_submodule("src/doc/book", None); + builder.require_submodule("src/doc/book", None); let compiler = self.compiler; let target = self.target; @@ -934,7 +934,7 @@ fn run(self, builder: &Builder<'_>) { let source_type = SourceType::Submodule; let path = submodule_helper!( $path, submodule $( = $submodule )? ); - builder.require_and_update_submodule(path, None); + builder.require_submodule(path, None); )? let stage = builder.top_stage; @@ -1252,7 +1252,7 @@ fn make_run(run: RunConfig<'_>) { /// Builds the reference book. fn run(self, builder: &Builder<'_>) { - builder.require_and_update_submodule("src/doc/reference", None); + builder.require_submodule("src/doc/reference", None); // This is needed for generating links to the standard library using // the mdbook-spec plugin. diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index b302e6eb632..369e14df14b 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -1198,7 +1198,7 @@ fn make_run(run: RunConfig<'_>) { /// Build crtbegin.o/crtend.o for musl target. fn run(self, builder: &Builder<'_>) -> Self::Output { - builder.require_and_update_submodule( + builder.require_submodule( "src/llvm-project", Some("The LLVM sources are required for the CRT from `compiler-rt`."), ); @@ -1274,7 +1274,7 @@ fn make_run(run: RunConfig<'_>) { /// Build libunwind.a fn run(self, builder: &Builder<'_>) -> Self::Output { - builder.require_and_update_submodule( + builder.require_submodule( "src/llvm-project", Some("The LLVM sources are required for libunwind."), ); diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index e2eef1baaf5..daafb41e9d8 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -2287,7 +2287,7 @@ fn make_run(run: RunConfig<'_>) { fn run(self, builder: &Builder<'_>) { $( for submodule in $submodules { - builder.require_and_update_submodule(submodule, None); + builder.require_submodule(submodule, None); } )* builder.ensure(BookTest { @@ -2409,7 +2409,7 @@ fn make_run(run: RunConfig<'_>) { fn run(self, builder: &Builder<'_>) { let relative_path = "src/doc/rustc-dev-guide"; - builder.require_and_update_submodule(relative_path, None); + builder.require_submodule(relative_path, None); let src = builder.src.join(relative_path); let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook).delay_failure(); @@ -3019,7 +3019,7 @@ fn run(self, builder: &Builder<'_>) { let _guard = builder.msg(Kind::Test, 0, "bootstrap", host, host); // Some tests require cargo submodule to be present. - builder.build.require_and_update_submodule("src/tools/cargo", None); + builder.build.require_submodule("src/tools/cargo", None); let mut check_bootstrap = command(builder.python()); check_bootstrap diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs index 57447117b29..a0cb0b0dbb9 100644 --- a/src/bootstrap/src/core/build_steps/tool.rs +++ b/src/bootstrap/src/core/build_steps/tool.rs @@ -290,7 +290,7 @@ fn make_run(run: RunConfig<'_>) { fn run(self, builder: &Builder<'_>) -> PathBuf { $( for submodule in $submodules { - builder.require_and_update_submodule(submodule, None); + builder.require_submodule(submodule, None); } )* builder.ensure(ToolBuild { @@ -373,7 +373,7 @@ fn make_run(run: RunConfig<'_>) { fn run(self, builder: &Builder<'_>) -> PathBuf { // We need to ensure the rustc-perf submodule is initialized when building opt-dist since // the tool requires it to be in place to run. - builder.require_and_update_submodule("src/tools/rustc-perf", None); + builder.require_submodule("src/tools/rustc-perf", None); builder.ensure(ToolBuild { compiler: self.compiler, @@ -414,7 +414,7 @@ fn make_run(run: RunConfig<'_>) { fn run(self, builder: &Builder<'_>) -> PathBuf { // We need to ensure the rustc-perf submodule is initialized. - builder.require_and_update_submodule("src/tools/rustc-perf", None); + builder.require_submodule("src/tools/rustc-perf", None); let tool = ToolBuild { compiler: self.compiler, @@ -715,7 +715,7 @@ fn make_run(run: RunConfig<'_>) { } fn run(self, builder: &Builder<'_>) -> PathBuf { - builder.build.require_and_update_submodule("src/tools/cargo", None); + builder.build.require_submodule("src/tools/cargo", None); builder.ensure(ToolBuild { compiler: self.compiler, diff --git a/src/bootstrap/src/core/build_steps/vendor.rs b/src/bootstrap/src/core/build_steps/vendor.rs index d5cd3c0832a..8732b30e940 100644 --- a/src/bootstrap/src/core/build_steps/vendor.rs +++ b/src/bootstrap/src/core/build_steps/vendor.rs @@ -37,7 +37,7 @@ fn run(self, builder: &Builder<'_>) -> Self::Output { // These submodules must be present for `x vendor` to work. for submodule in SUBMODULES_FOR_RUSTBOOK.iter().chain(["src/tools/cargo"].iter()) { - builder.build.require_and_update_submodule(submodule, None); + builder.build.require_submodule(submodule, None); } // Sync these paths by default. diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index f9d6d551370..ccabcad243f 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -24,7 +24,7 @@ fn configure_with_args(cmd: &[String], host: &[&str], target: &[&str]) -> Config rust_codegen_backends: vec![], ..Config::parse(&["check".to_owned()]) }); - submodule_build.require_and_update_submodule("src/doc/book", None); + submodule_build.require_submodule("src/doc/book", None); config.submodules = Some(false); config.ninja_in_file = false; diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 49df30022e3..d4303aab6d6 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -441,7 +441,7 @@ pub fn new(mut config: Config) -> Build { // Cargo.toml files. let rust_submodules = ["library/backtrace", "library/stdarch"]; for s in rust_submodules { - build.require_and_update_submodule( + build.require_submodule( s, Some( "The submodule is required for the standard library \ @@ -482,7 +482,7 @@ pub fn new(mut config: Config) -> Build { /// /// This *does not* update the submodule if `config.toml` explicitly says /// not to, or if we're not in a git repository (like a plain source - /// tarball). Typically [`Build::require_and_update_submodule`] should be + /// tarball). Typically [`Build::require_submodule`] should be /// used instead to provide a nice error to the user if the submodule is /// missing. fn update_submodule(&self, relative_path: &str) { @@ -599,7 +599,7 @@ fn update_submodule(&self, relative_path: &str) { /// /// The given `err_hint` will be shown to the user if the submodule is not /// checked out and submodule management is disabled. - pub fn require_and_update_submodule(&self, submodule: &str, err_hint: Option<&str>) { + pub fn require_submodule(&self, submodule: &str, err_hint: Option<&str>) { // When testing bootstrap itself, it is much faster to ignore // submodules. Almost all Steps work fine without their submodules. if cfg!(test) && !self.config.submodules() { @@ -628,7 +628,7 @@ pub fn require_and_update_submodule(&self, submodule: &str, err_hint: Option<&st /// management is disabled and the submodule does not exist. pub fn require_and_update_all_submodules(&self) { for submodule in build_helper::util::parse_gitmodules(&self.src) { - self.require_and_update_submodule(submodule, None); + self.require_submodule(submodule, None); } }