fix: refuse a target no platform has

With --all, an unknown --target skipped every platform that has targets and ran the others (BizHawk, MiSTer) unfiltered, so verify, slots and the pipeline exited 0 on a typo. A platform without targets is now left out like the rest, and a target no platform has is refused.
This commit is contained in:
Abdessamad Derraz committed 2026-10-20 03:27:41 +02:00
1 parent c7c2f260f3
commit 7edd438af1
3 files changed
+38 -10

No files matched your search

+9 -3
View File
@@ -2609,6 +2609,10 @@ def build_target_cores_cache(
"""Build target cores cache for a list of platforms.
Returns (cache dict, list of platforms to keep after skipping failures).
A platform without a targets file cannot honour the target and is left
out with the others, never run unfiltered, and a target no platform knows
is refused: `--all --target swtich` checked BizHawk and MiSTer whole and
exited 0, a green run that said nothing about the Switch.
"""
cache: dict[str, set[str] | None] = {}
skip: list[str] = []
@@ -2616,10 +2620,10 @@ def build_target_cores_cache(
try:
cache[p] = load_target_config(p, target, platforms_dir)
except FileNotFoundError:
if is_all:
cache[p] = None
else:
if not is_all:
raise
print(f"INFO: Skipping {p}: no hardware targets")
skip.append(p)
except ValueError as e:
if is_all:
print(f"INFO: Skipping {p}: {e}")
@@ -2627,6 +2631,8 @@ def build_target_cores_cache(
else:
raise
kept = [p for p in platforms if p not in skip]
if is_all and platforms and not kept:
raise ValueError(f"unknown target '{target}': no platform has it")
return cache, kept