fix: say a platform has no hardware targets

The error named platforms/targets/<name>.yml, which read as a file
missing from the repository (finding 63).
This commit is contained in:
Abdessamad Derraz committed 2026-11-05 11:42:46 +01:00
1 parent f3fe6f58b4
commit 609710e2d7
2 files changed
+27 -4

No files matched your search

+8 -1
View File
@@ -664,8 +664,15 @@ def load_target_config(
targets_dir = os.path.join(platforms_dir, "targets")
target_file = os.path.join(targets_dir, f"{platform_name}.yml")
if not os.path.exists(target_file):
# The expected state for a platform that ships one build, said as
# such: the file path read like a file missing from the repository.
with_targets = sorted(
Path(f).stem for f in os.listdir(targets_dir)
if f.endswith(".yml") and not f.startswith("_")
)
raise FileNotFoundError(
f"No target config for platform '{platform_name}': {target_file}"
f"{platform_name} has no hardware targets: drop --target "
f"(platforms with targets: {', '.join(with_targets)})"
)
with open(target_file) as f:
data = yaml_load(f) or {}