Rename require_and_update_submodule to require_submodule
Just trying to be a little less verbose here.
This commit is contained in:
parent
0f387eb39b
commit
1c98b8f922
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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 \
|
||||
|
@ -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");
|
||||
|
@ -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.
|
||||
|
@ -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."),
|
||||
);
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user