View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015599CMakeCTestpublic2015-06-01 05:352016-06-10 14:31
Reportertrsystran 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake 3.2.2 
Target VersionFixed in Version 
Summary0015599: CTEST_USE_LAUNCHERS drops diagnostics generated by the build tool
DescriptionWhen 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 InformationThere 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.
TagsNo tags attached.
Attached Filestxt file icon CMakeLists.txt [^] (278 bytes) 2015-06-01 05:35 [Show Content]
c file icon main.c [^] (48 bytes) 2015-06-01 05:35

 Relationships

  Notes
(0039198)
Brad King (manager)
2015-07-30 11:32

This may be challenging to address because in order to report diagnostics from the build tool we need to scrape its output, but the output also contains the diagnostics that are captured by the launchers. In the case of ExternalProject the custom commands used to drive external build tools are scraped by the launchers too, so even trying to filter on tools-specific output like "ninja:" may not work reliably.
(0042788)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 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


Copyright © 2000 - 2018 MantisBT Team