Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f19c33e

Browse files
committed
Split distcheck logic into functions
1 parent 51ff895 commit f19c33e

File tree

1 file changed

+60
-55
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+60
-55
lines changed

‎src/bootstrap/src/core/build_steps/test.rs

Lines changed: 60 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3189,61 +3189,66 @@ impl Step for Distcheck {
31893189
// local source code, built artifacts or configuration by accident
31903190
let root_dir = std::env::temp_dir().join("distcheck");
31913191

3192-
// Check that we can build some basic things from the plain source tarball
3193-
builder.info("Distcheck plain source tarball");
3194-
let plain_src_tarball = builder.ensure(dist::PlainSourceTarball);
3195-
let plain_src_dir = root_dir.join("distcheck-plain-src");
3196-
builder.clear_dir(&plain_src_dir);
3197-
3198-
let configure_args: Vec<String> = std::env::var("DISTCHECK_CONFIGURE_ARGS")
3199-
.map(|args| args.split(" ").map(|s| s.to_string()).collect::<Vec<String>>())
3200-
.unwrap_or_default();
3201-
3202-
command("tar")
3203-
.arg("-xf")
3204-
.arg(plain_src_tarball.tarball())
3205-
.arg("--strip-components=1")
3206-
.current_dir(&plain_src_dir)
3207-
.run(builder);
3208-
command("./configure")
3209-
.arg("--set")
3210-
.arg("rust.omit-git-hash=false")
3211-
.args(&configure_args)
3212-
.arg("--enable-vendor")
3213-
.current_dir(&plain_src_dir)
3214-
.run(builder);
3215-
command(helpers::make(&builder.config.host_target.triple))
3216-
.arg("check")
3217-
// Do not run the build as if we were in CI, otherwise git would be assumed to be
3218-
// present, but we build from a tarball here
3219-
.env("GITHUB_ACTIONS", "0")
3220-
.current_dir(&plain_src_dir)
3221-
.run(builder);
3222-
3223-
// Now make sure that rust-src has all of libstd's dependencies
3224-
builder.info("Distcheck rust-src");
3225-
let src_tarball = builder.ensure(dist::Src);
3226-
let src_dir = root_dir.join("distcheck-src");
3227-
builder.clear_dir(&src_dir);
3228-
3229-
command("tar")
3230-
.arg("-xf")
3231-
.arg(src_tarball.tarball())
3232-
.arg("--strip-components=1")
3233-
.current_dir(&src_dir)
3234-
.run(builder);
3235-
3236-
let toml = src_dir.join("rust-src/lib/rustlib/src/rust/library/std/Cargo.toml");
3237-
command(&builder.initial_cargo)
3238-
// Will read the libstd Cargo.toml
3239-
// which uses the unstable `public-dependency` feature.
3240-
.env("RUSTC_BOOTSTRAP", "1")
3241-
.arg("generate-lockfile")
3242-
.arg("--manifest-path")
3243-
.arg(&toml)
3244-
.current_dir(&src_dir)
3245-
.run(builder);
3246-
}
3192+
distcheck_plain_source_tarball(builder, &root_dir.join("distcheck-plain-src"));
3193+
distcheck_rust_src(builder, &root_dir.join("distcheck-src"));
3194+
}
3195+
}
3196+
3197+
fn distcheck_plain_source_tarball(builder: &Builder<'_>, plain_src_dir: &Path) {
3198+
// Check that we can build some basic things from the plain source tarball
3199+
builder.info("Distcheck plain source tarball");
3200+
let plain_src_tarball = builder.ensure(dist::PlainSourceTarball);
3201+
builder.clear_dir(&plain_src_dir);
3202+
3203+
let configure_args: Vec<String> = std::env::var("DISTCHECK_CONFIGURE_ARGS")
3204+
.map(|args| args.split(" ").map(|s| s.to_string()).collect::<Vec<String>>())
3205+
.unwrap_or_default();
3206+
3207+
command("tar")
3208+
.arg("-xf")
3209+
.arg(plain_src_tarball.tarball())
3210+
.arg("--strip-components=1")
3211+
.current_dir(&plain_src_dir)
3212+
.run(builder);
3213+
command("./configure")
3214+
.arg("--set")
3215+
.arg("rust.omit-git-hash=false")
3216+
.args(&configure_args)
3217+
.arg("--enable-vendor")
3218+
.current_dir(&plain_src_dir)
3219+
.run(builder);
3220+
command(helpers::make(&builder.config.host_target.triple))
3221+
.arg("check")
3222+
// Do not run the build as if we were in CI, otherwise git would be assumed to be
3223+
// present, but we build from a tarball here
3224+
.env("GITHUB_ACTIONS", "0")
3225+
.current_dir(&plain_src_dir)
3226+
.run(builder);
3227+
}
3228+
3229+
fn distcheck_rust_src(builder: &Builder<'_>, src_dir: &Path) {
3230+
// Now make sure that rust-src has all of libstd's dependencies
3231+
builder.info("Distcheck rust-src");
3232+
let src_tarball = builder.ensure(dist::Src);
3233+
builder.clear_dir(&src_dir);
3234+
3235+
command("tar")
3236+
.arg("-xf")
3237+
.arg(src_tarball.tarball())
3238+
.arg("--strip-components=1")
3239+
.current_dir(&src_dir)
3240+
.run(builder);
3241+
3242+
let toml = src_dir.join("rust-src/lib/rustlib/src/rust/library/std/Cargo.toml");
3243+
command(&builder.initial_cargo)
3244+
// Will read the libstd Cargo.toml
3245+
// which uses the unstable `public-dependency` feature.
3246+
.env("RUSTC_BOOTSTRAP", "1")
3247+
.arg("generate-lockfile")
3248+
.arg("--manifest-path")
3249+
.arg(&toml)
3250+
.current_dir(&src_dir)
3251+
.run(builder);
32473252
}
32483253

32493254
#[derive(Debug, Clone, PartialEq, Eq, Hash)]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /