From 11eabdb0008ab873f3bcf07202e05a0ae9c7bc73 Mon Sep 17 00:00:00 2001 From: Kim Morrison <477956+kim-em@users.noreply.github.com> Date: Wed, 22 Oct 2025 09:49:38 +1100 Subject: [PATCH] chore: release_steps runs lake exe cache get when needed (#10882) --- script/release_steps.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/script/release_steps.py b/script/release_steps.py index 59c2fc7860..3bd71d2541 100755 --- a/script/release_steps.py +++ b/script/release_steps.py @@ -589,8 +589,19 @@ def execute_release_steps(repo, version, config): # Clean lake cache for a fresh build print(blue("Cleaning lake cache...")) - run_command("rm -rf .lake", cwd=repo_path) - + run_command("lake clean", cwd=repo_path) + + # Check if downstream of Mathlib and get cache if so + mathlib_package_dir = repo_path / ".lake" / "packages" / "mathlib" + if mathlib_package_dir.exists(): + print(blue("Project is downstream of Mathlib, fetching cache...")) + try: + run_command("lake exe cache get", cwd=repo_path, stream_output=True) + print(green("Cache fetched successfully")) + except subprocess.CalledProcessError as e: + print(yellow("Failed to fetch cache, continuing anyway...")) + print(yellow(f"Cache fetch error: {e}")) + try: run_command("lake build", cwd=repo_path, stream_output=True) print(green("Build completed successfully"))