Remove uneeded `parse_cmd_line_options` The new way of doing things, thanks to @dcbaker, is making it so `Environment` combines the command line options and config files, and then coredata and just ingestion 1 source of raw data to initialize the actual options. This dramatically simplifies things by making information flow through one path not many. `parse_cmd_line_options` is a vestige of the old way of coredata having to crawl over a bunch of different sources of information and repeatedly parse them, and is no longer needed.
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 724e111..7b02cdb 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py
@@ -1023,24 +1023,6 @@ result[key] = value return result -def parse_cmd_line_options(args): - args.cmd_line_options = create_options_dict(args.projectoptions) - - # Merge builtin options set with --option into the dict. - for name in chain( - builtin_options.keys(), - ('build.' + k for k in builtin_options_per_machine.keys()), - builtin_options_per_machine.keys(), - ): - value = getattr(args, name, None) - if value is not None: - if name in args.cmd_line_options: - cmdline_name = BuiltinOption.argparse_name_to_arg(name) - raise MesonException( - 'Got argument {0} as both -D{0} and {1}. Pick one.'.format(name, cmdline_name)) - args.cmd_line_options[name] = value - delattr(args, name) - _U = T.TypeVar('_U', bound=UserOption[_T])
diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py index f070355..b2bc104 100644 --- a/mesonbuild/mconf.py +++ b/mesonbuild/mconf.py
@@ -243,7 +243,6 @@ print_default_values_warning() def run(options): - coredata.parse_cmd_line_options(options) builddir = os.path.abspath(os.path.realpath(options.builddir)) c = None try:
diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py index 2521511..de4600a 100644 --- a/mesonbuild/msetup.py +++ b/mesonbuild/msetup.py
@@ -240,7 +240,6 @@ raise def run(options) -> int: - coredata.parse_cmd_line_options(options) app = MesonApp(options) app.generate() return 0