fix: name the boards a downloaded core reaches

A board's core list names Batocera's standalone amiberry and the
buildbot's amiberry core alike, so install.py --target kept the
amiberry 8.5.0 libretro files on bcm2711, whose RetroArch downloads
nothing. resolve_platform_cores decides that reach, and the install
list now carries its answer as downloaded_cores, read by the
installer's narrowing for a target.

The builder tested only the first installable name of a profile:
Batocera lists higan_sfc_balanced and nside_sfc_balanced, the x86_64
downloader offers the second, and the core left the x86_64 pack with
its Super GameBoy files.
This commit is contained in:
Abdessamad Derraz committed 2026-11-10 02:07:54 +01:00
1 parent 7f20702b48
commit 2a6b8b5943
10 files changed
+183 -30

No files matched your search

+32
View File
@@ -113,6 +113,38 @@ class NarrowToCores(unittest.TestCase):
)
class ACoreOnlyTheDownloaderBrings(unittest.TestCase):
"""Batocera builds amiberry standalone on every board, and only its
x86_64 RetroArch downloads the amiberry core: both answer to amiberry
in a board's core list. The builder reads the downloader's reach
(resolve_platform_cores) and the list carries it in downloaded_cores."""
MANIFEST = {
"core_names": {"amiberry": [], "amiberry-7": ["amiberry"]},
"downloaded_cores": {"amiberry": ["x86_64", "pc"]},
"system_cores": {"commodore-amiga": ["amiberry", "amiberry-7"]},
"files": [
{"dest": "kick31.rom", "cores": ["amiberry-7"], "systems": ["commodore-amiga"]},
{"dest": "roms/a4091.rom", "cores": ["amiberry"], "systems": ["commodore-amiga"]},
],
"omitted_files": [],
}
def test_a_board_without_the_download_keeps_its_own_build(self):
files, _ = install.narrow_to_cores(self.MANIFEST, ["amiberry"], target="bcm2711")
self.assertEqual([f["dest"] for f in files], ["kick31.rom"])
def test_a_board_or_its_alias_with_the_download_keeps_both(self):
for target in ("x86_64", "pc"):
with self.subTest(target=target):
files, _ = install.narrow_to_cores(self.MANIFEST, ["amiberry"], target=target)
self.assertEqual([f["dest"] for f in files], ["kick31.rom", "roms/a4091.rom"])
def test_an_installed_core_is_no_board(self):
files, _ = install.narrow_to_cores(self.MANIFEST, ["amiberry"])
self.assertEqual([f["dest"] for f in files], ["kick31.rom", "roms/a4091.rom"])
class ACoreTheListDoesNotKnow(unittest.TestCase):
"""A core newer than the list (parallel_dc, issue 87) loses nothing its .info declares."""
+1 -1
View File
@@ -1015,7 +1015,7 @@ class InstallMatchesATargetManifest(unittest.TestCase):
))
full = self._manifest(platform)
built = self._manifest(platform, set(cores), target)
files, omitted = install.narrow_to_cores(full, cores)
files, omitted = install.narrow_to_cores(full, cores, target=target)
# A case-insensitive platform reads one file under both
# spellings (BlastEm's 32X_M_BIOS.bin, PicoDrive's .BIN).
from common import load_platform_config
+36
View File
@@ -335,6 +335,42 @@ class CoreDownloaderReach(unittest.TestCase):
self.assertIn(DUAL_MODE_PREFIX + "amiberry", standalone_set(config))
class DownloadedCoresReachTheirBoards(unittest.TestCase):
"""A core only the downloader brings runs where the board's downloader
offers one of its names, and the install list says on which boards."""
@classmethod
def setUpClass(cls):
from common import load_emulator_profiles, load_platform_config # noqa: PLC0415
cls.profiles = load_emulator_profiles(str(REPO_ROOT / "emulators"))
cls.config = load_platform_config("batocera", str(REPO_ROOT / "platforms"))
def test_every_installable_name_counts(self):
"""Batocera lists higan_sfc_balanced and nside_sfc_balanced, and the
buildbot offers the second: reading the first alone dropped the
core from x86_64."""
from common import load_target_config, resolve_platform_cores # noqa: PLC0415
root = str(REPO_ROOT / "platforms")
x86 = load_target_config("batocera", "x86_64", root)
self.assertIn("higan_sfc_balanced", resolve_platform_cores(self.config, self.profiles, x86))
rpi4 = load_target_config("batocera", "bcm2711", root)
resolved = resolve_platform_cores(self.config, self.profiles, rpi4)
self.assertNotIn("amiberry", resolved)
self.assertIn("amiberry-7.1.1-332", resolved)
def test_the_list_names_the_boards_of_each_downloaded_core(self):
import generate_pack # noqa: PLC0415
core_names = {"amiberry": [], "higan_sfc_balanced": ["nside_sfc_balanced"]}
boards = generate_pack._downloaded_cores(
self.config, self.profiles, core_names, str(REPO_ROOT / "platforms"))
self.assertEqual(set(boards), {"amiberry", "higan_sfc_balanced"})
self.assertIn("x86_64", boards["amiberry"])
self.assertNotIn("bcm2711", boards["amiberry"])
class KnulliPerBoard(unittest.TestCase):
"""KNULLI builds per board on Batocera's model from its own tree:
configs/knulli-*.board, package/system/knulli-system/Config.in and