diff --color -ruN a/mesonpy/__init__.py b/mesonpy/__init__.py --- a/mesonpy/__init__.py 2024-06-05 11:10:53.628398345 +0200 +++ b/mesonpy/__init__.py 2024-06-05 11:31:13.600792738 +0200 @@ -410,6 +410,7 @@ # directory, in the form of a relative RPATH entry. meson-python # relocates the shared libraries to the $project.mesonpy.libs # folder. Rewrite the RPATH to point to that folder instead. + assert False, "Patchelf is not allowed to run on RHEL" libspath = os.path.relpath(self._libs_dir, destination.parent) mesonpy._rpath.fix_rpath(origin, libspath) @@ -1007,9 +1008,6 @@ if os.environ.get('NINJA') is None and _env_ninja_command() is None: dependencies.append(f'ninja >= {_NINJA_REQUIRED_VERSION}') - if sys.platform.startswith('linux') and not shutil.which('patchelf'): - dependencies.append('patchelf >= 0.11.0') - return dependencies diff --color -ruN a/mesonpy/_rpath.py b/mesonpy/_rpath.py --- a/mesonpy/_rpath.py 2024-06-05 11:10:53.628398345 +0200 +++ b/mesonpy/_rpath.py 2024-06-05 11:31:18.954861673 +0200 @@ -17,12 +17,13 @@ if sys.platform == 'linux': - def _get_rpath(filepath: Path) -> List[str]: + assert False, "Patchelf is not allowed to run on RHEL" r = subprocess.run(['patchelf', '--print-rpath', os.fspath(filepath)], capture_output=True, text=True) return r.stdout.strip().split(':') def _set_rpath(filepath: Path, rpath: Iterable[str]) -> None: + assert False, "Patchelf is not allowed to run on RHEL" subprocess.run(['patchelf','--set-rpath', ':'.join(rpath), os.fspath(filepath)], check=True) def fix_rpath(filepath: Path, libs_relative_path: str) -> None: