Spaces:
Running
Running
Push Bot
commited on
Commit
Β·
f8cd563
1
Parent(s):
db04211
Fix SyntaxError; simplify debug; stage repo zip; make packages.txt empty
Browse files
app.py
CHANGED
|
@@ -3167,6 +3167,24 @@ def debug_compile_uploaded_zip(zip_file):
|
|
| 3167 |
|
| 3168 |
def debug_compile_output_zip():
|
| 3169 |
"""Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3170 |
logs = [f"π Debug(real) at {_now_str()}"]
|
| 3171 |
zip_path = ROOT / "output.zip"
|
| 3172 |
if not zip_path.exists():
|
|
@@ -3278,7 +3296,18 @@ def debug_compile_last_pipeline_zip():
|
|
| 3278 |
logs = [f"π Debug(last-pipeline-zip) at {_now_str()}"]
|
| 3279 |
last_zip = _find_last_pipeline_zip()
|
| 3280 |
if not last_zip:
|
| 3281 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3282 |
|
| 3283 |
# Prepare workspace
|
| 3284 |
run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
|
|
|
|
| 3167 |
|
| 3168 |
def debug_compile_output_zip():
|
| 3169 |
"""Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
|
| 3170 |
+
# Stage repo output.zip to runs/<id>/output.zip to follow pipeline layout, then delegate
|
| 3171 |
+
zip_path = ROOT / "output.zip"
|
| 3172 |
+
if not zip_path.exists():
|
| 3173 |
+
return (
|
| 3174 |
+
"<div style='color:#b00'><b>output.zip not found at repo root.</b></div>"
|
| 3175 |
+
+ f"<div>Expected at: {zip_path}</div>"
|
| 3176 |
+
)
|
| 3177 |
+
logs = [f"π Stage(repo zip) at {_now_str()}"]
|
| 3178 |
+
_, WORK_DIR, LOG_PATH, ZIP_PATH = _prepare_workspace(logs)
|
| 3179 |
+
try:
|
| 3180 |
+
shutil.copy2(zip_path, ZIP_PATH)
|
| 3181 |
+
logs.append(f"π¦ Staged repo output.zip β runs/{WORK_DIR.name}/output.zip")
|
| 3182 |
+
_write_logs(LOG_PATH, logs)
|
| 3183 |
+
except Exception as e:
|
| 3184 |
+
logs.append(f"β Failed staging output.zip: {e}")
|
| 3185 |
+
_write_logs(LOG_PATH, logs)
|
| 3186 |
+
return "<div style='color:#b00'>Failed to stage output.zip</div>"
|
| 3187 |
+
return debug_compile_last_pipeline_zip()
|
| 3188 |
logs = [f"π Debug(real) at {_now_str()}"]
|
| 3189 |
zip_path = ROOT / "output.zip"
|
| 3190 |
if not zip_path.exists():
|
|
|
|
| 3296 |
logs = [f"π Debug(last-pipeline-zip) at {_now_str()}"]
|
| 3297 |
last_zip = _find_last_pipeline_zip()
|
| 3298 |
if not last_zip:
|
| 3299 |
+
repo_zip = ROOT / "output.zip"
|
| 3300 |
+
if repo_zip.exists():
|
| 3301 |
+
try:
|
| 3302 |
+
_, W, L, Z = _prepare_workspace(logs)
|
| 3303 |
+
shutil.copy2(repo_zip, Z)
|
| 3304 |
+
logs.append(f"π¦ Auto-staged repo output.zip β runs/{W.name}/output.zip")
|
| 3305 |
+
last_zip = Z
|
| 3306 |
+
except Exception as e:
|
| 3307 |
+
logs.append(f"β Auto-stage failed: {e}")
|
| 3308 |
+
return "<div style='color:#b00'>No recent pipeline output.zip found and auto-stage failed.</div>"
|
| 3309 |
+
else:
|
| 3310 |
+
return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
|
| 3311 |
|
| 3312 |
# Prepare workspace
|
| 3313 |
run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
|