Skip to content

Commit 2a83d1a

Browse files
committed
chdir
1 parent 60534eb commit 2a83d1a

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

bench_runner/scripts/install.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import functools
88
import io
99
from pathlib import Path
10+
import shlex
1011
import shutil
1112
import sys
1213
from typing import Any
@@ -141,7 +142,8 @@ def generate__benchmark(src: Any) -> Any:
141142
"name": "Setup environment",
142143
"run": LiteralScalarString(
143144
"\n".join(
144-
f'echo "{key}={val}" >> {github_env}' for key, val in vars.items()
145+
f'echo "{key}={shlex.quote(val)}" >> {github_env}'
146+
for key, val in vars.items()
145147
)
146148
),
147149
}

bench_runner/scripts/workflow.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def compile_unix(cpython: PathLike, flags: list[str], pgo: bool, pystats: bool)
153153
args.append("--enable-experimental-jit=yes")
154154
if "NOGIL" in flags:
155155
args.append("--disable-gil")
156-
if "CLANG" in flags:
156+
if "TAILCALL" in flags:
157157
args.append("--with-tail-call-interp")
158158
args.append("--enable-option-checking=fatal")
159159
if configure_flags := os.environ.get("PYTHON_CONFIGURE_FLAGS"):
@@ -187,19 +187,20 @@ def compile_windows(
187187
args.append("--experimental-jit-interpreter")
188188
if "NOGIL" in flags:
189189
args.append("--disable-gil")
190-
if "CLANG" in flags:
190+
if "TAILCALL" in flags:
191191
args.append("--tail-call-interp")
192192
if configure_flags := os.environ.get("PYTHON_CONFIGURE_FLAGS"):
193193
args.extend(shlex.split(configure_flags))
194194

195-
subprocess.check_call(
196-
[
197-
"powershell.exe",
198-
Path("PCbuild") / "build.bat",
199-
*args,
200-
],
201-
)
202-
shutil.copytree(get_windows_build_dir(force_32bit), "libs", dirs_exist_ok=True)
195+
with contextlib.chdir(cpython):
196+
subprocess.check_call(
197+
[
198+
"powershell.exe",
199+
Path("PCbuild") / "build.bat",
200+
*args,
201+
],
202+
)
203+
shutil.copytree(get_windows_build_dir(force_32bit), "libs", dirs_exist_ok=True)
203204

204205

205206
def install_pyperformance(venv: PathLike) -> None:

0 commit comments

Comments
 (0)