[libcxx] [test] Add an option to ssh.py for using a different temp path
authorMartin Storsjö <martin@martin.st>
Tue, 20 Oct 2020 18:23:41 +0000 (21:23 +0300)
committerMartin Storsjö <martin@martin.st>
Fri, 5 Mar 2021 17:37:31 +0000 (19:37 +0200)
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

libcxx/utils/ssh.py

index 8a30cc3..a434271 100755 (executable)
@@ -41,6 +41,7 @@ def main():
     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 @@ def main():
 
     # 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