From a6d7c92900819ca6f8802863b972f45484f448e6 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 6 Nov 2026 03:29:41 +0100 Subject: [PATCH] fix: refuse --full-narrowings without full pack --- scripts/pipeline.py | 6 +++++- tests/test_audit_regressions.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/pipeline.py b/scripts/pipeline.py index 0b020810e..b8593c307 100644 --- a/scripts/pipeline.py +++ b/scripts/pipeline.py @@ -816,7 +816,7 @@ def _refuse_unapplied_flags( --all-variants builds every source itself, so a --source beside it is dropped; --skip-packs builds none, so both are, and step 5 does not run - for --full-narrowings to widen. + for --full-narrowings to widen, nor does it without a full pack. """ # --source defaults to None so a typed `--source full` is seen: compared # with its default value, it went through beside the modes that refuse it. @@ -829,6 +829,10 @@ def _refuse_unapplied_flags( ("--full-narrowings", args.full_narrowings)): if on: parser.error(f"{flag} is incompatible with --skip-packs") + # Step 5 compares the full pack, and --source platform or truth builds + # none: the comparison is skipped and the flag had no effect. + if args.full_narrowings and source_given and args.source != "full": + parser.error(f"--full-narrowings is incompatible with --source {args.source}") if args.source is None: args.source = "full" diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 5d59c03e5..fdcf30854 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -4185,6 +4185,8 @@ class EveryToolRefusesAFlagItWouldDrop(unittest.TestCase): ["--offline", "--all-variants", "--source", "platform"], ["--offline", "--all-variants", "--source", "full"], ["--offline", "--skip-packs", "--source", "full"], + ["--offline", "--source", "truth", "--full-narrowings"], + ["--offline", "--source", "platform", "--full-narrowings"], ], }