Skip to content

Commit 943c291

Browse files
committed
Use sys.base_exec_prefix for Python_ROOT_DIR
`Python_ROOT_DIR` is used for the find hints for - `Python_EXECUTABLE`: Unnecessary because we provide `Python_EXECUTABLE` as a cache variable and that has precedence - `python-config`: should point to the target's variable. Generally this is a shell script which would be executable during cross-compilation (windows case unknown) - `Python_LIBRARY`: should point to the target's library which would be on the `crossenv` uses a fake environment so that `sys.base_*_prefix` variables point to the target's system. Presumably PEP720 would work the same. Signed-off-by: Cristian Le <[email protected]>
1 parent 57d231e commit 943c291

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scikit_build_core/builder/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def configure(
240240
# Modern Find Python
241241
for prefix in ("Python", "Python3"):
242242
cache_config[f"{prefix}_EXECUTABLE"] = sys.executable
243-
cache_config[f"{prefix}_ROOT_DIR"] = sys.prefix
243+
cache_config[f"{prefix}_ROOT_DIR"] = sys.base_exec_prefix
244244
cache_config[f"{prefix}_INCLUDE_DIR"] = python_include_dir
245245
cache_config[f"{prefix}_FIND_REGISTRY"] = "NEVER"
246246
# FindPython may break if this is set - only useful on Windows

0 commit comments

Comments
 (0)