Skip to content

Commit

Permalink
Auto merge of #102755 - pcc:data-local-tmp, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Oct 11, 2022
2 parents 3655784 + 9a1c1c7 commit 1e926f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::toolstate::ToolState;
use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var, output, t};
use crate::{envify, CLang, DocTests, GitRepo, Mode};

const ADB_TEST_DIR: &str = "/data/tmp/work";
const ADB_TEST_DIR: &str = "/data/local/tmp/work";

/// The two modes of the test runner; tests or benchmarks.
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, PartialOrd, Ord)]
Expand Down
4 changes: 2 additions & 2 deletions src/tools/remote-test-client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ fn start_android_emulator(server: &Path) {

println!("pushing server");
let status =
Command::new("adb").arg("push").arg(server).arg("/data/tmp/testd").status().unwrap();
Command::new("adb").arg("push").arg(server).arg("/data/local/tmp/testd").status().unwrap();
assert!(status.success());

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

println!("executing server");
Command::new("adb").arg("shell").arg("/data/tmp/testd").spawn().unwrap();
Command::new("adb").arg("shell").arg("/data/local/tmp/testd").spawn().unwrap();
}

fn prepare_rootfs(target: &str, rootfs: &Path, server: &Path, rootfs_img: &Path) {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/remote-test-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn main() {

let listener = t!(TcpListener::bind(config.bind));
let (work, tmp): (PathBuf, PathBuf) = if cfg!(target_os = "android") {
("/data/tmp/work".into(), "/data/tmp/work/tmp".into())
("/data/local/tmp/work".into(), "/data/local/tmp/work/tmp".into())
} else {
let mut work_dir = env::temp_dir();
work_dir.push("work");
Expand Down

0 comments on commit 1e926f0

Please sign in to comment.