Skip to content

Commit cf4d719

Browse files
committed
Update backend.py
1 parent 7a10d27 commit cf4d719

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

_build_backend/backend.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ def _bootstrap_build(temp_path: str, config_settings: dict[str, list[str] | str]
108108
msg = f"Invalid sha256 for {archive_url!r}. Expected {archive_sha256!r}, got {sha256!r}"
109109
raise ValueError(msg)
110110

111-
prefix_path = temp_path_ / "cmake-install"
112111
if os.name == "posix":
113112
assert archive_name.endswith(".tar.gz")
114113
tar_filter_kwargs = {"filter": "tar"} if hasattr(tarfile, "tar_filter") else {}
@@ -119,6 +118,8 @@ def _bootstrap_build(temp_path: str, config_settings: dict[str, list[str] | str]
119118
parallel = max(0, int(parallel_str) if parallel_str.isdigit() else 1) or os.cpu_count() or 1
120119

121120
bootstrap_path = next(temp_path_.glob("cmake-*/bootstrap"))
121+
prefix_path = temp_path_ / "cmake-install"
122+
cmake_path = prefix_path / "bin" / "cmake"
122123
bootstrap_args = [f"--prefix={prefix_path}", "--no-qt-gui", "--no-debugger", "--parallel={parallel}"]
123124
previous_cwd = Path().absolute()
124125
os.chdir(bootstrap_path.parent)
@@ -131,9 +132,10 @@ def _bootstrap_build(temp_path: str, config_settings: dict[str, list[str] | str]
131132
else:
132133
assert archive_name.endswith(".zip")
133134
with zipfile.ZipFile(archive_path) as zip_:
134-
zip_.extractall(path=prefix_path)
135+
zip_.extractall(path=temp_path_)
136+
cmake_path = next(temp_path_.glob("cmake-*/bin/cmake"))
135137

136-
return str(prefix_path / "bin" / "cmake")
138+
return str(cmake_path)
137139

138140

139141
def build_wheel(

0 commit comments

Comments
 (0)