From 4be493862d098de9f0ab7e022987a36d3ec091f6 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Sun, 29 Jun 2025 17:26:52 +0200 Subject: [PATCH] meson: only run symbols-check if `nm` is available And drop the redundant check from symbols-check.py, which was actually masking all kinds of issues. Part-of: --- bin/symbols-check.py | 22 +++++++++------------- meson.build | 2 +- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/bin/symbols-check.py b/bin/symbols-check.py index 876807c0859..841860c65ad 100644 --- a/bin/symbols-check.py +++ b/bin/symbols-check.py @@ -141,19 +141,15 @@ def main(): help='do not process this symbol') args = parser.parse_args() - try: - if platform.system() == 'Windows': - if not args.dumpbin: - parser.error('--dumpbin is mandatory') - lib_symbols = get_symbols_dumpbin(args.dumpbin, args.lib) - else: - if not args.nm: - parser.error('--nm is mandatory') - lib_symbols = get_symbols_nm(args.nm, args.lib) - except: - # We can't run this test, but we haven't technically failed it either - # Return the GNU "skip" error code - exit(77) + if platform.system() == 'Windows': + if not args.dumpbin: + parser.error('--dumpbin is mandatory') + lib_symbols = get_symbols_dumpbin(args.dumpbin, args.lib) + else: + if not args.nm: + parser.error('--nm is mandatory') + lib_symbols = get_symbols_nm(args.nm, args.lib) + mandatory_symbols = [] optional_symbols = [] with open(args.symbols_file) as symbols_file: diff --git a/meson.build b/meson.build index 81da6a697b3..87f0be82049 100644 --- a/meson.build +++ b/meson.build @@ -2233,7 +2233,7 @@ if host_machine.system() == 'windows' endif else prog_nm = find_program('nm') - with_symbols_check = with_tests + with_symbols_check = prog_nm.found() and with_tests symbols_check_args = ['--nm', prog_nm.full_path()] endif