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<'_>) {
|
fn run(self, builder: &Builder<'_>) {
|
||||||
builder.require_and_update_submodule("library/stdarch", None);
|
builder.require_submodule("library/stdarch", None);
|
||||||
|
|
||||||
let target = self.target;
|
let target = self.target;
|
||||||
let compiler = builder.compiler(builder.top_stage, builder.config.build);
|
let compiler = builder.compiler(builder.top_stage, builder.config.build);
|
||||||
|
@ -125,7 +125,7 @@ fn make_run(run: RunConfig<'_>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn run(self, builder: &Builder<'_>) {
|
fn run(self, builder: &Builder<'_>) {
|
||||||
builder.require_and_update_submodule("library/stdarch", None);
|
builder.require_submodule("library/stdarch", None);
|
||||||
|
|
||||||
let target = self.target;
|
let target = self.target;
|
||||||
let compiler = builder.compiler(builder.top_stage, builder.config.build);
|
let compiler = builder.compiler(builder.top_stage, builder.config.build);
|
||||||
|
@ -182,11 +182,11 @@ fn run(self, builder: &Builder<'_>) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.require_and_update_submodule("library/stdarch", None);
|
builder.require_submodule("library/stdarch", None);
|
||||||
|
|
||||||
// Profiler information requires LLVM's compiler-rt
|
// Profiler information requires LLVM's compiler-rt
|
||||||
if builder.config.profiler {
|
if builder.config.profiler {
|
||||||
builder.require_and_update_submodule(
|
builder.require_submodule(
|
||||||
"src/llvm-project",
|
"src/llvm-project",
|
||||||
Some(
|
Some(
|
||||||
"The `build.profiler` config option requires `compiler-rt` sources from LLVM.",
|
"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
|
// 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:
|
// the compiler_builtins build script that makes me nervous, though:
|
||||||
// https://github.com/rust-lang/compiler-builtins/blob/31ee4544dbe47903ce771270d6e3bea8654e9e50/build.rs#L575-L579
|
// https://github.com/rust-lang/compiler-builtins/blob/31ee4544dbe47903ce771270d6e3bea8654e9e50/build.rs#L575-L579
|
||||||
builder.require_and_update_submodule(
|
builder.require_submodule(
|
||||||
"src/llvm-project",
|
"src/llvm-project",
|
||||||
Some(
|
Some(
|
||||||
"The `build.optimized-compiler-builtins` config option \
|
"The `build.optimized-compiler-builtins` config option \
|
||||||
|
@ -907,7 +907,7 @@ fn make_run(run: RunConfig<'_>) {
|
|||||||
/// Creates the `rust-src` installer component
|
/// Creates the `rust-src` installer component
|
||||||
fn run(self, builder: &Builder<'_>) -> GeneratedTarball {
|
fn run(self, builder: &Builder<'_>) -> GeneratedTarball {
|
||||||
if !builder.config.dry_run() {
|
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");
|
let tarball = Tarball::new_targetless(builder, "rust-src");
|
||||||
|
@ -54,7 +54,7 @@ fn make_run(run: RunConfig<'_>) {
|
|||||||
fn run(self, builder: &Builder<'_>) {
|
fn run(self, builder: &Builder<'_>) {
|
||||||
$(
|
$(
|
||||||
let path = submodule_helper!( $path, submodule $( = $submodule )? );
|
let path = submodule_helper!( $path, submodule $( = $submodule )? );
|
||||||
builder.require_and_update_submodule(path, None);
|
builder.require_submodule(path, None);
|
||||||
)?
|
)?
|
||||||
builder.ensure(RustbookSrc {
|
builder.ensure(RustbookSrc {
|
||||||
target: self.target,
|
target: self.target,
|
||||||
@ -224,7 +224,7 @@ fn make_run(run: RunConfig<'_>) {
|
|||||||
/// * Index page
|
/// * Index page
|
||||||
/// * Redirect pages
|
/// * Redirect pages
|
||||||
fn run(self, builder: &Builder<'_>) {
|
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 compiler = self.compiler;
|
||||||
let target = self.target;
|
let target = self.target;
|
||||||
@ -934,7 +934,7 @@ fn run(self, builder: &Builder<'_>) {
|
|||||||
let source_type = SourceType::Submodule;
|
let source_type = SourceType::Submodule;
|
||||||
|
|
||||||
let path = submodule_helper!( $path, submodule $( = $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;
|
let stage = builder.top_stage;
|
||||||
@ -1252,7 +1252,7 @@ fn make_run(run: RunConfig<'_>) {
|
|||||||
|
|
||||||
/// Builds the reference book.
|
/// Builds the reference book.
|
||||||
fn run(self, builder: &Builder<'_>) {
|
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
|
// This is needed for generating links to the standard library using
|
||||||
// the mdbook-spec plugin.
|
// the mdbook-spec plugin.
|
||||||
|
@ -1198,7 +1198,7 @@ fn make_run(run: RunConfig<'_>) {
|
|||||||
|
|
||||||
/// Build crtbegin.o/crtend.o for musl target.
|
/// Build crtbegin.o/crtend.o for musl target.
|
||||||
fn run(self, builder: &Builder<'_>) -> Self::Output {
|
fn run(self, builder: &Builder<'_>) -> Self::Output {
|
||||||
builder.require_and_update_submodule(
|
builder.require_submodule(
|
||||||
"src/llvm-project",
|
"src/llvm-project",
|
||||||
Some("The LLVM sources are required for the CRT from `compiler-rt`."),
|
Some("The LLVM sources are required for the CRT from `compiler-rt`."),
|
||||||
);
|
);
|
||||||
@ -1274,7 +1274,7 @@ fn make_run(run: RunConfig<'_>) {
|
|||||||
|
|
||||||
/// Build libunwind.a
|
/// Build libunwind.a
|
||||||
fn run(self, builder: &Builder<'_>) -> Self::Output {
|
fn run(self, builder: &Builder<'_>) -> Self::Output {
|
||||||
builder.require_and_update_submodule(
|
builder.require_submodule(
|
||||||
"src/llvm-project",
|
"src/llvm-project",
|
||||||
Some("The LLVM sources are required for libunwind."),
|
Some("The LLVM sources are required for libunwind."),
|
||||||
);
|
);
|
||||||
|
@ -2287,7 +2287,7 @@ fn make_run(run: RunConfig<'_>) {
|
|||||||
fn run(self, builder: &Builder<'_>) {
|
fn run(self, builder: &Builder<'_>) {
|
||||||
$(
|
$(
|
||||||
for submodule in $submodules {
|
for submodule in $submodules {
|
||||||
builder.require_and_update_submodule(submodule, None);
|
builder.require_submodule(submodule, None);
|
||||||
}
|
}
|
||||||
)*
|
)*
|
||||||
builder.ensure(BookTest {
|
builder.ensure(BookTest {
|
||||||
@ -2409,7 +2409,7 @@ fn make_run(run: RunConfig<'_>) {
|
|||||||
|
|
||||||
fn run(self, builder: &Builder<'_>) {
|
fn run(self, builder: &Builder<'_>) {
|
||||||
let relative_path = "src/doc/rustc-dev-guide";
|
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 src = builder.src.join(relative_path);
|
||||||
let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook).delay_failure();
|
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);
|
let _guard = builder.msg(Kind::Test, 0, "bootstrap", host, host);
|
||||||
|
|
||||||
// Some tests require cargo submodule to be present.
|
// 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());
|
let mut check_bootstrap = command(builder.python());
|
||||||
check_bootstrap
|
check_bootstrap
|
||||||
|
@ -290,7 +290,7 @@ fn make_run(run: RunConfig<'_>) {
|
|||||||
fn run(self, builder: &Builder<'_>) -> PathBuf {
|
fn run(self, builder: &Builder<'_>) -> PathBuf {
|
||||||
$(
|
$(
|
||||||
for submodule in $submodules {
|
for submodule in $submodules {
|
||||||
builder.require_and_update_submodule(submodule, None);
|
builder.require_submodule(submodule, None);
|
||||||
}
|
}
|
||||||
)*
|
)*
|
||||||
builder.ensure(ToolBuild {
|
builder.ensure(ToolBuild {
|
||||||
@ -373,7 +373,7 @@ fn make_run(run: RunConfig<'_>) {
|
|||||||
fn run(self, builder: &Builder<'_>) -> PathBuf {
|
fn run(self, builder: &Builder<'_>) -> PathBuf {
|
||||||
// We need to ensure the rustc-perf submodule is initialized when building opt-dist since
|
// 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.
|
// 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 {
|
builder.ensure(ToolBuild {
|
||||||
compiler: self.compiler,
|
compiler: self.compiler,
|
||||||
@ -414,7 +414,7 @@ fn make_run(run: RunConfig<'_>) {
|
|||||||
|
|
||||||
fn run(self, builder: &Builder<'_>) -> PathBuf {
|
fn run(self, builder: &Builder<'_>) -> PathBuf {
|
||||||
// We need to ensure the rustc-perf submodule is initialized.
|
// 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 {
|
let tool = ToolBuild {
|
||||||
compiler: self.compiler,
|
compiler: self.compiler,
|
||||||
@ -715,7 +715,7 @@ fn make_run(run: RunConfig<'_>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn run(self, builder: &Builder<'_>) -> PathBuf {
|
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 {
|
builder.ensure(ToolBuild {
|
||||||
compiler: self.compiler,
|
compiler: self.compiler,
|
||||||
|
@ -37,7 +37,7 @@ fn run(self, builder: &Builder<'_>) -> Self::Output {
|
|||||||
|
|
||||||
// These submodules must be present for `x vendor` to work.
|
// These submodules must be present for `x vendor` to work.
|
||||||
for submodule in SUBMODULES_FOR_RUSTBOOK.iter().chain(["src/tools/cargo"].iter()) {
|
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.
|
// Sync these paths by default.
|
||||||
|
@ -24,7 +24,7 @@ fn configure_with_args(cmd: &[String], host: &[&str], target: &[&str]) -> Config
|
|||||||
rust_codegen_backends: vec![],
|
rust_codegen_backends: vec![],
|
||||||
..Config::parse(&["check".to_owned()])
|
..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.submodules = Some(false);
|
||||||
|
|
||||||
config.ninja_in_file = false;
|
config.ninja_in_file = false;
|
||||||
|
@ -441,7 +441,7 @@ pub fn new(mut config: Config) -> Build {
|
|||||||
// Cargo.toml files.
|
// Cargo.toml files.
|
||||||
let rust_submodules = ["library/backtrace", "library/stdarch"];
|
let rust_submodules = ["library/backtrace", "library/stdarch"];
|
||||||
for s in rust_submodules {
|
for s in rust_submodules {
|
||||||
build.require_and_update_submodule(
|
build.require_submodule(
|
||||||
s,
|
s,
|
||||||
Some(
|
Some(
|
||||||
"The submodule is required for the standard library \
|
"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
|
/// 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
|
/// 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
|
/// used instead to provide a nice error to the user if the submodule is
|
||||||
/// missing.
|
/// missing.
|
||||||
fn update_submodule(&self, relative_path: &str) {
|
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
|
/// The given `err_hint` will be shown to the user if the submodule is not
|
||||||
/// checked out and submodule management is disabled.
|
/// 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
|
// When testing bootstrap itself, it is much faster to ignore
|
||||||
// submodules. Almost all Steps work fine without their submodules.
|
// submodules. Almost all Steps work fine without their submodules.
|
||||||
if cfg!(test) && !self.config.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.
|
/// management is disabled and the submodule does not exist.
|
||||||
pub fn require_and_update_all_submodules(&self) {
|
pub fn require_and_update_all_submodules(&self) {
|
||||||
for submodule in build_helper::util::parse_gitmodules(&self.src) {
|
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