Skip to content

Commit 3e12f9e

Browse files
2 parents b2de72c + 4e22292 commit 3e12f9e

File tree

3 files changed

+46
-4
lines changed

3 files changed

+46
-4
lines changed

.github/workflows/integration.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,10 @@ jobs:
7474

7575
- name: Verify JIT build works
7676
# Use commit that I know has JIT support with LLVM 20
77-
run: uv run every-python run 42d014086098d3d70cacb4d8993f04cace120c12 --jit -- --version
77+
run: uv run every-python run 42d014086098d3d70cacb4d8993f04cace120c12 --jit -- --version
78+
79+
- name: Verify consecutive builds work
80+
# Use two versions that can only be built if repo cleanup between works
81+
run: |
82+
uv run every-python install v3.12.0
83+
uv run every-python install v3.11.0

every_python/main.py

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,33 @@ def _get_configure_args(build_dir: Path, enable_jit: bool) -> list[str]:
135135
return args
136136

137137

138+
def _run_clean_repo(
139+
runner: CommandRunner,
140+
verbose: bool,
141+
progress: Progress,
142+
task: TaskID,
143+
) -> None:
144+
"""Run the clean repo step."""
145+
output = get_output()
146+
args = ["clean", "-fdx"]
147+
148+
if verbose:
149+
progress.stop()
150+
output.status(f"Running: git {' '.join(args)}")
151+
else:
152+
progress.update(task, description="Cleaning repo...")
153+
154+
result = runner.run_git(args, repo_dir=REPO_DIR)
155+
156+
if not result.success:
157+
if not verbose:
158+
progress.stop()
159+
output.error(f"Cleaning repo failed: {result.stderr}")
160+
else:
161+
output.error("Cleaning repo failed!")
162+
raise typer.Exit(1)
163+
164+
138165
def _run_configure(
139166
runner: CommandRunner,
140167
build_dir: Path,
@@ -213,7 +240,9 @@ def _build_and_install_unix(
213240
if not make_result.success:
214241
if not verbose:
215242
progress.stop()
216-
output.error(f"Build failed: {make_result.stderr if not verbose else ''}")
243+
output.error(f"Build failed: {make_result.stderr}")
244+
else:
245+
output.error("Build failed!")
217246
raise typer.Exit(1)
218247

219248
# Install
@@ -265,6 +294,9 @@ def build_python(commit: str, enable_jit: bool = False, verbose: bool = False) -
265294
output.error(f"Failed to checkout {commit}: {result.stderr}")
266295
raise typer.Exit(1)
267296

297+
# Clean repo
298+
_run_clean_repo(runner, verbose, progress, task)
299+
268300
# Configure
269301
_run_configure(runner, build_dir, enable_jit, verbose, progress, task)
270302

@@ -529,7 +561,7 @@ def bisect(
529561

530562
# Reset any local changes in the repo
531563
runner.run_git(["reset", "--hard"], REPO_DIR)
532-
runner.run_git(["clean", "-fd"], REPO_DIR)
564+
runner.run_git(["clean", "-fdx"], REPO_DIR)
533565

534566
runner.run_git(["bisect", "start"], REPO_DIR, check=True)
535567
runner.run_git(["bisect", "bad", bad_commit], REPO_DIR, check=True)

every_python/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,11 @@ def python_binary_location(builds_dir: Path, build_info: "BuildInfo") -> Path:
192192
return debug_binary
193193
return builds_dir / build_info.directory_name / "python.exe"
194194
else:
195-
return builds_dir / build_info.directory_name / "bin" / "python3"
195+
binary = builds_dir / build_info.directory_name / "bin" / "python3"
196+
fallback_binary = builds_dir / build_info.directory_name / "bin" / "python3.0"
197+
if not binary.exists() and fallback_binary.exists():
198+
return fallback_binary
199+
return binary
196200

197201

198202
@dataclass

0 commit comments

Comments
 (0)