Skip to content

Conversation

@asb
Copy link
Contributor

@asb asb commented Oct 7, 2024

This is an alternate implementation of a patch proposed by @preames in https://reviews.llvm.org/D128840. As noted there, when running non-native binaries with binfmt_misc and qemu-user you typically need to set some environment variables (at least, QEMU_LD_PREFIX), but lit strips them by default. This patch adds what I think are the two main ones to the list of those that aren't stripped. It does so in a place that applies to all lit test suites (rather than just LLVM's), and as can be seen from the other env vars in pass_vars I think there's already plenty of precedent for passing through environment variables known to be potentially useful to LLVM developers.

This is an alternate implementation of a patch proposed by @preames in
<https://reviews.llvm.org/D128840>. As noted there, when running
non-native binaries with binfmt_misc and qemu-user you typically need to
set some environment variables (at least, QEMU_LD_PREFIX), but lit
strips them by default. This patch adds what I think are the two main
ones to the list of those that aren't stripped. It does so in a place
that applies to all lit test suites (rather than just LLVM's), and as
can be seen from the other env vars in `pass_vars` I think there's
already plenty of precedent for passing through environment variables
known to be potentially useful to LLVM developers.
@llvmbot
Copy link
Member

llvmbot commented Oct 7, 2024

@llvm/pr-subscribers-testing-tools

Author: Alex Bradbury (asb)

Changes

This is an alternate implementation of a patch proposed by @preames in <https://reviews.llvm.org/D128840>. As noted there, when running non-native binaries with binfmt_misc and qemu-user you typically need to set some environment variables (at least, QEMU_LD_PREFIX), but lit strips them by default. This patch adds what I think are the two main ones to the list of those that aren't stripped. It does so in a place that applies to all lit test suites (rather than just LLVM's), and as can be seen from the other env vars in pass_vars I think there's already plenty of precedent for passing through environment variables known to be potentially useful to LLVM developers.


Full diff: https://github.com/llvm/llvm-project/pull/111373.diff

1 Files Affected:

  • (modified) llvm/utils/lit/lit/TestingConfig.py (+2)
diff --git a/llvm/utils/lit/lit/TestingConfig.py b/llvm/utils/lit/lit/TestingConfig.py
index f81b07baeeaed0..b0d8e7149e553c 100644
--- a/llvm/utils/lit/lit/TestingConfig.py
+++ b/llvm/utils/lit/lit/TestingConfig.py
@@ -64,6 +64,8 @@ def fromdefaults(litConfig):
             "SOURCE_DATE_EPOCH",
             "GTEST_FILTER",
             "DFLTCC",
+            "QEMU_LD_PREFIX",
+            "QEMU_CPU",
         ]
 
         if sys.platform.startswith("aix"):

Copy link
Contributor

@RoboTux RoboTux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, seems similar in situation to the ADB and other Android-related variables.

@preames
Copy link
Collaborator

preames commented Oct 7, 2024

Happy to see something like this finally land. LGTM from me, for what little it's worth.

@asb asb merged commit a649e8f into llvm:main Oct 8, 2024
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants