casaroli opened a new pull request, #19566: URL: https://github.com/apache/nuttx/pull/19566
*Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).* ## Summary `tools/mkallsyms.py` tells you what to install when its dependencies are missing, and then throws the message away: ```python except ModuleNotFoundError: print("Please execute the following command to install dependencies:") print("pip install pyelftools cxxfilt") os._exit(errno.EINVAL) ``` `os._exit()` terminates the process immediately, without flushing stdio. When stdout is a pipe — which it always is under `make` — `print()` is block-buffered, so the buffer is discarded and nothing is ever shown. What the developer sees, building any `CONFIG_ALLSYMS=y` configuration, is: ``` LD: nuttx make[1]: *** [Makefile:65: nuttx] Error 22 ``` and nothing else anywhere in the build output. "Error 22" is just `errno.EINVAL` leaking out as an exit status. `usage()` discards its message the same way, exiting `ENOENT`. `sys.exit()` raises `SystemExit`, which lets the interpreter flush on the way out. Exit statuses are unchanged. `os` is no longer referenced afterwards, so the import goes with it. ## Impact None on a working setup. On a machine without `pyelftools`/`cxxfilt` it turns an unexplained build failure into the actionable message the author already wrote. Worth noting that no `CONFIG_ALLSYMS=y` configuration is built by the `make` backend in CI — the eight in-tree ones are absent from `tools/ci/testlist/` — so this path is easy to hit and hard to diagnose locally. ## Testing ``` $ python3 tools/mkallsyms.py # dependencies present usage: mkallsyms.py [-h] [--noconst] ... ``` With the modules hidden, the message now survives redirection to a pipe; before, `python3 tools/mkallsyms.py ... | cat` printed nothing and returned 22. `tools/checkpatch.sh -c -u -m -g` clean (black, isort, flake8 and codespell all installed). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
