Skip to content

Commit 1415e20

Browse files
committed
Small refactoring around RemoteCopyLibs
1 parent d69067f commit 1415e20

File tree

1 file changed

+14
-10
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+14
-10
lines changed

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
17411741
builder.std(compiler, target);
17421742
}
17431743

1744-
builder.ensure(RemoteCopyLibs { compiler, target });
1744+
builder.ensure(RemoteCopyLibs { build_compiler: compiler, target });
17451745

17461746
// compiletest currently has... a lot of arguments, so let's just pass all
17471747
// of them!
@@ -2821,7 +2821,7 @@ impl Step for Crate {
28212821
// Also prepare a sysroot for the target.
28222822
if !builder.config.is_host_target(target) {
28232823
builder.ensure(compile::Std::new(compiler, target).force_recompile(true));
2824-
builder.ensure(RemoteCopyLibs { compiler, target });
2824+
builder.ensure(RemoteCopyLibs { build_compiler: compiler, target });
28252825
}
28262826

28272827
// Build `cargo test` command
@@ -3029,7 +3029,7 @@ impl Step for CrateRustdocJsonTypes {
30293029
/// the build target (us) and the server is built for the target.
30303030
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
30313031
pub struct RemoteCopyLibs {
3032-
compiler: Compiler,
3032+
build_compiler: Compiler,
30333033
target: TargetSelection,
30343034
}
30353035

@@ -3041,18 +3041,17 @@ impl Step for RemoteCopyLibs {
30413041
}
30423042

30433043
fn run(self, builder: &Builder<'_>) {
3044-
let compiler = self.compiler;
3044+
let build_compiler = self.build_compiler;
30453045
let target = self.target;
30463046
if !builder.remote_tested(target) {
30473047
return;
30483048
}
30493049

3050-
builder.std(compiler, target);
3050+
builder.std(build_compiler, target);
30513051

30523052
builder.info(&format!("REMOTE copy libs to emulator ({target})"));
30533053

3054-
let remote_test_server =
3055-
builder.ensure(tool::RemoteTestServer { build_compiler: compiler, target });
3054+
let remote_test_server = builder.ensure(tool::RemoteTestServer { build_compiler, target });
30563055

30573056
// Spawn the emulator and wait for it to come online
30583057
let tool = builder.tool_exe(Tool::RemoteTestClient);
@@ -3067,7 +3066,7 @@ impl Step for RemoteCopyLibs {
30673066
cmd.run(builder);
30683067

30693068
// Push all our dylibs to the emulator
3070-
for f in t!(builder.sysroot_target_libdir(compiler, target).read_dir()) {
3069+
for f in t!(builder.sysroot_target_libdir(build_compiler, target).read_dir()) {
30713070
let f = t!(f);
30723071
if helpers::is_dylib(&f.path()) {
30733072
command(&tool).arg("push").arg(f.path()).run(builder);
@@ -3108,6 +3107,9 @@ impl Step for Distcheck {
31083107
builder.ensure(dist::PlainSourceTarball);
31093108
builder.ensure(dist::Src);
31103109

3110+
// FIXME: unpack the source tarballs into a directory outside the source checkout, to
3111+
// ensure that it cannot access any local state
3112+
// Also ensure that it doesn't use download-ci-llvm
31113113
command("tar")
31123114
.arg("-xf")
31133115
.arg(builder.ensure(dist::PlainSourceTarball).tarball())
@@ -3689,8 +3691,10 @@ impl Step for TestFloatParse {
36893691
}
36903692

36913693
fn make_run(run: RunConfig<'_>) {
3692-
run.builder
3693-
.ensure(Self { build_compiler: get_compiler_to_test(run.builder), target: run.target });
3694+
run.builder.ensure(Self {
3695+
build_compiler: get_compiler_to_test(run.builder, run.target),
3696+
target: run.target,
3697+
});
36943698
}
36953699

36963700
fn run(self, builder: &Builder<'_>) {

0 commit comments

Comments
 (0)