Spaces:
Sleeping
Sleeping
Push Bot
commited on
Commit
Β·
56e3376
1
Parent(s):
02c0a6e
Fix SyntaxError; simplify debug; stage repo zip; make packages.txt empty
Browse files
app.py
CHANGED
|
@@ -2788,6 +2788,24 @@ def debug_compile_uploaded_zip(zip_file):
|
|
| 2788 |
|
| 2789 |
def debug_compile_output_zip():
|
| 2790 |
"""Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2791 |
logs = [f"π Debug(real) at {_now_str()}"]
|
| 2792 |
zip_path = ROOT / "output.zip"
|
| 2793 |
if not zip_path.exists():
|
|
@@ -2899,7 +2917,18 @@ def debug_compile_last_pipeline_zip():
|
|
| 2899 |
logs = [f"π Debug(last-pipeline-zip) at {_now_str()}"]
|
| 2900 |
last_zip = _find_last_pipeline_zip()
|
| 2901 |
if not last_zip:
|
| 2902 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2903 |
|
| 2904 |
# Prepare workspace
|
| 2905 |
run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
|
|
|
|
| 2788 |
|
| 2789 |
def debug_compile_output_zip():
|
| 2790 |
"""Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
|
| 2791 |
+
# Stage repo output.zip to runs/<id>/output.zip to follow pipeline layout, then delegate
|
| 2792 |
+
zip_path = ROOT / "output.zip"
|
| 2793 |
+
if not zip_path.exists():
|
| 2794 |
+
return (
|
| 2795 |
+
"<div style='color:#b00'><b>output.zip not found at repo root.</b></div>"
|
| 2796 |
+
+ f"<div>Expected at: {zip_path}</div>"
|
| 2797 |
+
)
|
| 2798 |
+
logs = [f"π Stage(repo zip) at {_now_str()}"]
|
| 2799 |
+
_, WORK_DIR, LOG_PATH, ZIP_PATH = _prepare_workspace(logs)
|
| 2800 |
+
try:
|
| 2801 |
+
shutil.copy2(zip_path, ZIP_PATH)
|
| 2802 |
+
logs.append(f"π¦ Staged repo output.zip β runs/{WORK_DIR.name}/output.zip")
|
| 2803 |
+
_write_logs(LOG_PATH, logs)
|
| 2804 |
+
except Exception as e:
|
| 2805 |
+
logs.append(f"β Failed staging output.zip: {e}")
|
| 2806 |
+
_write_logs(LOG_PATH, logs)
|
| 2807 |
+
return "<div style='color:#b00'>Failed to stage output.zip</div>"
|
| 2808 |
+
return debug_compile_last_pipeline_zip()
|
| 2809 |
logs = [f"π Debug(real) at {_now_str()}"]
|
| 2810 |
zip_path = ROOT / "output.zip"
|
| 2811 |
if not zip_path.exists():
|
|
|
|
| 2917 |
logs = [f"π Debug(last-pipeline-zip) at {_now_str()}"]
|
| 2918 |
last_zip = _find_last_pipeline_zip()
|
| 2919 |
if not last_zip:
|
| 2920 |
+
repo_zip = ROOT / "output.zip"
|
| 2921 |
+
if repo_zip.exists():
|
| 2922 |
+
try:
|
| 2923 |
+
_, W, L, Z = _prepare_workspace(logs)
|
| 2924 |
+
shutil.copy2(repo_zip, Z)
|
| 2925 |
+
logs.append(f"π¦ Auto-staged repo output.zip β runs/{W.name}/output.zip")
|
| 2926 |
+
last_zip = Z
|
| 2927 |
+
except Exception as e:
|
| 2928 |
+
logs.append(f"β Auto-stage failed: {e}")
|
| 2929 |
+
return "<div style='color:#b00'>No recent pipeline output.zip found and auto-stage failed.</div>"
|
| 2930 |
+
else:
|
| 2931 |
+
return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
|
| 2932 |
|
| 2933 |
# Prepare workspace
|
| 2934 |
run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
|