MantisBT - CMake
View Issue Details
0014394CMakeCTestpublic2013-09-10 11:202016-06-10 14:21
Vladimir Yelnikov 
 
normalmajoralways
closedfixed 
CMake 2.8.11.2 
CMake 3.6CMake 3.6 
0014394: CTest interprets "Note: No relevant classes found. No output generated." string as compilation error
CTest interprets Qt5 Moc-compiler output "Note: No relevant classes found. No output generated." as compiler error.

as a result CTest writes following output (8 moc-compiler notes) and as you can see make exited with SUCCESS code:

build 10-Sep-2013 10:09:55 Command exited with the value: 0
build 10-Sep-2013 10:09:55 MakeCommand:/usr/bin/make -i -j2
build 10-Sep-2013 10:09:55 Error(s) when building project
build 10-Sep-2013 10:09:55 8 Compiler errors
build 10-Sep-2013 10:09:55 50 or more Compiler warnings
No tags attached.
Issue History
2013-09-10 11:20Vladimir YelnikovNew Issue
2013-09-10 11:30Brad KingNote Added: 0033794
2013-09-11 04:27Vladimir YelnikovNote Added: 0033795
2013-09-11 08:07Brad KingNote Added: 0033797
2013-09-11 08:57Stephen KellyNote Added: 0033798
2013-09-11 09:13Vladimir YelnikovNote Added: 0033799
2013-09-11 09:19Brad KingNote Added: 0033800
2013-09-11 09:21Vladimir YelnikovNote Added: 0033801
2013-09-11 09:22Stephen KellyNote Added: 0033802
2013-09-11 09:28Brad KingNote Added: 0033803
2016-05-04 11:21Sean McBrideNote Added: 0041025
2016-05-05 09:03Brad KingNote Added: 0041028
2016-05-11 10:08Brad KingNote Added: 0041051
2016-05-11 10:08Brad KingStatusnew => resolved
2016-05-11 10:08Brad KingResolutionopen => fixed
2016-05-11 10:08Brad KingFixed in Version => CMake 3.6
2016-05-11 10:08Brad KingTarget Version => CMake 3.6
2016-06-10 14:21Kitware RobotNote Added: 0041176
2016-06-10 14:21Kitware RobotStatusresolved => closed

Notes
(0033794)
Brad King   
2013-09-10 11:30   
make exits with 0 because the build uses the "-i" option which says to ignore command return codes.

The CMake/CTest source tree has no mention of the string. With CTEST_USE_LAUNCHERS if the tool returns non-zero CTest will treat that as an error.
(0033795)
Vladimir Yelnikov   
2013-09-11 04:27   
We don't use CTEST_USE_LAUNCHERS. The bug looks weird for me that CTest works perfectly with Qt4 and produces error messages for Qt5.
As I understand CTest parses build output and tries to catch error messages than place '!' character to mark an error (sometimes it places mark several lines bellow required or somewhere in the mid of line because of fast console output, I guess).
We found workaround for this issue by suppressing mote messages with -nn parameter for Qt moc-compiler but sometimes it is useful to get some additional info.
(0033797)
Brad King   
2013-09-11 08:07   
The default error matching expressions are here:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/CTest/cmCTestBuildHandler.cxx;hb=v2.8.11.2#l42 [^]

I don't see one that obviously matches this output.
(0033798)
Stephen Kelly   
2013-09-11 08:57   
Please provide an SCCCE (http://sscce.org/ [^]) which fails with Qt 5 and passes with Qt 4.

Thanks,
(0033799)
Vladimir Yelnikov   
2013-09-11 09:13   
Sorry, I had to send complete line when I created the issue.
Qt5 line:
/root/bamboo-agent-home/xml-data/build-dir/path/scan_configuration.h:0: Note: No relevant classes found. No output generated.

matched by: http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/CTest/cmCTestBuildHandler.cxx;hb=v2.8.11.2#l47 [^]

Qt4 line:
/root/bamboo-agent-home/xml-data/build-dir/path/FolderDialog.h:0: Warning: No relevant classes found. No output generated.

matched by expression above and by this one as warning: http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/CTest/cmCTestBuildHandler.cxx;hb=v2.8.11.2#l131 [^]

Looks like CTest matches Qt4 line as Warning and doesn't proceed to Error regexps.
I didn't check it with debugger yet (if needed I can debug CTest later next week to be sure).

I use this online regexp checker: http://gskinner.com/RegExr/ [^]
(0033800)
Brad King   
2013-09-11 09:19   
Re 0014394:0033799: Great, thanks. It looks like the list of exceptions needs capitalized Note:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/CTest/cmCTestBuildHandler.cxx;hb=v2.8.11.2#l101 [^]
(0033801)
Vladimir Yelnikov   
2013-09-11 09:21   
Stephen Kelly, ok. I will do it on Friday.
(0033802)
Stephen Kelly   
2013-09-11 09:22   
That might not be needed if Brad already has a fix in mind.

Thanks!
(0033803)
Brad King   
2013-09-11 09:28   
Please try this patch:

diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 39eeb70..6d79583 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -104,6 +104,7 @@ static const char* cmCTestErrorExceptions[] = {
   ": warning",
   ": \\(Warning\\)",
   ": note",
+  "Note:",
   "makefile:",
   "Makefile:",
   ":[ \\t]+Where:",
(0041025)
Sean McBride   
2016-05-04 11:21   
So was this fixed? It's not clear to me from the comments here...

(We are seeing the same issue as Vladimir with a CMake 2.8.12.2 bot of ours.)
(0041028)
Brad King   
2016-05-05 09:03   
Re 0014394:0041025: No one ever responded to my request in 0014394:0033803 so this was forgotten. Does the patch work for you?
(0041051)
Brad King   
2016-05-11 10:08   
I've applied the patch from 0014394:0033803:

CTest: Do not treat "Note: ..." lines as errors
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eafe541f [^]
(0041176)
Kitware Robot   
2016-06-10 14:21   
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.