fix: group region candidates once for both sides

The builder and the coverage report each grouped their own candidates
before asking which regional alternatives to withdraw. The builder
grouped the platform files and the core extras; the report grouped the
platform files alone, and keyed them on an unsanitized destination.

So a region run withdrew 73 files from a recalbox pack while the report
withdrew 14, and described the other 59 as covered by a pack that would
not carry them.

platform_region_groups builds the grouping once and both sides read it.
The extras it returns are keyed by emulator, name and path: Dolphin
declares three IPL.bin that differ by path alone, and a name-keyed map
withdraws the wrong one. Manifests are byte-identical before and after.
This commit is contained in:
Abdessamad Derraz committed 2026-08-12 06:43:47 +02:00
1 parent 7a84764348
commit b33d045175
4 files changed
+267 -118

No files matched your search

+29 -8
View File
@@ -49,6 +49,7 @@ from common import (
require_yaml,
resolve_local_file,
resolve_platform_cores,
sanitize_pack_path,
)
yaml = require_yaml()
@@ -803,16 +804,25 @@ def verify_platform(
file_severity: dict[str, str] = {}
region_drops: set[str] = set()
region_extra_dests: dict[tuple[str, str, str], str] = {}
if regions:
import region as region_mod
region_groups: dict[str, list[tuple[str, str]]] = {}
for sys_id, system in verify_systems.items():
members = region_groups.setdefault(sys_id, [])
for fe in system.get("files", []):
dest = fe.get("destination", fe.get("name", ""))
if dest:
members.append((dest, fe.get("name", "")))
# The builder owns pack composition, so it owns the grouping the region
# pass reads. Grouping the platform files here and the core extras
# there let the two answer differently on one request: the report kept
# every core extra a region run withdraws from the pack.
from generate_pack import platform_region_groups
region_groups, region_extra_dests = platform_region_groups(
config,
verify_systems,
emulators_dir,
db,
config.get("base_destination", ""),
profiles,
target_cores=target_cores,
)
region_drops = region_mod.resolve_region_drops(
region_groups, region_mod.build_region_index(profiles), regions
)
@@ -820,7 +830,9 @@ def verify_platform(
for sys_id, system in verify_systems.items():
for file_entry in system.get("files", []):
if region_drops and (
file_entry.get("destination", file_entry.get("name", ""))
sanitize_pack_path(
file_entry.get("destination", file_entry.get("name", ""))
)
in region_drops
):
continue
@@ -916,6 +928,15 @@ def verify_platform(
target_cores=target_cores,
data_names=supplemental_names,
)
if region_drops:
undeclared = [
u
for u in undeclared
if region_extra_dests.get(
(u.get("emulator", ""), u.get("name", ""), u.get("path") or "")
)
not in region_drops
]
exclusions = find_exclusion_notes(
config, emulators_dir, emu_profiles, target_cores=target_cores
)