Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 803053 - media-gfx/darktable: dev-util/cmake-3.21.0 creates bad build.ninja
Summary: media-gfx/darktable: dev-util/cmake-3.21.0 creates bad build.ninja
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Marek Szuba (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-20 16:48 UTC by gentoobugzilla
Modified: 2021-07-21 19:45 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Darktable build.log (build.log,418.42 KB, text/x-log)
2021-07-20 16:48 UTC, gentoobugzilla
Details
emerge --info (emerge--info.txt,7.51 KB, text/plain)
2021-07-20 16:48 UTC, gentoobugzilla
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gentoobugzilla 2021-07-20 16:48:32 UTC
Created attachment 725305 [details]
Darktable build.log

Building media-gfx/darktable (versions 3.4.1 and 3.6.0) fails due to dev-util/cmake-3.21.0 creating a bad ninja.build. With dev-util/cmake-3.20.5 darktable builds fine.

The issue appears in libxcf.a LINK_FLAGS part in /var/tmp/portage/media-gfx/darktable-3.6.0/work/darktable-3.6.0_build/build.ninja:

# Link the static library bin/external/libxcf/libxcf.a

build bin/external/libxcf/libxcf.a: C_STATIC_LIBRARY_LINKER__xcf_RELWITHDEBINFO bin/external/libxcf/CMakeFiles/xcf.dir/xcf.c.o bin/external/libxcf/CM
akeFiles/xcf.dir/xcf_names.c.o
  LANGUAGE_COMPILE_FLAGS = -march=native -O3 -pipe -msse3 -Wall -Wformat -Wformat-security -Wshadow -Wtype-limits -Wvla -Wold-style-declaration -Wno-
unknown-pragmas -Wno-error=varargs -Wno-format-truncation -Wno-error=address-of-packed-member
  LINK_FLAGS = -Wl,--no-as-needed

and the build fails because LINK_FLAGS gets passed to /usr/bin/x86_64-pc-linux-gnu-ar.

My emerge --info shows LTO items but this bug reproduces with LTO configurations removed. Darktable does require a gcc built with USE flag "graphite", though.
Comment 1 gentoobugzilla 2021-07-20 16:48:56 UTC
Created attachment 725308 [details]
emerge --info
Comment 2 Marek Szuba (RETIRED) archtester gentoo-dev 2021-07-21 19:35:42 UTC
Reproduced. Looks to me like another case of problems propagating Gentoo CMake settings to a a full CMake project embedded as a dependency into another one. I say "another" because there has been at least one case like that before, in >=sci-libs/pastix-6.

It feels like this should be something we should ultimately handle on dev-util/cmake side, in the meantime however I'll apply a workaround to media-gfx/darktable.
Comment 3 Larry the Git Cow gentoo-dev 2021-07-21 19:45:12 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10f3f7f638cbe55958959df5d83597c090ba5f25

commit 10f3f7f638cbe55958959df5d83597c090ba5f25
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2021-07-21 19:37:08 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2021-07-21 19:45:05 +0000

    media-gfx/darktable: strip down compilation of bundled libxcf
    
    Needed to make cmake-3.21/ninja stop trying to pass LDFLAGS to ar.
    Since stripping src/external/libxcf/CMakeLists.txt to the bare minimum
    results in a patch about the same size as the file itself, just inject
    the necessary lines to src/external/CMakeLists.txt and ignore the one in
    libxcf.
    
    Tested on both 3.4.1 and 3.6.0, with cmake versions 3.18.5 and 3.21.0;
    all combinations seem to build fine.
    
    Closes: https://bugs.gentoo.org/803053
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 media-gfx/darktable/darktable-3.4.1.ebuild           |  1 +
 media-gfx/darktable/darktable-3.6.0.ebuild           |  1 +
 .../files/darktable-3.4.1_libxcf-cmake.patch         | 20 ++++++++++++++++++++
 3 files changed, 22 insertions(+)