[libcxx-commits] [PATCH] D98028: [libcxx] [test] Add an option to ssh.py for using a different temp path

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 5 06:39:03 PST 2021


mstorsjo added a comment.

In D98028#2606568 <https://reviews.llvm.org/D98028#2606568>, @ldionne wrote:

> Is there a way to get the temp directory path on Windows? We could use that instead -- I'd love to avoid adding more arguments to this script.

Adding more arguments to this script really shouldn't be a burden for the rest of the projects; these arguments are only touched by the users who need them, setting them manually within `-DLIBCXX_EXECUTOR="path/to/ssh.py --host=myremote --tempdir=/some/temp/dir"` (where one need to have `--host` anyway).

> Otherwise, we could just switch to `mktemp -d` and let it select the directory name itself (i.e. don't try to provide a template).

And no, there's not really any trivial way of finding the right temp path - especially not a generic one. Remember, this is ssh.py running on the build host, which is going to fire off a ssh command to a remote system, instructing it to create a directory there. Anything smarter would require firing off more ssh commands to launch other processes, to query things.

In my particular setup, the remote system is a WSL (linux personality on top of windows) system, which has got both its own "native linux" parts of the filesystem and the rest of the regular windows filesystem mounted. It can call windows executables transparently, just provided that they reside in the windows part of the filesystem. Just calling `mktemp` would pick a linux default (like `/tmp`) within the linux part of the filesystem, and there's most probably no generic way to from there query what the temp path within the windows half of the system would be, unless you again resort to highly non-generic things like launching a windows executable in a custom path (`/mnt/c/<whatever>`) to query things from that ecosystem.

So this extra option, which IMO should be very little extra burden to anybody else, allows sidestepping all of that, and other users need not know anything about the contortions to this setup, only that you can - if you want to - choose what path on the remote system it uses for dumping files.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98028/new/

https://reviews.llvm.org/D98028



More information about the libcxx-commits mailing list