fix: publish target aliases and refuse an unknown one

The pack builder accepts the aliases declared in the target overrides,
so --target switch works there, but the installer's target manifests
carried only canonical names. The documented word was the one that
failed, and the installer then carried on with every file: 1911 files
and 4.1 GB where the user had asked for the 863 that target needs.

Aliases are emitted beside their canonical target, and an unknown
target now stops the run and lists what is available. A filter is
applied or refused, never ignored.
This commit is contained in:
Abdessamad Derraz committed 2026-08-12 06:13:21 +02:00
1 parent 97f7cc1738
commit 34619c778f
6 files changed
+1406 -3

No files matched your search

+16 -1
View File
@@ -1336,7 +1336,22 @@ def main() -> None:
targets = fetch_targets(plat_name)
target_info = targets.get(args.target)
if target_info is None:
print(f" Warning: target '{args.target}' not found for {plat_name}")
# Carrying on would install every file, which is the opposite
# of what a filter was asked for: a 4 GB download instead of
# the subset the target needs. Refuse rather than ignore.
print(
f"Error: unknown target '{args.target}' for {plat_name}.",
file=sys.stderr,
)
if targets:
print(
f" available: {', '.join(sorted(targets))}", file=sys.stderr
)
else:
print(
f" {plat_name} publishes no target list", file=sys.stderr
)
sys.exit(1)
elif target_info.get("cores") is None:
print(
f" Target '{args.target}' publishes no core list; "