diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index c94e401..7bb1ccb 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -74,4 +74,10 @@ jobs: - name: Verify JIT build works # Use commit that I know has JIT support with LLVM 20 - run: uv run every-python run 42d014086098d3d70cacb4d8993f04cace120c12 --jit -- --version \ No newline at end of file + run: uv run every-python run 42d014086098d3d70cacb4d8993f04cace120c12 --jit -- --version + + - name: Verify consecutive builds work + # Use two versions that can only be built if repo cleanup between works + run: | + uv run every-python install v3.12.0 + uv run every-python install v3.11.0 diff --git a/every_python/main.py b/every_python/main.py index 365cbe8..188f340 100644 --- a/every_python/main.py +++ b/every_python/main.py @@ -135,6 +135,33 @@ def _get_configure_args(build_dir: Path, enable_jit: bool) -> list[str]: return args +def _run_clean_repo( + runner: CommandRunner, + verbose: bool, + progress: Progress, + task: TaskID, +) -> None: + """Run the clean repo step.""" + output = get_output() + args = ["clean", "-fdx"] + + if verbose: + progress.stop() + output.status(f"Running: git {' '.join(args)}") + else: + progress.update(task, description="Cleaning repo...") + + result = runner.run_git(args, repo_dir=REPO_DIR) + + if not result.success: + if not verbose: + progress.stop() + output.error(f"Cleaning repo failed: {result.stderr}") + else: + output.error("Cleaning repo failed!") + raise typer.Exit(1) + + def _run_configure( runner: CommandRunner, build_dir: Path, @@ -263,6 +290,9 @@ def build_python(commit: str, enable_jit: bool = False, verbose: bool = False) - output.error(f"Failed to checkout {commit}: {result.stderr}") raise typer.Exit(1) + # Clean repo + _run_clean_repo(runner, verbose, progress, task) + # Configure _run_configure(runner, build_dir, enable_jit, verbose, progress, task) @@ -527,7 +557,7 @@ def bisect( # Reset any local changes in the repo runner.run_git(["reset", "--hard"], REPO_DIR) - runner.run_git(["clean", "-fd"], REPO_DIR) + runner.run_git(["clean", "-fdx"], REPO_DIR) runner.run_git(["bisect", "start"], REPO_DIR, check=True) runner.run_git(["bisect", "bad", bad_commit], REPO_DIR, check=True)