mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-02 14:28:54 -06:00
fix: run every pipeline step from the repo root
The in-process steps read platforms/, database.json and bios/ from the caller's directory while child steps ran at the root. pipeline.main now moves to the root once --output-dir is resolved, and the step 5 comparisons run from the root when called directly.
This commit is contained in:
1 parent
9b2957fbe4
commit
6dd9eabcb8
6 files changed
+100
-8
No files matched your search
@@ -2,10 +2,12 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
import os
|
||||
import subprocess
|
||||
import time
|
||||
from pathlib import Path
|
||||
from typing import Iterator
|
||||
|
||||
from core.paths import REPO_ROOT
|
||||
from orchestrate.labels import step_title
|
||||
@@ -24,6 +26,30 @@ def pack_output_dir(typed: str | None) -> str:
|
||||
return str(Path(typed).resolve())
|
||||
|
||||
|
||||
def enter_repo_root() -> None:
|
||||
"""Move the run to the repository root, where every step reads its inputs.
|
||||
|
||||
The child steps already ran there, while the steps run in this process
|
||||
read platforms/, database.json and bios/ from the caller's directory:
|
||||
started from scripts/, the offline refusal found no registry and stayed
|
||||
silent, verify held no data directory, and step 5 stopped on a missing
|
||||
registry after every pack was built. Called once the typed
|
||||
--output-dir is resolved, since that one is read from where it was typed.
|
||||
"""
|
||||
os.chdir(REPO_ROOT)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def at_repo_root() -> Iterator[None]:
|
||||
"""Run the block from the repository root, then go back to the caller's directory."""
|
||||
previous = os.getcwd()
|
||||
os.chdir(REPO_ROOT)
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
os.chdir(previous)
|
||||
|
||||
|
||||
def run(cmd: list[str], label: str) -> tuple[bool, str]:
|
||||
"""Run a command, echoing its output as it comes. Returns (success, output).
|
||||
|
||||
|
||||
Reference in new issue
Block a user