refactor: read the declarations once per database

collect_all_aliases opened platforms/ and emulators/ from paths fixed to
the working directory while declarations took them as parameters, so a
build walked every YAML twice. read_declarations now reads both once,
reports unreadable sources, and hands the alias pass and the proven-name
index their entries. generate_db gains --platforms-dir and
--emulators-dir and refuses a missing one.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 16:43:57 +01:00
1 parent a30984912c
commit 49dbb2828d
5 files changed
+174 -228

No files matched your search

+3 -1
View File
@@ -31,7 +31,7 @@ DEFAULT_OUTPUT = "database.json"
def main() -> int:
parser = argparse.ArgumentParser(allow_abbrev=False, description="Generate multi-indexed BIOS database")
parser.add_argument("--force", action="store_true", help="Force rehash all files")
add_repo_inputs(parser, "bios")
add_repo_inputs(parser, "bios", "platforms", "emulators")
parser.add_argument(
"--output", "-o", default=DEFAULT_OUTPUT, help="Output JSON file"
)
@@ -47,6 +47,8 @@ def main() -> int:
)
args = parser.parse_args()
require_directory(args.bios_dir)
require_directory(args.platforms_dir, "--platforms-dir")
require_directory(args.emulators_dir, "--emulators-dir")
with repository_output_lock(args.output):
return generate(args)