fix: prove launcher records against run profiles

This commit is contained in:
Abdessamad Derraz committed 2026-11-21 21:42:19 +01:00
1 parent e36516f3b0
commit 1839916ca2
35 files changed
+179 -160

No files matched your search

+1 -1
View File
@@ -250,7 +250,7 @@ def build_emulator_gap_report(
from packs.crossref import cross_reference as run_cross_reference, global_report_scope
declared, scope = global_report_scope(
[cov["config"] for cov in coverages.values()], db)
[cov["config"] for cov in coverages.values()], db, profiles)
unique_profiles = {
k: v
for k, v in profiles.items()
+7 -4
View File
@@ -346,18 +346,21 @@ PER_EMULATOR_STEM = "gaps-per-emulator"
NOT_COLLECTED_STEM = "gaps-not-collected"
def reading_platforms(emu_name: str, profile: dict, name: str,
def reading_platforms(emu_name: str, profiles: dict[str, dict], name: str,
configs: dict[str, dict]) -> set[str]:
"""Of the platforms running an emulator (name -> config), those whose
build of it reads the entry: BlastEm's cdbios.bin is read by the
standalone build only, and RetroBat hands that build other names."""
standalone build only, and RetroBat hands that build other names.
*profiles* is every profile of the run, the emulator's among them."""
from resolve.standalone import platform_layouts, standalone_set
from resolve.validation import filter_files_by_mode, unread_on
profile = profiles[emu_name]
return {
platform for platform, config in configs.items()
if any(f.get("name") == name and not unread_on(f, platform)
for view, standalone in platform_layouts(emu_name, profile, standalone_set(config))
for view, standalone in platform_layouts(
emu_name, profile, standalone_set(config, profiles))
for f in filter_files_by_mode(view.get("files") or [], standalone))
}
@@ -575,7 +578,7 @@ def _source_row(m: dict, profiles: dict, coverages: dict,
emu_to_platforms: dict[str, set[str]], placer: sitewanted.Placer | None) -> str:
"""The row of one file to source."""
plats = sorted(set().union(
*(reading_platforms(key, profiles[key], m["name"], {
*(reading_platforms(key, profiles, m["name"], {
p: coverages[p]["config"] for p in emu_to_platforms.get(key, set())
}) for key in m["emu_keys"])
))
+5 -3
View File
@@ -11,6 +11,7 @@ from collections import Counter
from core.text import series
from model import siteinputs
from model.collection import profiles_in
from model.guides import GUIDES, TERMINALS, install_command
from model.platforms import load_platform_config
from model.registry import list_release_pack_platforms
@@ -186,13 +187,14 @@ def emulator_install_route(name: str, profile: dict) -> tuple[str, list[str], tu
def _standalone_cores(platform: str) -> frozenset[str]:
"""The emulators a setup launches as apps, by its platform file."""
return _standalone_cores_in(str(siteinputs.current().platforms), platform)
inputs = siteinputs.current()
return _standalone_cores_in(str(inputs.platforms), str(inputs.emulators), platform)
@functools.cache
def _standalone_cores_in(platforms_dir: str, platform: str) -> frozenset[str]:
def _standalone_cores_in(platforms_dir: str, emulators_dir: str, platform: str) -> frozenset[str]:
config = load_platform_config(platform, platforms_dir)
return frozenset(standalone_set(config))
return frozenset(standalone_set(config, profiles_in(emulators_dir, skip_aliases=True)))
def install_block(name: str, profile: dict) -> list[str]:
+2 -2
View File
@@ -121,7 +121,7 @@ def _launcher_refs(config: dict) -> dict[str, list[str]]:
# config file does not prove opens nothing: it is listed apart.
source = list_source(str(config.get("source") or ""))
found: dict[str, list[str]] = {}
for record in bound_launchers(config):
for record in bound_launchers(config, _site_profiles()):
if not isinstance(record, dict) or not record.get("source_ref"):
continue
text = (f"{escape_tags(str(record.get('emulator', '')))} at "
@@ -145,7 +145,7 @@ def launcher_unproven_section(config: dict) -> list[str]:
from resolve.launchers import launcher_unproven
from sitegen.sources import launcher_ref_markdown, list_source
rows = launcher_unproven({str(config.get("_key") or ""): config})
rows = launcher_unproven({str(config.get("_key") or ""): config}, _site_profiles())
if not rows:
return []
source = list_source(str(config.get("source") or ""))
+1 -1
View File
@@ -199,7 +199,7 @@ def wanted_declarations(profiles: dict, coverages: dict, gap_report: dict) -> li
found: list[dict] = []
for key, coverage in sorted(coverages.items()):
systems = coverage.get("config", {}).get("systems") or {}
standalone_cores = standalone_set(coverage.get("config", {}))
standalone_cores = standalone_set(coverage.get("config", {}), profiles)
by_system: dict[str, list[dict]] = {}
for detail in coverage.get("details", []):
by_system.setdefault(detail.get("system", ""), []).append(detail)