Skip to content

Commit

Permalink
fix: do not exit with exec permission error in ninja check (#626)
Browse files Browse the repository at this point in the history
Also `cmake` check.

As discussed in:

  https://github.com/orgs/scikit-build/discussions/1057

There may be times when we attempt to execute `ninja --version` from the
ninja package in /tmp/, which may be mounted `noexec`. This result in a
PermissionError.

Carry on so we can inspect other ninja executables available.
  • Loading branch information
thewtex committed Feb 2, 2024
1 parent d7912fd commit 51402d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scikit_build_core/program_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def get_cmake_program(cmake_path: Path) -> Program:
"""
try:
result = Run().capture(cmake_path, "--version")
except subprocess.CalledProcessError:
except (subprocess.CalledProcessError, PermissionError):
return Program(cmake_path, None)

try:
Expand Down Expand Up @@ -110,7 +110,7 @@ def get_ninja_programs(*, module: bool = True) -> Generator[Program, None, None]
for ninja_path in _get_ninja_path(module=module):
try:
result = Run().capture(ninja_path, "--version")
except subprocess.CalledProcessError:
except (subprocess.CalledProcessError, PermissionError):
yield Program(ninja_path, None)
continue

Expand Down

0 comments on commit 51402d2

Please sign in to comment.