From 1ceb4b0c5ab041096e020c6cbd873b3b736dd055 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sun, 4 Oct 2026 17:48:00 +0200 Subject: [PATCH] fix: split platform groups on declared emulators --- scripts/common.py | 12 +++++++++++- scripts/generate_pack.py | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/common.py b/scripts/common.py index 40e5bad1..0c84a827 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -1055,7 +1055,11 @@ def group_identical_platforms( platforms_dir: str, target_cores_cache: dict[str, set[str] | None] | None = None, ) -> list[tuple[list[str], str]]: - """Group platforms that produce identical packs (same files + base_destination). + """Group platforms that produce identical packs. + + A pack is the platform's own files plus those of the emulators it runs, + so two platforms share one only when both agree. base_destination does + not separate them: destinations inside a pack are relative to it. Returns [(group_of_platform_names, representative), ...]. The representative is the root platform (one that does not inherit). @@ -1086,6 +1090,12 @@ def group_identical_platforms( entries.append(f"{dest}|{sha1}|{md5}") fp = hashlib.sha1("|".join(sorted(entries)).encode()).hexdigest() + cores = config.get("cores") + emulators = [ + cores if isinstance(cores, str) else sorted(map(str, cores or [])), + sorted(map(str, config.get("standalone_cores") or [])), + ] + fp = hashlib.sha1(f"{fp}|{emulators}".encode()).hexdigest() if target_cores_cache: tc = target_cores_cache.get(platform) if tc is not None: diff --git a/scripts/generate_pack.py b/scripts/generate_pack.py index e24a42f9..05ce3417 100644 --- a/scripts/generate_pack.py +++ b/scripts/generate_pack.py @@ -2130,6 +2130,9 @@ def _run_manifest_mode( alias_manifest["display_name"] = alias_cfg.get( "platform", alias_plat ) + alias_manifest["base_destination"] = alias_cfg.get( + "base_destination", "" + ) alias_registry = registry.get("platforms", {}).get(alias_plat, {}) alias_install = alias_registry.get("install", {}) alias_manifest["detect"] = alias_install.get("detect", [])