From 10bf2afb49046b6b3d0ee0ada9ac88ed622ae6d9 Mon Sep 17 00:00:00 2001 From: Matt Smith Date: Fri, 28 Nov 2025 15:40:02 +1100 Subject: [PATCH] use absolute replacement paths in whell builder found this when trying to build cffi with our custom hermetic cc toolchain. The relative paths generated by execroot_prefix() dont resolve correctly from that directory, causing linker errors when trying to find system libraries like libm and libc in the hermetic toolchains sysroot. --- pycross/private/tools/wheel_builder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pycross/private/tools/wheel_builder.py b/pycross/private/tools/wheel_builder.py index d9ce8e03..8fd40ea3 100644 --- a/pycross/private/tools/wheel_builder.py +++ b/pycross/private/tools/wheel_builder.py @@ -202,7 +202,8 @@ def get_default_build_env_vars(path_dirs: List[Path]) -> Dict[str, str]: def replace_path_placeholders( data: Dict[str, Union[str, List[str]]], placeholder: str, replacement: Path ) -> Dict[str, Any]: - replacement_str = str(replacement) + # Use absolute path for replacements so compiler/linker paths work from temp build dirs + replacement_str = str(replacement.resolve()) if replacement_str.endswith("/"): replacement_str = replacement_str[:-1] result = {}