Spaces:
Sleeping
Sleeping
Push Bot
commited on
Commit
Β·
1618bc7
1
Parent(s):
ef69de6
Fix SyntaxError; simplify debug; stage repo zip; make packages.txt empty
Browse files
app.py
CHANGED
|
@@ -1373,6 +1373,24 @@ def debug_compile_uploaded_zip(zip_file):
|
|
| 1373 |
|
| 1374 |
def debug_compile_output_zip():
|
| 1375 |
"""Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1376 |
logs = [f"π Debug(real) at {_now_str()}"]
|
| 1377 |
zip_path = ROOT / "output.zip"
|
| 1378 |
if not zip_path.exists():
|
|
@@ -1484,7 +1502,18 @@ def debug_compile_last_pipeline_zip():
|
|
| 1484 |
logs = [f"π Debug(last-pipeline-zip) at {_now_str()}"]
|
| 1485 |
last_zip = _find_last_pipeline_zip()
|
| 1486 |
if not last_zip:
|
| 1487 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1488 |
|
| 1489 |
# Prepare workspace
|
| 1490 |
run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
|
|
|
|
| 1373 |
|
| 1374 |
def debug_compile_output_zip():
|
| 1375 |
"""Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
|
| 1376 |
+
# Stage repo output.zip to runs/<id>/output.zip to follow pipeline layout, then delegate
|
| 1377 |
+
zip_path = ROOT / "output.zip"
|
| 1378 |
+
if not zip_path.exists():
|
| 1379 |
+
return (
|
| 1380 |
+
"<div style='color:#b00'><b>output.zip not found at repo root.</b></div>"
|
| 1381 |
+
+ f"<div>Expected at: {zip_path}</div>"
|
| 1382 |
+
)
|
| 1383 |
+
logs = [f"π Stage(repo zip) at {_now_str()}"]
|
| 1384 |
+
_, WORK_DIR, LOG_PATH, ZIP_PATH = _prepare_workspace(logs)
|
| 1385 |
+
try:
|
| 1386 |
+
shutil.copy2(zip_path, ZIP_PATH)
|
| 1387 |
+
logs.append(f"π¦ Staged repo output.zip β runs/{WORK_DIR.name}/output.zip")
|
| 1388 |
+
_write_logs(LOG_PATH, logs)
|
| 1389 |
+
except Exception as e:
|
| 1390 |
+
logs.append(f"β Failed staging output.zip: {e}")
|
| 1391 |
+
_write_logs(LOG_PATH, logs)
|
| 1392 |
+
return "<div style='color:#b00'>Failed to stage output.zip</div>"
|
| 1393 |
+
return debug_compile_last_pipeline_zip()
|
| 1394 |
logs = [f"π Debug(real) at {_now_str()}"]
|
| 1395 |
zip_path = ROOT / "output.zip"
|
| 1396 |
if not zip_path.exists():
|
|
|
|
| 1502 |
logs = [f"π Debug(last-pipeline-zip) at {_now_str()}"]
|
| 1503 |
last_zip = _find_last_pipeline_zip()
|
| 1504 |
if not last_zip:
|
| 1505 |
+
repo_zip = ROOT / "output.zip"
|
| 1506 |
+
if repo_zip.exists():
|
| 1507 |
+
try:
|
| 1508 |
+
_, W, L, Z = _prepare_workspace(logs)
|
| 1509 |
+
shutil.copy2(repo_zip, Z)
|
| 1510 |
+
logs.append(f"π¦ Auto-staged repo output.zip β runs/{W.name}/output.zip")
|
| 1511 |
+
last_zip = Z
|
| 1512 |
+
except Exception as e:
|
| 1513 |
+
logs.append(f"β Auto-stage failed: {e}")
|
| 1514 |
+
return "<div style='color:#b00'>No recent pipeline output.zip found and auto-stage failed.</div>"
|
| 1515 |
+
else:
|
| 1516 |
+
return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
|
| 1517 |
|
| 1518 |
# Prepare workspace
|
| 1519 |
run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
|