File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,14 @@ def main() -> None:
253
253
254
254
abs_build_dir = Path (args .build_dir ).resolve ()
255
255
256
+ # Get the absolute path to clang-tidy and use this instead of the relative
257
+ # path such as .lintbin/clang-tidy. The problem here is that os.chdir is
258
+ # per process, and the linter uses it to move between the current directory
259
+ # and the build folder. And there is no .lintbin directory in the latter.
260
+ # When it happens in a race condition, the linter command will fails with
261
+ # the following no such file or directory error: '.lintbin/clang-tidy'
262
+ binary_path = os .path .abspath (args .binary )
263
+
256
264
with concurrent .futures .ThreadPoolExecutor (
257
265
max_workers = os .cpu_count (),
258
266
thread_name_prefix = "Thread" ,
@@ -261,7 +269,7 @@ def main() -> None:
261
269
executor .submit (
262
270
check_file ,
263
271
filename ,
264
- args . binary ,
272
+ binary_path ,
265
273
abs_build_dir ,
266
274
): filename
267
275
for filename in args .filenames
You can’t perform that action at this time.
0 commit comments