Challenge for real experts: why does cmake 3.1.3 not use automoc for a certain file?
Friedrich W. H. Kossebau
kossebau at kde.org
Wed Jun 17 21:11:33 UTC 2015
Am Dienstag, 16. Juni 2015, 19:16:11 schrieb Friedrich W. H. Kossebau:
> Am Dienstag, 16. Juni 2015, 16:00:04 schrieb Friedrich W. H. Kossebau:
> > Am Montag, 8. Juni 2015, 14:52:12 schrieb Ben Cooksley:
> > > On Sat, Jun 6, 2015 at 10:07 PM, Alex Merry <alex.merry at kde.org> wrote:
> > > > On Friday 05 June 2015 00:58:30 Friedrich W. H. Kossebau wrote:
> > > >> you are a cmake and KDE buildsystem expert?
> > > >> Prove that yourself and improve the world for others ;)
> > > >
> > > > Or, indeed, work towards becoming such an expert...
> > > >
> > > >> Here is the challenge:
> > > >>
> > > >> https://build.kde.org/job/calligra%20frameworks%20kf5-qt5/PLATFORM=Li
> > > >> nu
> > > >> x,
> > > >> Var iation=All,compiler=gcc/28/consoleText
> > > >>
> > > >> CMakeFiles/KisAsyncMergerTest.dir/kis_async_merger_test.cpp.o: In
> > > >> function
> > > >> `KisAsyncMergerTest::KisAsyncMergerTest()':
> > > >> /home/jenkins/builds/calligra/kf5-
> > > >> qt5/krita/image/tests/kis_async_merger_test.h:24: undefined reference
> > > >> to
> > > >> `vtable for KisAsyncMergerTest'
> > > >> CMakeFiles/KisAsyncMergerTest.dir/kis_async_merger_test.cpp.o: In
> > > >> function
> > > >> `KisAsyncMergerTest::~KisAsyncMergerTest()':
> > > >> /home/jenkins/builds/calligra/kf5-
> > > >> qt5/krita/image/tests/kis_async_merger_test.h:24: undefined reference
> > > >> to
> > > >> `vtable for KisAsyncMergerTest'
> > > >> collect2: error: ld returned 1 exit status
> > > >> krita/image/tests/CMakeFiles/KisAsyncMergerTest.dir/build.make:89:
> > > >> recipe
> > > >> for target 'krita/image/tests/KisAsyncMergerTest' failed
> > > >>
> > > >> Right, you say, smells like automoc not run. And indeed it is not
> > > >> run.
> > > >> So
> > > >> far you are an expert.
> > > >>
> > > >> But why?
> > > >> Why does cmake on CI not want to run automoc on
> > > >> kis_async_merger_test.{h,cpp}?
> > > >>
> > > >> Locally it works fine for anyone (cmake 3.0.1/3.0.2), noone yet was
> > > >> able
> > > >> to
> > > >
> > > >> reproduce the problem, instead everyone sees:
> > > > So my first question is: what version of cmake is being run on the
> > > > build
> > > > servers? If it's not 3.0.1 or 3.0.2, then that could explain why you
> > > > can't
> > > > reproduce it locally.
> > >
> > > The CI system is using "cmake version 3.1.3" on Ubuntu Vivid (15.04).
> > > Not sure if that makes a difference.
> >
> > Seems it does make a difference 8\ ...
> >
> > With cmake version 3.0.1 (from OpenSUSE Tumbleweed package):
> > $ cd build/calligra.moment/krita/image/tests
> > $ make help | grep sync
> > ... KisAsyncMergerTest
> > ... KisAsyncMergerTest_automoc
> > ... KisAsyncMergerTest_automoc.o
> > ... KisAsyncMergerTest_automoc.i
> > ... KisAsyncMergerTest_automoc.s
> > ... kis_async_merger_test.o
> > ... kis_async_merger_test.i
> > ... kis_async_merger_test.s
> >
> > With cmake version 3.1.3 (manually compiled on my OpenSUSE Tumbleweed):
> > $ cd build/calligra.moment/krita/image/tests
> > $ make help | grep sync
> > ... KisAsyncMergerTest
> > ... kis_async_merger_test.o
> > ... kis_async_merger_test.i
> > ... kis_async_merger_test.s
> >
> > Uh? Anyone seen something similar? Any idea what could make that newer
> > cmake decide that kis_async_merger_test.* does not need automoc?
> > Putting in some #include "moc_kis_async_merger_test.cpp" also did not have
> > any effect.
> >
> > Anyone an idea for a workaround?
>
> Interesting... seems renaming the target "KisAsyncMergerTest" to something
> else, e.g. "KisAsyncMergerTest_" unbreaks this.
> Any explanation? There is no other target with that name
> "KisAsyncMergerTest".
>
> Having done that workaround, now another target is hit with the same
> problem, KisBookmarkedConfigurationManagerTest. Got the same treatment with
> _ appended, proper automoc targets now created for me locally.
>
> Currently waiting if CI finds the next problem now (not enough disk space
> left right now locally for giving a full test myself with the other cmake
> version, Calligra/Krita is too large :), so partially relying on
> build.kde.org).
>
> Could there be some hash collision or something else? There are a lot of
> targets in that CMakeLists.txt, perhaps more than someone expected...
> http://quickgit.kde.org/?p=calligra.git&a=blob&h=082747066eb6910d29a7fd3a59b
> 6b531af529e95&f=krita%2Fimage%2Ftests%2FCMakeLists.txt&o=plain
So I renamed three test build targets in a row, and everytime another test
target started failing, with automoc no longer being run. With current
"frameworks" branch build now fails on KisFilterMaskTest, due to no automoc
run.
Just tried cmake-3.3.0-rc2, and things are okay there again, builds fine with
automoc run on all files where needed.
So... what do you recommend to do? Blacklist some cmake versions and not build
the tests there? Any other workarounds possible?
Do I better contact the cmake guys directly, or is there still some KDE
contact man/woman on this list?
Cheers
Friedrich
More information about the Kde-buildsystem
mailing list