Spaces:
Running
Running
Push Bot
commited on
Commit
Β·
c13961f
1
Parent(s):
87a6296
Fix SyntaxError; simplify debug; stage repo zip; make packages.txt empty
Browse files
app.py
CHANGED
|
@@ -2534,6 +2534,24 @@ def debug_compile_uploaded_zip(zip_file):
|
|
| 2534 |
|
| 2535 |
def debug_compile_output_zip():
|
| 2536 |
"""Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2537 |
logs = [f"π Debug(real) at {_now_str()}"]
|
| 2538 |
zip_path = ROOT / "output.zip"
|
| 2539 |
if not zip_path.exists():
|
|
@@ -2645,7 +2663,18 @@ def debug_compile_last_pipeline_zip():
|
|
| 2645 |
logs = [f"π Debug(last-pipeline-zip) at {_now_str()}"]
|
| 2646 |
last_zip = _find_last_pipeline_zip()
|
| 2647 |
if not last_zip:
|
| 2648 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2649 |
|
| 2650 |
# Prepare workspace
|
| 2651 |
run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
|
|
|
|
| 2534 |
|
| 2535 |
def debug_compile_output_zip():
|
| 2536 |
"""Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
|
| 2537 |
+
# Stage repo output.zip to runs/<id>/output.zip to follow pipeline layout, then delegate
|
| 2538 |
+
zip_path = ROOT / "output.zip"
|
| 2539 |
+
if not zip_path.exists():
|
| 2540 |
+
return (
|
| 2541 |
+
"<div style='color:#b00'><b>output.zip not found at repo root.</b></div>"
|
| 2542 |
+
+ f"<div>Expected at: {zip_path}</div>"
|
| 2543 |
+
)
|
| 2544 |
+
logs = [f"π Stage(repo zip) at {_now_str()}"]
|
| 2545 |
+
_, WORK_DIR, LOG_PATH, ZIP_PATH = _prepare_workspace(logs)
|
| 2546 |
+
try:
|
| 2547 |
+
shutil.copy2(zip_path, ZIP_PATH)
|
| 2548 |
+
logs.append(f"π¦ Staged repo output.zip β runs/{WORK_DIR.name}/output.zip")
|
| 2549 |
+
_write_logs(LOG_PATH, logs)
|
| 2550 |
+
except Exception as e:
|
| 2551 |
+
logs.append(f"β Failed staging output.zip: {e}")
|
| 2552 |
+
_write_logs(LOG_PATH, logs)
|
| 2553 |
+
return "<div style='color:#b00'>Failed to stage output.zip</div>"
|
| 2554 |
+
return debug_compile_last_pipeline_zip()
|
| 2555 |
logs = [f"π Debug(real) at {_now_str()}"]
|
| 2556 |
zip_path = ROOT / "output.zip"
|
| 2557 |
if not zip_path.exists():
|
|
|
|
| 2663 |
logs = [f"π Debug(last-pipeline-zip) at {_now_str()}"]
|
| 2664 |
last_zip = _find_last_pipeline_zip()
|
| 2665 |
if not last_zip:
|
| 2666 |
+
repo_zip = ROOT / "output.zip"
|
| 2667 |
+
if repo_zip.exists():
|
| 2668 |
+
try:
|
| 2669 |
+
_, W, L, Z = _prepare_workspace(logs)
|
| 2670 |
+
shutil.copy2(repo_zip, Z)
|
| 2671 |
+
logs.append(f"π¦ Auto-staged repo output.zip β runs/{W.name}/output.zip")
|
| 2672 |
+
last_zip = Z
|
| 2673 |
+
except Exception as e:
|
| 2674 |
+
logs.append(f"β Auto-stage failed: {e}")
|
| 2675 |
+
return "<div style='color:#b00'>No recent pipeline output.zip found and auto-stage failed.</div>"
|
| 2676 |
+
else:
|
| 2677 |
+
return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
|
| 2678 |
|
| 2679 |
# Prepare workspace
|
| 2680 |
run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
|