Skip to content

Commit c43d082

Browse files
committed
ccache detection: check if compiler is a symlink explicitly
1 parent 7f791e2 commit c43d082

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

refresh.template.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -761,12 +761,9 @@ def _all_platform_patch(compile_args: typing.List[str]):
761761
compile_args = new_compile_args
762762

763763
# Discover compilers that are actually symlinks to ccache--and replace them with the underlying compiler
764-
try:
764+
if os.path.islink(compile_args[0]):
765765
compiler_path = os.readlink(compile_args[0])
766-
except OSError:
767-
pass
768-
else:
769-
if compiler_path.endswith("ccache"):
766+
if os.path.basename(compiler_path) == "ccache":
770767
compiler = os.path.basename(compile_args[0])
771768
real_compiler_path = shutil.which(compiler)
772769
if real_compiler_path:

0 commit comments

Comments
 (0)