-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[lld][llvm-lit] Enabled lit internal shell for lld test suite #106651
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
base: main
Are you sure you want to change the base?
Conversation
This patch sets lit's internal shell to be the default shell when running lld tests. Tests that REQUIRES: shell are not currently supported by the internal shell, so those tests are skipped with this implementation.
@llvm/pr-subscribers-lld Author: Connie Zhu (connieyzhu) ChangesThis patch sets lit's internal shell to be the default shell when running lld tests. Tests that Resolves #102700. Full diff: https://github.com/llvm/llvm-project/pull/106651.diff 1 Files Affected:
diff --git a/lld/test/lit.cfg.py b/lld/test/lit.cfg.py
index d309c2ad4ee284..fd9afd4fb65894 100644
--- a/lld/test/lit.cfg.py
+++ b/lld/test/lit.cfg.py
@@ -19,7 +19,18 @@
# testFormat: The test format to use to interpret tests.
#
# For now we require '&&' between commands, until they get globally killed and the test runner updated.
-config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
+# We prefer the lit internal shell which provides a better user experience on failures
+# unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0 env var.
+use_lit_shell = True
+lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
+if lit_shell_env:
+ use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
+
+config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
+
+# TODO: Tests that REQUIRES: shell are unsupported by the lit internal shell
+if use_lit_shell:
+ config.available_features.discard("shell")
# suffixes: A list of file extensions to treat as test files.
config.suffixes = [".ll", ".s", ".test", ".yaml", ".objtxt"]
|
How many tests have |
There are these tests:
We do have long-term plans to address this issue with |
Don't enable the internal shell by default seems like a viable option to me... Perhaps more helpfully, I think most (but probably not all, e.g. the color-diagnostics tests) of these tests can be modified to work with the internal shell without issue. In some cases, the only necessary modification may be removing the We shouldn't enable the internal shell by default until we've got a clear migration path forward for all of these tests, preferably with them modified up front before the default change. |
I agree we should avoid loss of coverage when possible. One thing that would be good is to get a buildbot configuration in CI that uses the internal shell (aside from Windows), so these test suites don’t regress during the migration period. I wonder if there is a good bot candidate we can use? Preferably one that has substantial overlap with other configurations. Since the internal shell is reportedly faster, maybe the presubmit bots? Another option would be to give lit a 3rd mode to run in, where it runs only tests with REQUIRES: shell in the external shell, but all the other tests in the internal shell. For now let’s create (or update?) a bug for the migration of the tests and note that this patch is blocked on that work. |
This patch sets lit's internal shell to be the default shell when running lld tests. Tests that
REQUIRES: shell
are not currently supported by the internal shell, so those tests are skipped with this implementation.Resolves #102700.