-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add --build-tool-options to pass options to make/ninja/etc. #25
Conversation
llvm@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.
First spotted by @antmox a few weeks ago. And while I have your attention @lukel97 , thanks for getting LNT working on Python 3.12. This has unblocked some work Linaro wanted to do. Also we'd been thinking about switching to ninja for test suites but never got around to it, so we're on board with the changes overall. Just need to fix this for build bot purposes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, good catch. Sounds like this really is the default behaviour we want but looks like there's no good way of specifying this via CMake.
We could call it out in the documentation, is there a good place for that? I'm not familiar with LNT's docs. |
I think https://llvm.org/docs/lnt/quickstart.html#running-tests, I'll update the PR tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs look good too
When llvm/llvm-lnt@7688741 enabled using Ninja, it removed the -k flag from make. -k causes make to carry on if there's a build failure. Without this flag, a single compilation failure turns into thousands of missing executables in the final results. As subsequent targets are not built. llvm/llvm-lnt#25 is adding an option to the lnt runner to pass options to the build tool. This PR uses that to pass -k to make to restore the old behaviour on the build bots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
This looks good. I have also updated llvm/llvm-zorg#245 |
When llvm/llvm-lnt@7688741 enabled using Ninja, it removed the -k flag from make. -k causes make to carry on if there's a build failure. Without this flag, a single compilation failure turns into thousands of missing executables in the final results. As subsequent targets are not built. llvm/llvm-lnt#25 is adding an option to the lnt runner to pass options to the build tool. This PR uses that to pass -k to make to restore the old behaviour on the build bots.
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:
This is what they should be:
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.