feat: name doubled destinations in exports

A platform list that declares one path for two files fails one of the
two checks on every install. The export report lists each declaration
with its hash and the emulators whose profile reads that file.
This commit is contained in:
Abdessamad Derraz committed 2026-10-24 02:42:04 +02:00
1 parent eb7b265758
commit 2ee777824a
6 files changed
+341 -2

No files matched your search

+7 -1
View File
@@ -675,6 +675,8 @@ class Collision:
destination: str
resolved: list[str]
# Each declaration with the file it resolved to, in the platform's order.
declarations: list[tuple[dict, str | None]] = field(default_factory=list)
def _collision_json(collision: Collision) -> dict:
@@ -714,6 +716,7 @@ def find_collisions(
if len(entries) < 2:
continue
resolved = []
declarations = []
for entry in entries:
local, _ = resolve_local_file(
entry,
@@ -722,6 +725,7 @@ def find_collisions(
dest_hint=entry.get("destination", ""),
data_dir_registry=data_dir_registry,
)
declarations.append((entry, local))
if local and local not in resolved:
resolved.append(local)
if len(resolved) > 1 and not _same_file_family(resolved):
@@ -730,7 +734,9 @@ def find_collisions(
# also names the first one's file.
if any(_accepted_by_all(path, entries, db) for path in resolved):
continue
collisions.append(Collision(destination=key, resolved=resolved))
collisions.append(
Collision(destination=key, resolved=resolved, declarations=declarations)
)
return collisions