* [PATCH] build: error out when missing elftools python module
@ 2025-06-27 15:27 Bruce Richardson
0 siblings, 0 replies; only message in thread
From: Bruce Richardson @ 2025-06-27 15:27 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
In the case where we use the meson python "find_installation()" function
to get our python binary, we can fail the configure/setup step if the
elftools module is missing. This avoids later errors on build when the
module is missed.
Old output (error logged and config continues):
Program python3 (elftools) found: NO
New output:
Program python3 found: YES (/usr/bin/python3)
Program python3 (elftools) found: NO
../buildtools/meson.build:15:31: ERROR: python3 is missing modules: elftools
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
buildtools/meson.build | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 7b5e449cdb..12abbdff9c 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -9,8 +9,11 @@ python3_required_modules = []
if host_machine.system() != 'windows'
python3_required_modules = ['elftools']
endif
-python3 = import('python').find_installation('python3', required: false, modules: python3_required_modules)
+python3 = import('python').find_installation('python3', required: false)
if python3.found()
+ # If python3 is found, check that we have pyelftools installed.
+ python3 = import('python').find_installation('python3', required: true,
+ modules: python3_required_modules)
py3 = [python3]
else
py3 = ['meson', 'runpython']
--
2.48.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-06-27 15:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-27 15:27 [PATCH] build: error out when missing elftools python module Bruce Richardson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).