View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013299CMakeCMakepublic2012-06-13 16:062012-08-09 19:38
ReporterStephen Kelly 
Assigned ToAlex Neundorf 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionCMake 2.8.9Fixed in VersionCMake 2.8.9 
Summary0013299: Build should abort if moc fails
DescriptionAdd a signal which is templated (which causes moc to return an error), and run the unit test. Instead of aborting when moc notifies an error, the build fails later when attempting to include the generated file (using make -j1), as below.

As a failed moc run does not overwrite the target file, an old file can be left behind, causing even the #include to work properly, hiding the bug.
                                                   
Generating private_slot.moc
/home/stephen/dev/src/cmake/Tests/QtAutomoc/private_slot.h:15: Error: Template function as signal or slot
AUTOMOC: error: process for /home/stephen/dev/src/cmake/Tests/QtAutomoc/build/private_slot.moc failed:
/home/stephen/dev/src/cmake/Tests/QtAutomoc/private_slot.h:15: Error: Template function as signal or slot

Generating sub/moc_bar.cpp
Generating moc_xyz.cpp
Generating yaf_p.moc
Generating moc_calwidget.cpp
Generating moc_foo.cpp
returning failed..
[ 28%] Built target foo_automoc
Scanning dependencies of target foo
[ 35%] Building CXX object CMakeFiles/foo.dir/main.cpp.o
[ 42%] Building CXX object CMakeFiles/foo.dir/calwidget.cpp.o
[ 50%] Building CXX object CMakeFiles/foo.dir/foo.cpp.o
[ 57%] Building CXX object CMakeFiles/foo.dir/blub.cpp.o
[ 64%] Building CXX object CMakeFiles/foo.dir/bar.cpp.o
[ 71%] Building CXX object CMakeFiles/foo.dir/abc.cpp.o
[ 78%] Building CXX object CMakeFiles/foo.dir/xyz.cpp.o
[ 85%] Building CXX object CMakeFiles/foo.dir/yaf.cpp.o
[ 92%] Building CXX object CMakeFiles/foo.dir/private_slot.cpp.o
/home/stephen/dev/src/cmake/Tests/QtAutomoc/private_slot.cpp:21:28: fatal error: private_slot.moc: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/foo.dir/private_slot.cpp.o] Error 1
make[1]: *** [CMakeFiles/foo.dir/all] Error 2
make: *** [all] Error 2
makeobj[0]: Leaving directory `/home/stephen/dev/src/cmake/Tests/QtAutomoc/build'
Qt( 4.8 ) KDE ( )
stephen@hal:~/dev/src/cmake/Tests/QtAutomoc/build{master}$ git diff
diff --git a/Tests/QtAutomoc/private_slot.h b/Tests/QtAutomoc/private_slot.h
index 28e5448..b5177e3 100644
--- a/Tests/QtAutomoc/private_slot.h
+++ b/Tests/QtAutomoc/private_slot.h
@@ -12,6 +12,9 @@ class PrivateSlot : public QObject
 public:
   PrivateSlot(QObject *parent = 0);
 
+signals:
+ template<int> void someSignal();
+
 private:
   PrivateSlotPrivate * const d;
   Q_PRIVATE_SLOT(d, void privateSlot())
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0029690)
Rolf Eike Beer (developer)
2012-06-13 17:32

Yes please! I've seen the very same thing today in a totally unrelated project, too.
(0029696)
Alex Neundorf (developer)
2012-06-14 16:30

Merged e4a2d5f automoc: better error handling (0013299) into next, it should be better now.

 Issue History
Date Modified Username Field Change
2012-06-13 16:06 Stephen Kelly New Issue
2012-06-13 16:11 Alex Neundorf Assigned To => Alex Neundorf
2012-06-13 16:11 Alex Neundorf Status new => assigned
2012-06-13 17:32 Rolf Eike Beer Note Added: 0029690
2012-06-14 16:30 Alex Neundorf Note Added: 0029696
2012-06-14 16:30 Alex Neundorf Status assigned => closed
2012-06-14 16:30 Alex Neundorf Resolution open => fixed
2012-06-14 16:30 Alex Neundorf Description Updated
2012-08-09 19:38 David Cole Fixed in Version => CMake 2.8.9
2012-08-09 19:38 David Cole Target Version => CMake 2.8.9


Copyright © 2000 - 2018 MantisBT Team