Repository navigation
waf: fail the symbol check when nm fails - #34573
Merged
Merged
Conversation
subprocess.getoutput() returns the error text when nm fails. None of the disallowed names appear in it, so the check passed without looking at the ELF. Use check_output so a failing nm fails the build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Global Size Summary (Total Flash delta in bytes)Built from 1996e4c rebased onto 755258d
|
peterbarker
approved these changes
Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
subprocess.getoutput() runs a shell command and returns its output, stdout and stderr mixed, whatever the exit status. When nm fails (missing, wrong path, unreadable ELF), the output is just an error message like sh: 1: /bad/nm: not found. None of the forbidden names (std::__throw, operator new(...)) appear in that message, so the check passes without ever reading the ELF.
check_output() raises CalledProcessError on a non-zero exit, or FileNotFoundError if nm doesn't exist. Waf treats an exception in run() as a failed task, so the build stops.
tested with NM = ['/bin/false']: the branch failed with CalledProcessError, master passed.
self.env.NM instead of get_flat('NM'): check_output() takes a list of arguments and runs it without a shell, so it needs a list. get_flat is a string .
Summary
Classification & Testing (check all that apply and add your own)
Description