fix: keep MinUI core dirs out of the tree view

Without --platform, cross_reference and the site's gap report merged every
platform's standalone set, MinUI, NextUI and MyMinUI coredir: markers
included. A marker says which cores one platform hands a folder, so in the
union every core those three do not list got no layout: px68k showed 0 of
6 files and the global report lost 238 profiles and 1201 files.
merged_standalone_set drops the markers, and both readers use it.
This commit is contained in:
Abdessamad Derraz committed 2026-11-05 19:39:07 +01:00
1 parent 0428588a6c
commit da19bb5755
4 files changed
+48 -7

No files matched your search

+16
View File
@@ -2446,6 +2446,22 @@ def standalone_set(config: dict) -> set[str]:
return names
def merged_standalone_set(configs: Iterable[dict]) -> set[str]:
"""The standalone set of several platforms read as one tree.
A per-core directory marker says which cores one platform hands a folder
and that it hands the others none. Carried into the union, MinUI's 86
markers left every core they do not list without a layout: the global
gap report lost 238 profiles and 1201 files without a word.
"""
return {
tag
for config in configs
for tag in standalone_set(config)
if not tag.startswith(CORE_DIR_PREFIX)
}
def _handed(standalone_cores: Iterable[str]) -> list:
"""The directories a standalone set carries, as launchers built them."""
from launchers import HandedDirectory # noqa: PLC0415
+4 -4
View File
@@ -1156,12 +1156,12 @@ def main() -> None:
# The tree as every platform runs it: a profile some platform runs
# standalone keeps its standalone entries. Laid out as libretro only,
# eka2l1, dolphin and xenia-edge lost 133 files no platform declares.
from common import list_registered_platforms
from common import list_registered_platforms, merged_standalone_set
standalone_cores = set().union(*(
standalone_set(load_platform_config(name, args.platforms_dir))
standalone_cores = merged_standalone_set(
load_platform_config(name, args.platforms_dir)
for name in list_registered_platforms(args.platforms_dir, include_archived=True)
))
)
if not profiles:
if emulator and args.target and emulator in run_anywhere:
+3 -3
View File
@@ -1159,7 +1159,7 @@ def build_emulator_gap_report(
for k, v in profiles.items()
if v.get("type") not in ("alias", "test")
}
from common import platform_declarations, standalone_set
from common import merged_standalone_set, platform_declarations
from validation import case_folded_slots
# The command line passes these too: without them a RetroBat file named
@@ -1171,8 +1171,8 @@ def build_emulator_gap_report(
return run_cross_reference(
unique_profiles, declared, db,
data_names=data_names, all_declared=all_declared,
standalone_cores=set().union(
*(standalone_set(cov["config"]) for cov in coverages.values())
standalone_cores=merged_standalone_set(
cov["config"] for cov in coverages.values()
),
folded_slots=folded,
)
+25
View File
@@ -439,5 +439,30 @@ class TheSitePageOfACardPlatform(unittest.TestCase):
self.assertIn("No ZIP for MinUI. The command installs every file and checks it.", page)
class TheWholeTreeKeepsCoresMinUILeavesOut(unittest.TestCase):
"""Without --platform, cross_reference and the site's gap report merge
every platform's standalone set. MinUI's per-core folders came along and
left every core MinUI does not list with no layout: px68k showed 0 files
and the global report lost 238 profiles."""
def test_a_core_minui_does_not_list_keeps_its_files(self):
from common import merged_standalone_set, platform_layouts
minui = {"core_system_dirs": {"Bios/FC": {"cores": ["fceumm"]}}}
retroarch = {}
merged = merged_standalone_set([minui, retroarch])
profile = {"type": "libretro", "files": [{"name": "cgrom.tmp"}]}
layouts = platform_layouts("px68k", profile, merged)
self.assertEqual(layouts, [(profile, False)])
def test_both_readers_build_the_set_the_same_way(self):
for script in ("cross_reference.py", "generate_site.py"):
source = (REPO_ROOT / "scripts" / script).read_text(encoding="utf-8")
with self.subTest(script=script):
self.assertIn("merged_standalone_set(", source)
self.assertNotIn("set().union(*(\n standalone_set(", source)
self.assertNotIn("*(standalone_set(cov", source)
if __name__ == "__main__":
unittest.main()