Bug 315130

Summary: Fix run-minibrowser/run-swiftbrowser crash on argparse 'const' kwarg
Product: WebKit Reporter: zak ridouh <zakr>
Component: Tools / TestsAssignee: zak ridouh <zakr>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

zak ridouh
Reported 2026-05-19 15:48:51 PDT
run-minibrowser and run-swiftbrowser translate each optparse Option from configuration_options() / platform_options() into an argparse add_argument() call, and were unconditionally forwarding const=option.const. That worked while every option used action='store' or 'store_const' (both accept const), but 313522@main added --cmake with action='store_true'. argparse's _StoreTrueAction.__init__ does not accept a const keyword, so the loop now raises: TypeError: __init__() got an unexpected keyword argument 'const' before the parser is even built, breaking both scripts at startup. Only forward const= for the actions that accept it (store_const, append_const). All other options keep their previous behavior.
Attachments
Radar WebKit Bug Importer
Comment 1 2026-05-19 15:48:57 PDT
zak ridouh
Comment 2 2026-05-19 15:54:49 PDT
EWS
Comment 3 2026-05-19 16:01:32 PDT
Committed 313527@main (85a8efec82da): <https://commits.webkit.org/313527@main> Reviewed commits have been landed. Closing PR #65228 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.