Skip to content

Commit 744f980

Browse files
committed
chore: release_steps runs lake exe cache get when needed
1 parent e0b813b commit 744f980

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

script/release_steps.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,19 @@ def execute_release_steps(repo, version, config):
589589

590590
# Clean lake cache for a fresh build
591591
print(blue("Cleaning lake cache..."))
592-
run_command("rm -rf .lake", cwd=repo_path)
593-
592+
run_command("lake clean", cwd=repo_path)
593+
594+
# Check if downstream of Mathlib and get cache if so
595+
mathlib_package_dir = repo_path / ".lake" / "packages" / "mathlib"
596+
if mathlib_package_dir.exists():
597+
print(blue("Project is downstream of Mathlib, fetching cache..."))
598+
try:
599+
run_command("lake exe cache get", cwd=repo_path, stream_output=True)
600+
print(green("Cache fetched successfully"))
601+
except subprocess.CalledProcessError as e:
602+
print(yellow("Failed to fetch cache, continuing anyway..."))
603+
print(yellow(f"Cache fetch error: {e}"))
604+
594605
try:
595606
run_command("lake build", cwd=repo_path, stream_output=True)
596607
print(green("Build completed successfully"))

0 commit comments

Comments
 (0)