[libcxx] [test] Add an option to ssh.py for using a different temp path
If cross testing on Windows via WSL (at least with WSL 1), the Windows
executables can't be executed if they are in WSL specific directories
(like /tmp).
Differential Revision: https://reviews.llvm.org/D98028
GitOrigin-RevId: 232fec941d2301165ea20ba8e6970bdf3c515c84
diff --git a/utils/ssh.py b/utils/ssh.py
index 8a30cc3..a434271 100755
--- a/utils/ssh.py
+++ b/utils/ssh.py
@@ -41,6 +41,7 @@
parser = argparse.ArgumentParser()
parser.add_argument('--host', type=str, required=True)
parser.add_argument('--execdir', type=str, required=True)
+ parser.add_argument('--tempdir', type=str, required=False, default='/tmp')
parser.add_argument('--extra-ssh-args', type=str, required=False)
parser.add_argument('--extra-scp-args', type=str, required=False)
parser.add_argument('--codesign_identity', type=str, required=False, default=None)
@@ -51,7 +52,7 @@
# Create a temporary directory where the test will be run.
# That is effectively the value of %T on the remote host.
- tmp = subprocess.check_output(ssh(args, 'mktemp -d /tmp/libcxx.XXXXXXXXXX'), universal_newlines=True).strip()
+ tmp = subprocess.check_output(ssh(args, 'mktemp -d {}/libcxx.XXXXXXXXXX'.format(args.tempdir)), universal_newlines=True).strip()
# HACK:
# If an argument is a file that ends in `.tmp.exe`, assume it is the name