fix: no composite md5 as a container target

Recalbox hashes a ZIP by its members (zip_digest: composite, Bios.cpp:64-68), so its md5 names no container bytes: romset_recipes --missing tried to rebuild it and counted it unreproducible.
This commit is contained in:
Abdessamad Derraz committed 2026-11-06 18:34:34 +01:00
1 parent 8e3ba2cfd3
commit b4346ebf14
2 files changed
+27 -2

No files matched your search

+8 -2
View File
@@ -290,7 +290,9 @@ def platform_targets(platforms_dir: str) -> dict[str, set[str]]:
"""Container MD5s the platforms pin, per archive name.
``zipped_file`` entries pin an inner ROM instead of the container, so
their MD5 is not an archive hash and is skipped.
their MD5 is not an archive hash and is skipped. So is a Recalbox md5,
the composite of the members (``zip_digest: composite``, Bios.cpp:64-68):
no container build can ever give it.
"""
targets: dict[str, set[str]] = defaultdict(set)
for name in list_registered_platforms(platforms_dir):
@@ -298,7 +300,11 @@ def platform_targets(platforms_dir: str) -> dict[str, set[str]]:
for system in config.get("systems", {}).values():
for entry in system.get("files", []) or []:
archive = entry.get("name", "")
if not archive.endswith(".zip") or entry.get("zipped_file"):
if (
not archive.endswith(".zip")
or entry.get("zipped_file")
or entry.get("zip_digest") == "composite"
):
continue
for value in str(entry.get("md5") or "").split(","):
value = value.strip().lower()
+19
View File
@@ -246,6 +246,25 @@ class ReportsOverAFixture(unittest.TestCase):
self.assertEqual(len(report["unreproducible"]), 1)
self.assertEqual(report["unreproducible"][0]["recipes_tried"], ["v1"])
def test_a_composite_md5_is_no_container_target(self):
"""Recalbox hashes a ZIP by its members: its md5 names no archive bytes."""
platforms = self.root / "platforms"
platforms.mkdir()
(platforms / "_registry.yml").write_text(
"platforms:\n demo:\n config: demo.yml\n zip_digest: composite\n",
encoding="utf-8",
)
(platforms / "demo.yml").write_text(
"platform: Demo\nsystems:\n arcade:\n files:\n"
" - name: set.zip\n destination: set.zip\n"
f" md5: {'f' * 32}\n",
encoding="utf-8",
)
self.db["indexes"]["by_md5"] = {}
report = missing_report(self.recipes, self.pool, self.db, str(platforms))
self.assertEqual(report, {"constructible": [], "unreproducible": [], "no_recipe": []})
DAT = """<?xml version="1.0"?>
<datafile>