Spaces:
Sleeping
Sleeping
Push Bot
commited on
Commit
Β·
3e32dc0
1
Parent(s):
3364b1b
Fix SyntaxError; simplify debug; stage repo zip; make packages.txt empty
Browse files
app.py
CHANGED
|
@@ -3767,6 +3767,24 @@ def debug_compile_uploaded_zip(zip_file):
|
|
| 3767 |
|
| 3768 |
def debug_compile_output_zip():
|
| 3769 |
"""Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3770 |
logs = [f"π Debug(real) at {_now_str()}"]
|
| 3771 |
zip_path = ROOT / "output.zip"
|
| 3772 |
if not zip_path.exists():
|
|
@@ -3878,7 +3896,18 @@ def debug_compile_last_pipeline_zip():
|
|
| 3878 |
logs = [f"π Debug(last-pipeline-zip) at {_now_str()}"]
|
| 3879 |
last_zip = _find_last_pipeline_zip()
|
| 3880 |
if not last_zip:
|
| 3881 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3882 |
|
| 3883 |
# Prepare workspace
|
| 3884 |
run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
|
|
|
|
| 3767 |
|
| 3768 |
def debug_compile_output_zip():
|
| 3769 |
"""Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
|
| 3770 |
+
# Stage repo output.zip to runs/<id>/output.zip to follow pipeline layout, then delegate
|
| 3771 |
+
zip_path = ROOT / "output.zip"
|
| 3772 |
+
if not zip_path.exists():
|
| 3773 |
+
return (
|
| 3774 |
+
"<div style='color:#b00'><b>output.zip not found at repo root.</b></div>"
|
| 3775 |
+
+ f"<div>Expected at: {zip_path}</div>"
|
| 3776 |
+
)
|
| 3777 |
+
logs = [f"π Stage(repo zip) at {_now_str()}"]
|
| 3778 |
+
_, WORK_DIR, LOG_PATH, ZIP_PATH = _prepare_workspace(logs)
|
| 3779 |
+
try:
|
| 3780 |
+
shutil.copy2(zip_path, ZIP_PATH)
|
| 3781 |
+
logs.append(f"π¦ Staged repo output.zip β runs/{WORK_DIR.name}/output.zip")
|
| 3782 |
+
_write_logs(LOG_PATH, logs)
|
| 3783 |
+
except Exception as e:
|
| 3784 |
+
logs.append(f"β Failed staging output.zip: {e}")
|
| 3785 |
+
_write_logs(LOG_PATH, logs)
|
| 3786 |
+
return "<div style='color:#b00'>Failed to stage output.zip</div>"
|
| 3787 |
+
return debug_compile_last_pipeline_zip()
|
| 3788 |
logs = [f"π Debug(real) at {_now_str()}"]
|
| 3789 |
zip_path = ROOT / "output.zip"
|
| 3790 |
if not zip_path.exists():
|
|
|
|
| 3896 |
logs = [f"π Debug(last-pipeline-zip) at {_now_str()}"]
|
| 3897 |
last_zip = _find_last_pipeline_zip()
|
| 3898 |
if not last_zip:
|
| 3899 |
+
repo_zip = ROOT / "output.zip"
|
| 3900 |
+
if repo_zip.exists():
|
| 3901 |
+
try:
|
| 3902 |
+
_, W, L, Z = _prepare_workspace(logs)
|
| 3903 |
+
shutil.copy2(repo_zip, Z)
|
| 3904 |
+
logs.append(f"π¦ Auto-staged repo output.zip β runs/{W.name}/output.zip")
|
| 3905 |
+
last_zip = Z
|
| 3906 |
+
except Exception as e:
|
| 3907 |
+
logs.append(f"β Auto-stage failed: {e}")
|
| 3908 |
+
return "<div style='color:#b00'>No recent pipeline output.zip found and auto-stage failed.</div>"
|
| 3909 |
+
else:
|
| 3910 |
+
return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
|
| 3911 |
|
| 3912 |
# Prepare workspace
|
| 3913 |
run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
|