Skip to content

Add --build-tool-options to pass options to make/ninja/etc. #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add --build-tool-options to pass options to make/ninja/etc.
7688741
stopped us always using make but in the process removed the "-k" flag.

This flag causes make to carry on even when some targets fail. This is
very important for running the test suite in CI. Without it, a single
build failure marks thousands of subsequent programs as missing, as if
they too had failed to compile.

If I deliberately break a single source test the results currently are:
```
Total Discovered Tests: 3424
  Passed            :  378 (11.04%)
  Executable Missing: 3046 (88.96%)
Import succeeded.
```
This is what they should be:
```
Executable Missing Tests (1):
  test-suite :: SingleSource/UnitTests/2003-04-22-Switch.test

Total Discovered Tests: 3424
  Passed            : 3423 (99.97%)
  Executable Missing:    1 (0.03%)
Import succeeded.
```

cmake --build does not have its own -k option, so we have to pass it
after -- to the native tool. Unfortunately ninja's -k takes a number,
so ninja -k 0 is equivalent to make -k. Therefore we can't just
always add "-- -k" here.

Instead I've added a new option --build-tool-options where you can
pass any arguments you want. The build bots will use this to pass
"-k" to make, as we know for sure they use make.

Anything using ninja will also want to pass "-k 0" to get the same
effect.
  • Loading branch information
DavidSpickett committed Aug 14, 2024
commit e9839fe82f152adce8f8a5026df607deae0c2a67
6 changes: 5 additions & 1 deletion lnt/tests/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,8 @@ def _build(self, path):
'--build', '.',
'-t', target,
'-j', str(self._build_threads())] +
([] if self.opts.succinct else ["-v"]),
([] if self.opts.succinct else ["-v"]) +
["--"] + 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
Expand Down Expand Up @@ -1168,6 +1169,9 @@ 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",
help="Options to pass to the build tool (ninja/make/etc.).",
type=click.UNPROCESSED)
@click.option("--use-lit", "lit", metavar="PATH", type=click.UNPROCESSED,
default="llvm-lit",
help="Path to the LIT test runner [llvm-lit]")
Expand Down