-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc++][lit] Allow overriding the executor for tests #66545
[libc++][lit] Allow overriding the executor for tests #66545
Conversation
@llvm/pr-subscribers-libunwind @llvm/pr-subscribers-libcxx ChangesThis is useful when trying to run multiple tests with different arguments to the executor script. This is needed in my case since I do not know the correct ssh connection arguments when building libc++. The testing script I have spawns multiple QEMU instances that listen on a given port on localhost and runs lit with the
|
Looks fine to me. I would like @ldionne approval though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes a lot of sense! I have a few suggestions but I definitely like the direction.
1f8b913
to
eb6f23c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this! Minor nitpick in params.py
but this basically LGTM.
libcxx/utils/libcxx/test/params.py
Outdated
type=str, | ||
default=f"{sys.executable} {Path(__file__).resolve().parent.parent.parent / 'run.py'}", | ||
help="Custom executor to use instead of the configured default.", | ||
actions=lambda executor: [] if not executor else [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There has to be an executor, so I think we should change to
actions=lambda executor: [AddSubstitution("%{executor}", executor)]
i.e. drop the if
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Will merge once CI completes successfully.
This is useful when trying to run multiple tests with different arguments to the executor script. This is needed in my case since I do not know the correct ssh connection arguments when building libc++. The testing script I have spawns multiple QEMU instances that listen on a given port on localhost and runs lit with the --num-shards/--run-shard argument. In order to connect each shard to the right QEMU instances I need to customize the arguments passed to ssh.py (--extra-ssh-args and --extra-scp-args) but can't do this at configure time since the target port is only known when running the tests but not when calling CMake. This change allows me to pass `executor=ssh.py <args>` to lit once I know the right hostname/port for running the tests. This also deprecates the `LIB{CXX,CXXABI,UNWIND}_EXECUTOR` CMake variable as the same can be achieved by adding `executor=...` to the `LIB{CXX,CXXABI,UNWIND}_TEST_PARAMS` variable.
772200b
to
4c28600
Compare
here is a problem with your changes when building the libraries on the windows cross toolchain builders
https://lab.llvm.org/buildbot/#/builders/60/builds/14086/steps/12/logs/stdio
would you take care of it? UPDATE: Just let me know if you will need to check you changes before commit. I will test them on the builder locally. |
Sorry about that! It looks like the cmake file quoting needs to be updated. Alternatively I could revert the part of this change that deprecates the executor variable. I will take a look at this first thing tomorrow morning. If it's more urgent, feel free to revert the change. |
Let's not un-deprecate the executor variables -- it's really great that we're removing some |
@vvereschaka Could you try the following patch? It works in my local testing but I don't have the right setup for you toolchain. The problem appears to be that cmake always uses greedy regexes, so I've changed the split logic to instead find the first =.
|
here is few updates for your fix (please see attached file):
The |
This is useful when trying to run multiple tests with different arguments to the executor script. This is needed in my case since I do not know the correct ssh connection arguments when building libc++. The testing script I have spawns multiple QEMU instances that listen on a given port on localhost and runs lit with the --num-shards/--run-shard argument. In order to connect each shard to the right QEMU instances I need to customize the arguments passed to ssh.py (--extra-ssh-args and --extra-scp-args) but can't do this at configure time since the target port is only known when running the tests but not when calling CMake. This change allows me to pass `executor=ssh.py <args>` to lit once I know the right hostname/port for running the tests. This also deprecates the `LIB{CXX,CXXABI,UNWIND}_EXECUTOR` CMake variable as the same can be achieved by adding `executor=...` to the `LIB{CXX,CXXABI,UNWIND}_TEST_PARAMS` variable.
This is useful when trying to run multiple tests with different
arguments to the executor script. This is needed in my case since I
do not know the correct ssh connection arguments when building libc++.
The testing script I have spawns multiple QEMU instances that listen on
a given port on localhost and runs lit with the --num-shards/--run-shard
argument. In order to connect each shard to the right QEMU instances I
need to customize the arguments passed to ssh.py (--extra-ssh-args and
--extra-scp-args) but can't do this at configure time since the target
port is only known when running the tests but not when calling CMake.
This change allows me to pass
executor=ssh.py <args>
to lit once I knowthe right hostname/port for running the tests.
This also deprecates the
LIB{CXX,CXXABI,UNWIND}_EXECUTOR
CMake variableas the same can be achieved by adding
executor=...
to theLIB{CXX,CXXABI,UNWIND}_TEST_PARAMS
variable.