From 55211acb373d71e90c16af2e5b0a0f306e6687ee Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Mon, 9 Nov 2026 22:23:05 +0100 Subject: [PATCH] fix: type amiberry 8.5.0 as the code builds it The 8.5.0 source builds a standalone Amiberry and the libretro core, so the profile is standalone + libretro again. A standalone name a build the platform compiles itself answers to keeps meaning that build: RetroBat's standalone amiberry is 8.3.0, and 8.5.0 runs there as the core only. --- emulators/amiberry.yml | 2 +- scripts/common.py | 38 +++++++++++++++++++++++++++++++--- tests/test_standalone_links.py | 11 ++++++++++ 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/emulators/amiberry.yml b/emulators/amiberry.yml index 4ced4a42f..4981af12f 100644 --- a/emulators/amiberry.yml +++ b/emulators/amiberry.yml @@ -1,5 +1,5 @@ emulator: Amiberry -type: libretro +type: standalone + libretro core_classification: official_port source: "https://github.com/BlitterStudio/amiberry" upstream: "https://github.com/tonioni/WinUAE" diff --git a/scripts/common.py b/scripts/common.py index 8fa1fcf4e..4ad979d3a 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -2687,9 +2687,19 @@ def runs_standalone( return False if "standalone" not in str(profile.get("type", "")): return False - return emu_name in standalone_cores or bool( - standalone_cores & {str(c) for c in profile.get("cores", [])} - ) + names = {emu_name, *(str(c) for c in profile.get("cores", []))} + # A name a build the platform compiles itself answers to means that + # build there: RetroBat's standalone amiberry is 8.3.0, and the 8.5.0 + # profile, run there as the buildbot core, keeps its libretro layout. + owners: dict[str, set[str]] = {} + for tag in standalone_cores: + if tag.startswith(OWN_BUILD_PREFIX): + name, owner, source = json.loads(tag[len(OWN_BUILD_PREFIX):]) + if source == profile.get("source"): + owners.setdefault(name, set()).add(owner) + if any(emu_name not in owners[n] for n in names & owners.keys()): + return False + return emu_name in standalone_cores or bool(standalone_cores & names) # Marks, in a platform's standalone set, an emulator it also launches as a @@ -2704,6 +2714,9 @@ CORE_DIR_PREFIX = "coredir:" # Marks, in the same set, a file the platform's launcher executes # (launchers.executed_files), as JSON. EXECUTED_PREFIX = "exec:" +# Marks, in the same set, a standalone name a build the platform compiles +# itself (built_by) answers to, as JSON [name, profile, source]. +OWN_BUILD_PREFIX = "ownbuild:" # Marks, in the same set, a file name the platform declares under one of the # systems a launcher record is written for, as JSON [system, name]: it says # which launch reads a profile entry of that name. @@ -2771,6 +2784,24 @@ def launched_both_ways(config: dict) -> set[str]: return {str(c) for c in config.get("dual_mode_cores") or []} | (standalone & installable) +def own_build_tags(config: dict, standalone: set[str]) -> set[str]: + """The standalone names the platform's own builds answer to, tagged. + + Read from the profiles of this repository, the ones every pack, manifest + and report is built from. + """ + platform = str(config.get("_key") or "") + if not platform or not standalone: + return set() + profiles = load_emulator_profiles(str(Path(__file__).resolve().parent.parent / "emulators")) + return { + OWN_BUILD_PREFIX + json.dumps([n, key, p.get("source")]) + for key, p in profiles.items() + if platform in (p.get("built_by") or []) and "standalone" in str(p.get("type", "")) + for n in {key, *(str(c) for c in p.get("cores") or [])} & standalone + } + + def standalone_set(config: dict) -> set[str]: """The emulators a platform launches standalone, with its dual-mode ones. @@ -2780,6 +2811,7 @@ def standalone_set(config: dict) -> set[str]: """ names = {str(c) for c in config.get("standalone_cores") or []} names |= {DUAL_MODE_PREFIX + c for c in launched_both_ways(config)} + names |= own_build_tags(config, names) # The system directory each core is handed travels the same way, so # platform_layouts places a core's files below it for every reader. names |= { diff --git a/tests/test_standalone_links.py b/tests/test_standalone_links.py index 853595da9..98ebce23b 100644 --- a/tests/test_standalone_links.py +++ b/tests/test_standalone_links.py @@ -711,6 +711,17 @@ class AmiberryBuildEachPlatformShips(unittest.TestCase): with self.subTest(platform=platform): self.assertEqual(self.resolved(platform), own) + def test_no_standalone_amiberry_is_the_buildbot_revision(self) -> None: + from common import list_registered_platforms + + for platform in list_registered_platforms(str(REPO_ROOT / "platforms")): + cfg = load_platform_config(platform, str(REPO_ROOT / "platforms")) + if "amiberry" not in self.resolved(platform): + continue + layouts = platform_layouts("amiberry", self.profiles["amiberry"], standalone_set(cfg)) + with self.subTest(platform=platform): + self.assertEqual([standalone for _view, standalone in layouts], [False]) + def test_the_buildbot_core_runs_where_retroarch_installs_it(self) -> None: from common import load_target_config, resolve_platform_cores