Skip to content

Commit 8c547a0

Browse files
committed
Auto merge of #38729 - alexcrichton:android-steps, r=brson
rustbuild: Add more deps on android-copy-libs The android-copy-libs step is crucial for running tests on the Android target as it copies necessary scripts and such to the emulator. We must run that before running any tests there, but we erroneously only did it for compiletest test suites!
2 parents b68d329 + cf8fde1 commit 8c547a0

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/bootstrap/check.rs

+4
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,10 @@ fn find_tests(dir: &Path,
507507
pub fn android_copy_libs(build: &Build,
508508
compiler: &Compiler,
509509
target: &str) {
510+
if !target.contains("android") {
511+
return
512+
}
513+
510514
println!("Android copy libs to emulator ({})", target);
511515
build.run(Command::new("adb").arg("remount"));
512516
build.run(Command::new("adb").args(&["shell", "rm", "-r", ADB_TEST_DIR]));

src/bootstrap/step.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
295295
.dep(|s| s.name("libtest"))
296296
.dep(|s| s.name("tool-compiletest").target(s.host))
297297
.dep(|s| s.name("test-helpers"))
298-
.dep(move |s| {
299-
if s.target.contains("android") {
300-
s.name("android-copy-libs")
301-
} else {
302-
Step::noop()
303-
}
304-
})
298+
.dep(|s| s.name("android-copy-libs"))
305299
.default(mode != "pretty") // pretty tests don't run everywhere
306300
.run(move |s| {
307301
check::compiletest(build, &s.compiler(), s.target, mode, dir)
@@ -343,6 +337,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
343337
.dep(|s| s.name("tool-compiletest").target(s.host))
344338
.dep(|s| s.name("test-helpers"))
345339
.dep(|s| s.name("debugger-scripts"))
340+
.dep(|s| s.name("android-copy-libs"))
346341
.run(move |s| check::compiletest(build, &s.compiler(), s.target,
347342
"debuginfo-gdb", "debuginfo"));
348343
}
@@ -386,12 +381,14 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
386381
for (krate, path, _default) in krates("std_shim") {
387382
rules.test(&krate.test_step, path)
388383
.dep(|s| s.name("libtest"))
384+
.dep(|s| s.name("android-copy-libs"))
389385
.run(move |s| check::krate(build, &s.compiler(), s.target,
390386
Mode::Libstd, TestKind::Test,
391387
Some(&krate.name)));
392388
}
393389
rules.test("check-std-all", "path/to/nowhere")
394390
.dep(|s| s.name("libtest"))
391+
.dep(|s| s.name("android-copy-libs"))
395392
.default(true)
396393
.run(move |s| check::krate(build, &s.compiler(), s.target,
397394
Mode::Libstd, TestKind::Test, None));
@@ -400,38 +397,44 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
400397
for (krate, path, _default) in krates("std_shim") {
401398
rules.bench(&krate.bench_step, path)
402399
.dep(|s| s.name("libtest"))
400+
.dep(|s| s.name("android-copy-libs"))
403401
.run(move |s| check::krate(build, &s.compiler(), s.target,
404402
Mode::Libstd, TestKind::Bench,
405403
Some(&krate.name)));
406404
}
407405
rules.bench("bench-std-all", "path/to/nowhere")
408406
.dep(|s| s.name("libtest"))
407+
.dep(|s| s.name("android-copy-libs"))
409408
.default(true)
410409
.run(move |s| check::krate(build, &s.compiler(), s.target,
411410
Mode::Libstd, TestKind::Bench, None));
412411

413412
for (krate, path, _default) in krates("test_shim") {
414413
rules.test(&krate.test_step, path)
415414
.dep(|s| s.name("libtest"))
415+
.dep(|s| s.name("android-copy-libs"))
416416
.run(move |s| check::krate(build, &s.compiler(), s.target,
417417
Mode::Libtest, TestKind::Test,
418418
Some(&krate.name)));
419419
}
420420
rules.test("check-test-all", "path/to/nowhere")
421421
.dep(|s| s.name("libtest"))
422+
.dep(|s| s.name("android-copy-libs"))
422423
.default(true)
423424
.run(move |s| check::krate(build, &s.compiler(), s.target,
424425
Mode::Libtest, TestKind::Test, None));
425426
for (krate, path, _default) in krates("rustc-main") {
426427
rules.test(&krate.test_step, path)
427428
.dep(|s| s.name("librustc"))
429+
.dep(|s| s.name("android-copy-libs"))
428430
.host(true)
429431
.run(move |s| check::krate(build, &s.compiler(), s.target,
430432
Mode::Librustc, TestKind::Test,
431433
Some(&krate.name)));
432434
}
433435
rules.test("check-rustc-all", "path/to/nowhere")
434436
.dep(|s| s.name("librustc"))
437+
.dep(|s| s.name("android-copy-libs"))
435438
.default(true)
436439
.host(true)
437440
.run(move |s| check::krate(build, &s.compiler(), s.target,

0 commit comments

Comments
 (0)