Skip to content

Commit 1e926f0

Browse files
committed
Auto merge of #102755 - pcc:data-local-tmp, r=Mark-Simulacrum
tools/remote-test-{server,client}: Use /data/local/tmp on Android The /data/tmp directory does not exist, at least not on recent versions of Android, which currently leads to test failures on that platform. I checked a virtual device running AOSP master and a Nexus 5 running Android Marshmallow and on both devices the /data/tmp directory does not exist and /data/local/tmp does, so let's switch to /data/local/tmp.
2 parents 3655784 + 9a1c1c7 commit 1e926f0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/bootstrap/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::toolstate::ToolState;
2323
use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var, output, t};
2424
use crate::{envify, CLang, DocTests, GitRepo, Mode};
2525

26-
const ADB_TEST_DIR: &str = "/data/tmp/work";
26+
const ADB_TEST_DIR: &str = "/data/local/tmp/work";
2727

2828
/// The two modes of the test runner; tests or benchmarks.
2929
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, PartialOrd, Ord)]

src/tools/remote-test-client/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ fn start_android_emulator(server: &Path) {
9393

9494
println!("pushing server");
9595
let status =
96-
Command::new("adb").arg("push").arg(server).arg("/data/tmp/testd").status().unwrap();
96+
Command::new("adb").arg("push").arg(server).arg("/data/local/tmp/testd").status().unwrap();
9797
assert!(status.success());
9898

9999
println!("forwarding tcp");
@@ -102,7 +102,7 @@ fn start_android_emulator(server: &Path) {
102102
assert!(status.success());
103103

104104
println!("executing server");
105-
Command::new("adb").arg("shell").arg("/data/tmp/testd").spawn().unwrap();
105+
Command::new("adb").arg("shell").arg("/data/local/tmp/testd").spawn().unwrap();
106106
}
107107

108108
fn prepare_rootfs(target: &str, rootfs: &Path, server: &Path, rootfs_img: &Path) {

src/tools/remote-test-server/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ fn main() {
9898

9999
let listener = t!(TcpListener::bind(config.bind));
100100
let (work, tmp): (PathBuf, PathBuf) = if cfg!(target_os = "android") {
101-
("/data/tmp/work".into(), "/data/tmp/work/tmp".into())
101+
("/data/local/tmp/work".into(), "/data/local/tmp/work/tmp".into())
102102
} else {
103103
let mut work_dir = env::temp_dir();
104104
work_dir.push("work");

0 commit comments

Comments
 (0)