build: error out when missing elftools python module
PATCH 1/1 build: error out when missing elftools python module
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
--- buildtools/meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
buildtools/meson.build +4 -1
@@ -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']
Signature · 1 line
2.48.1
Thomas Monjalon
Applied27/06/2025 17:27, Bruce Richardson:
Quoted 9 lines
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
Quoted 7 lines
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 <[email protected]>
Applied, thanks.