MantisBT - CMake | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0015599 | CMake | CTest | public | 2015-06-01 05:35 | 2016-06-10 14:31 |
| Reporter | trsystran | ||||
| Assigned To | Kitware Robot | ||||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | moved | ||
| Platform | OS | OS Version | |||
| Product Version | CMake 3.2.2 | ||||
| Target Version | Fixed in Version | ||||
| Summary | 0015599: CTEST_USE_LAUNCHERS drops diagnostics generated by the build tool | ||||
| Description | When the build command fails (returns a non-zero return code), CTest creates a ~fake warning in cmCTestBuildHandler::RunMakeCommand: "this->ErrorsAndWarnings.push_back(errorwarning);". (Sub-question: Why is it a Warning and not an Error? all non-zero return code should be errors) Then, normally the "ErrorsAndWarnings" object is parsed and converted to "Build.xml" in cmCTestBuildHandler::GenerateXMLLogScraped. However, when CTest is run with Launchers enabled, then GenerateXMLLogScraped is never called: cmCTestBuildHandler::GenerateXMLLaunched is called instead, using a different source of information for errors and warnings: the xml files generated by ctest in launcher mode. This means that the build return code value is ignored. Why is it an issue when we have launchers? Because launchers only catch build errors as they wrap the compiler command. If the generator fails early (ie before executing any build command), then the ctest launchers won't catch anything here. It happens with the Ninja generator, when we import an external lib, but forcing an invalid path to the lib. | ||||
| Steps To Reproduce | $ cmake . -G Ninja -DCTEST_USE_LAUNCHERS=ON $ ninja ninja: error: '/invalid/path/to/libmissingLib.so', needed by 'executableFailed', missing and no known rule to make it No call to ctest in launcher mode confirmed with "strace -f ninja |& grep ctest". When launched via a real ctest flow: Build project MakeCommand:ninja -k0 -l34 all Run command: "ninja" "-k0" "-l34" "all" Each symbol represents 1024 bytes of output. .ninja: error: '/invalid/path/to/libmissingLib.so', needed by 'executableFailed', missing and no known rule to make it Size of output: 0K Command exited with the value: 1 MakeCommand:ninja -k0 -l34 all Error(s) when building project 0 Compiler errors 1 Compiler warnings But the Build.xml has no error nor warning: no issue is pushed to cdash. | ||||
| Additional Information | There are probably many other cases of early generator failure (for example if a source file goes missing between cmake configuration and build), at least with Ninja. | ||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | https://public.kitware.com/Bug/file/5466/CMakeLists.txt https://public.kitware.com/Bug/file/5467/main.c | ||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2015-06-01 05:35 | trsystran | New Issue | |||
| 2015-06-01 05:35 | trsystran | File Added: CMakeLists.txt | |||
| 2015-06-01 05:35 | trsystran | File Added: main.c | |||
| 2015-06-01 09:07 | Brad King | Assigned To | => Zack Galbreath | ||
| 2015-06-01 09:07 | Brad King | Status | new => assigned | ||
| 2015-06-04 09:59 | Brad King | Target Version | => CMake 3.4 | ||
| 2015-07-30 11:28 | Brad King | Assigned To | Zack Galbreath => | ||
| 2015-07-30 11:28 | Brad King | Status | assigned => backlog | ||
| 2015-07-30 11:28 | Brad King | Target Version | CMake 3.4 => | ||
| 2015-07-30 11:28 | Brad King | Summary | CTest with launchers drops warning generated by early build command failure => CTEST_USE_LAUNCHERS drops diagnostics generated by the build tool | ||
| 2015-07-30 11:32 | Brad King | Note Added: 0039198 | |||
| 2016-06-10 14:29 | Kitware Robot | Note Added: 0042788 | |||
| 2016-06-10 14:29 | Kitware Robot | Status | backlog => resolved | ||
| 2016-06-10 14:29 | Kitware Robot | Resolution | open => moved | ||
| 2016-06-10 14:29 | Kitware Robot | Assigned To | => Kitware Robot | ||
| 2016-06-10 14:31 | Kitware Robot | Status | resolved => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||