From 2b8877bafff43a71765d07cf3af4685857f744c6 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: (cherry picked from commit 4be493862d098de9f0ab7e022987a36d3ec091f6) --- .pick_status.json | 2 +- bin/symbols-check.py | 22 +++++++++------------- meson.build | 2 +- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 5b0142305a0..97f65b9d4b0 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -7944,7 +7944,7 @@ "description": "meson: only run symbols-check if `nm` is available", "nominated": false, "nomination_type": 0, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/bin/symbols-check.py b/bin/symbols-check.py index 4277ae964d1..0d80fb0691f 100644 --- a/bin/symbols-check.py +++ b/bin/symbols-check.py @@ -140,19 +140,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 d5dbe95075c..57c9eb93778 100644 --- a/meson.build +++ b/meson.build @@ -2277,7 +2277,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