From c4dc85ffcdc7a3795ad151330cdd2ea829235a24 Mon Sep 17 00:00:00 2001 From: Antoine Moynault Date: Wed, 20 Nov 2024 11:48:50 +0000 Subject: [PATCH 1/2] Fix crash in runtest when build_tool_options is not set --- lnt/tests/test_suite.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lnt/tests/test_suite.py b/lnt/tests/test_suite.py index eb7eeecd..1754adfe 100644 --- a/lnt/tests/test_suite.py +++ b/lnt/tests/test_suite.py @@ -581,7 +581,11 @@ def _build(self, path): '-t', target, '-j', str(self._build_threads())] + ([] if self.opts.succinct else ["-v"]) + - ["--"] + shlex.split(self.opts.build_tool_options), + ( + (["--"] + shlex.split(self.opts.build_tool_options)) + if self.opts.build_tool_options + else [] + ), cwd=subdir) except subprocess.CalledProcessError: # cmake is expected to exit with code 1 if there was any build From 533a199669e07bf7bf3c566f148f2f21512c71e5 Mon Sep 17 00:00:00 2001 From: Antoine Moynault Date: Wed, 20 Nov 2024 13:28:39 +0000 Subject: [PATCH 2/2] A shorter way to fix the issue --- lnt/tests/test_suite.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lnt/tests/test_suite.py b/lnt/tests/test_suite.py index 1754adfe..97619742 100644 --- a/lnt/tests/test_suite.py +++ b/lnt/tests/test_suite.py @@ -581,11 +581,7 @@ def _build(self, path): '-t', target, '-j', str(self._build_threads())] + ([] if self.opts.succinct else ["-v"]) + - ( - (["--"] + shlex.split(self.opts.build_tool_options)) - if self.opts.build_tool_options - else [] - ), + ["--"] + shlex.split(self.opts.build_tool_options), cwd=subdir) except subprocess.CalledProcessError: # cmake is expected to exit with code 1 if there was any build @@ -1173,7 +1169,7 @@ def diagnose(self): @click.option("--use-make", "make", metavar="PATH", type=click.UNPROCESSED, help="Path to the build system tool [make/ninja/...]") -@click.option("--build-tool-options", +@click.option("--build-tool-options", default="", help="Options to pass to the build system tool", type=click.UNPROCESSED) @click.option("--use-lit", "lit", metavar="PATH", type=click.UNPROCESSED,