View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014121CMakeCMakepublic2013-04-29 16:512013-10-31 10:24
ReporterNils Gladitz 
Assigned ToRobert Maynard 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionCMake 2.8.12Fixed in VersionCMake 3.0 
Summary0014121: Custom command errors are hidden when CTest launchers are used with Ninja
DescriptionI couldn't get any build errors from custom commands on my CDash dashboard when using Ninja with CTest launchers.

Neither are there errors from custom commands with failure exit status nor from those with output matched by CTEST_CUSTOM_ERROR_MATCH.
Steps To ReproduceI've set up a test project for which I tested make and ninja with and without launchers.

CTEST_CUSTOM_ERROR_MATCH is set to "FooBar".

The project contains three custom commands with the following outputs and exit codes:

    CustomCommand1: "this is a FooBar message" (exit success)
    CustomCommand2: "this is a fatal error" (exit failure)
    CustomCommand3: "this is a FooBar fatal error" (exit failure)
    
These are the results that I got (numbers in braces indicate which custom commands produce output visible on CDash):

    Ninja (Launchers enabled): 0 Build Errors
    Ninja (Launchers disabled): 4 Build Errors (1, 2, 3)

    Unix Makefiles (Launchers enabled): 2 Build Errors (2, 3)
    Unix Makefiles (Launchers disabled): 4 Build Errors (1, 2, 3)
    
CTEST_CUSTOM_ERROR_MATCH seems to only work with launchers disabled with Makefiles as well so I assume this is by design (though unexpected).

At the very least the exit status in the Ninja + Launchers case should be evaluated as it is with Makefiles.
TagsNo tags attached.
Attached Filesgz file icon issue_14121.tar.gz [^] (874 bytes) 2013-04-29 16:56
patch file icon 0001-run-custom-commands-through-launcher-if-available.patch [^] (2,755 bytes) 2013-05-04 09:05 [Show Content]

 Relationships

  Notes
(0032962)
Nils Gladitz (developer)
2013-04-29 16:58

I've uploaded a slightly cleaned up (removed server info from CTestConfig.cmake) version of my test project: issue_14121.tar.gz.
(0032970)
Nils Gladitz (developer)
2013-05-04 03:34

I traced through Ninja CTest runs and apparently the custom commands are run without the launcher.

CMake defines three global properties RULE_LAUNCH_COMPILE, RULE_LAUNCH_LINK and RULE_LAUNCH_CUSTOM.

Only the first two seem to actually get referenced from the Ninja generator source files.
(0032971)
Nils Gladitz (developer)
2013-05-04 09:15

With the patch I attached I tried to mimic (read copy&paste) the custom command launcher logic from the makefile generator.

The makefile generator appears to produce distinct rules for the same custom command if it is attached to multiple targets.
For the same case in Ninja there seems to be only a single rule.
Because of this I didn't know how to properly fill the target and left it empty.

This results in <TARGET_NAME> expanding to "TARGET_NAME" and I'm not sure what the consequences of that are exactly.

At the very least my custom command errors (at least those with non-success exit status) are no longer hidden.
(0034298)
Nils Gladitz (developer)
2013-10-31 10:24

Fixed by http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4fcb97eaac5de1cdd4adc86ac757ce68b37c9858 [^]

 Issue History
Date Modified Username Field Change
2013-04-29 16:51 Nils Gladitz New Issue
2013-04-29 16:56 Nils Gladitz File Added: issue_14121.tar.gz
2013-04-29 16:58 Nils Gladitz Note Added: 0032962
2013-05-04 03:34 Nils Gladitz Note Added: 0032970
2013-05-04 09:05 Nils Gladitz File Added: 0001-run-custom-commands-through-launcher-if-available.patch
2013-05-04 09:15 Nils Gladitz Note Added: 0032971
2013-06-03 14:18 Robert Maynard Assigned To => Robert Maynard
2013-06-03 14:18 Robert Maynard Status new => assigned
2013-06-03 14:37 Robert Maynard Target Version => CMake 2.8.12
2013-10-31 10:24 Nils Gladitz Note Added: 0034298
2013-10-31 10:24 Nils Gladitz Status assigned => resolved
2013-10-31 10:24 Nils Gladitz Fixed in Version => CMake 3.0
2013-10-31 10:24 Nils Gladitz Resolution open => fixed
2013-10-31 10:24 Nils Gladitz Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team