diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 105e41ca45f63..b893bb3f58213 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -1259,7 +1259,12 @@ def check_vendored_status(self): def parse_args(args): """Parse the command line arguments that the python script needs.""" - parser = argparse.ArgumentParser(add_help=False) + + # Pass allow_abbrev=False to remove support for inexact matches (e.g., + # `--json` turning on `--json-output`). The argument list here is partial, + # most flags are matched in the Rust bootstrap code. This prevents the the + # default ambiguity checks in argparse from functioning correctly. + parser = argparse.ArgumentParser(add_help=False, allow_abbrev=False) parser.add_argument("-h", "--help", action="store_true") parser.add_argument("--config") parser.add_argument("--build-dir") diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index f8af8f3bec031..3ae2373e1da21 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -616,4 +616,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ severity: ChangeSeverity::Warning, summary: "`x.py test --no-doc` is renamed to `--all-targets`. Additionally `--tests` is added which only executes unit and integration tests.", }, + ChangeInfo { + change_id: 154508, + severity: ChangeSeverity::Info, + summary: "`x.py` stopped accepting partial argument names. Use full names to avoid errors.", + }, ];