From feb381609dd3b01708f2615a75f006c8875faab7 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Wed, 16 Nov 2022 22:46:36 -0500 Subject: [PATCH] mdist: fix error when running tests with a cross file Since commit 1420d0daceb10cafb52a7405f157032a5cc811a5 we use coredata's cmd_line.txt handler to get the right setup arguments. But there's a bug in that -- it mishandles cross/native files, producing invalid descriptions of the command line. The only other place this was used, though, is when generating meson-log.txt. Fix it to produce correctly formatted arguments. Fixes #10980 --- mesonbuild/coredata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 30812e35d..500dd93f4 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -1035,9 +1035,9 @@ def update_cmd_line_file(build_dir: str, options: argparse.Namespace): def format_cmd_line_options(options: argparse.Namespace) -> str: cmdline = ['-D{}={}'.format(str(k), v) for k, v in options.cmd_line_options.items()] if options.cross_file: - cmdline += [f'--cross-file {f}' for f in options.cross_file] + cmdline += [f'--cross-file={f}' for f in options.cross_file] if options.native_file: - cmdline += [f'--native-file {f}' for f in options.native_file] + cmdline += [f'--native-file={f}' for f in options.native_file] return ' '.join([shlex.quote(x) for x in cmdline]) def major_versions_differ(v1: str, v2: str) -> bool: