Bug 407347 - 4.2 alpha fails to build with -GNinja
Summary: 4.2 alpha fails to build with -GNinja
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-08 20:01 UTC by Peter Eszlari
Modified: 2019-06-05 16:00 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Eszlari 2019-05-08 20:01:08 UTC
-- Configuring done
-- Generating done
-- Build files have been written to: /run/build/krita/_flatpak_build
ninja: error: build.ninja:63856: multiple rules generate cmake_object_order_depends_target_KisMaskGeneratorBenchmark [-w dupbuild=err]
Comment 1 Halla Rempt 2019-05-08 20:02:01 UTC
That is possible... But please do supply a patch, since I've got no idea about ninja!
Comment 2 Peter Eszlari 2019-05-08 21:05:26 UTC
Any reason, why you're not using ninja? It's much faster than GNU make, especially for incremental builds.
Comment 3 Halla Rempt 2019-05-09 07:58:10 UTC
But it's much harder to diagnose errors when things go wrong, and harder to build individual targets -- at least, last time I tried it.
Comment 4 Halla Rempt 2019-05-10 15:14:21 UTC
Okay, I've installed ninja and tried a ninja build. The commandline feedback still isn't much, but I don't have any build problems. I'm also not sure why, for the flatpak, you're building the benchmarks :-)
Comment 5 Peter Eszlari 2019-05-10 16:22:47 UTC
(In reply to Boudewijn Rempt from comment #4)
> Okay, I've installed ninja and tried a ninja build. The commandline feedback
> still isn't much, but I don't have any build problems. I'm also not sure
> why, for the flatpak, you're building the benchmarks :-)

Even when using:

-DENABLE_TESTING=OFF
-DBUILD_TESTING=OFF
-DKDE_SKIP_TEST_SETTINGS=ON

...configure fails. How do I disable building the benchmarks?

What's you cmake / ninja version?

mine: cmake 3.13.4 / ninja 1.9.0
Comment 6 Halla Rempt 2019-05-11 08:11:12 UTC
-DBUILD_TESTING=OFF is all that's needed for me to disable the tests. As for the benchmarks, I just checked and they built fine for me.
Comment 7 Halla Rempt 2019-05-16 10:34:16 UTC
ninja 1.8.2, cmake 3.10.2
Comment 8 Halla Rempt 2019-06-05 12:55:49 UTC
Oh, I also made sure the benchmarks are now disabled if the tests are disabled. Do you still have this problem with current 4.2.1?
Comment 9 Peter Eszlari 2019-06-05 14:43:00 UTC
With -DBUILD_TESTING=OFF it works.

It also works when I run ninja 1.9 with

$ ninja -w dupbuild=warn

If you run ninja 1.8 with

$ ninja -w dupbuild=err

it should also fail for your.

They changed that warning into an error:
https://github.com/ninja-build/ninja/pull/1406

I tested this also with ninja git master and cmake 3.14.5, so the problem seems to be in Krita's cmake file.
Comment 10 Halla Rempt 2019-06-05 16:00:53 UTC
Git commit e881acd192e3b160dde34b67b930b80c0153ab8f by Boudewijn Rempt.
Committed on 05/06/2019 at 15:59.
Pushed by rempt into branch 'master'.

Rename KisMaskGeneratorBenchmark to Test

This apparently fixes an issue with duplicate targets that Ninja
has decided to error out on.

M  +1    -1    libs/image/tests/CMakeLists.txt
R  +28   -28   libs/image/tests/KisMaskGeneratorTest.cpp [from: libs/image/tests/KisMaskGeneratorBenchmark.cpp - 071% similarity]
R  +1    -1    libs/image/tests/KisMaskGeneratorTest.h [from: libs/image/tests/KisMaskGeneratorBenchmark.h - 096% similarity]

https://invent.kde.org/kde/krita/commit/e881acd192e3b160dde34b67b930b80c0153ab8f