You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
build: check_format.py crashes if executables don't exist #16504
Title: check_format.py crashes when the needed tools don't exist
Description: paths.py can return NoneTypes if none of the required env vars are there or the binary is there. This leads to the script just crashing as the FormatChecker methods just pass this down to some stdlib functions which aren't expecting them.
Running pre-push check; to skip this step use 'push --no-verify'
Checking format for source/server/server.cc - Traceback (most recent call last):
File "/home/justin/codebase/envoy/support/hooks/../../tools/code_format/check_format.py", line 1258, in <module>
ct_error_messages = format_checker.check_tools()
File "/home/justin/codebase/envoy/support/hooks/../../tools/code_format/check_format.py", line 384, in check_tools
check_bazel_tool('buildifier', BUILDIFIER_PATH, 'BUILDIFIER_BIN')
File "/home/justin/codebase/envoy/support/hooks/../../tools/code_format/check_format.py", line 362, in check_bazel_tool
bazel_tool_abs_path = self.look_path(path)
File "/home/justin/codebase/envoy/support/hooks/../../tools/code_format/check_format.py", line 326, in look_path
return shutil.which(executable) or ''
File "/usr/lib/python3.8/shutil.py", line 1365, in which
if os.path.dirname(cmd):
File "/usr/lib/python3.8/posixpath.py", line 152, in dirname
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
error: failed to push some refs to '[email protected]:greymatter-io/envoy.git'
Repro steps:
Start on a system without buildozer or buildifier or probably other tools set up.
Set up the commit hooks as the documentation instructs
Activity