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

+39
View File
@@ -86,6 +86,9 @@ from common import (
ProfileSelectionError,
core_system_dirs,
declared_root,
downloadable_on,
downloaded_only_profiles,
list_available_targets,
entry_serves_systems,
entry_system_ids,
platform_layouts,
@@ -5291,6 +5294,9 @@ def generate_manifest(
omitted_by_destination.values(), key=lambda entry: entry["dest"]
),
"core_names": core_names,
**({"downloaded_cores": downloaded} if (downloaded := _downloaded_cores(
config, emu_profiles, core_names, platforms_dir,
)) else {}),
"system_cores": system_cores,
# The names the platform itself gives its systems (Batocera's psx),
# which --system accepts beside the ids.
@@ -5445,6 +5451,39 @@ def _manifest_data_directories(
return trees
def _downloaded_cores(
config: dict,
profiles: dict[str, dict],
core_names: dict[str, list[str]],
platforms_dir: str,
) -> dict[str, list[str]]:
"""The cores only the platform's RetroArch downloader brings, each with
the boards, aliases included, whose downloader offers it.
A target list names the board's standalone amiberry and the buildbot's
amiberry core alike, so the installer cannot tell from the name whether
the board reaches the core. `resolve_platform_cores` decides it, and
`install.py --target` reads its answer here.
"""
reached = {
profile: names
for profile, names in downloaded_only_profiles(config, profiles).items()
if profile in core_names
}
if not reached:
return {}
platform = str(config.get("_key") or "")
boards: dict[str, list[str]] = {profile: [] for profile in reached}
for target in list_available_targets(platform, platforms_dir):
cores = load_target_config(platform, target["name"], platforms_dir)
if cores is None:
continue
for profile, names in reached.items():
if downloadable_on(cores, names):
boards[profile] += [target["name"], *target.get("aliases", [])]
return {profile: sorted(names) for profile, names in sorted(boards.items())}
def _manifest_core_index(
config: dict,
profiles: dict[str, dict],