Configure for apitrace fails to find snappy. Reproducible: Always Steps to Reproduce: 1. emerge apitrace Actual Results: From emerge output: -- Checking for module 'snappy' -- Package 'snappy' not found ... -- Configuring done (38.4s) CMake Error at lib/trace/CMakeLists.txt:30 (target_link_libraries): Target "common" links to: Snappy::snappy but the target was not found. Possible reasons include: * There is a typo in the target name. * A find_package call is missing for an IMPORTED target. * An ALIAS target is missing. Expected Results: Successful build. app-arch/snappy-1.2.1:0/1.1::gentoo is installed. Portage 3.0.67 (python 3.12.9-final-0, default/linux/amd64/23.0/desktop/plasma/systemd, gcc-14, glibc-2.41-r1, 6.13.8 x86_64) ================================================================= System uname: Linux-6.13.8-x86_64-Intel-R-_Core-TM-_i7-6700_CPU_@_3.40GHz-with-glibc2.41 KiB Mem: 32764360 total, 11963880 free KiB Swap: 33554428 total, 33554428 free Timestamp of repository gentoo: Mon, 24 Mar 2025 09:39:50 +0000 Head commit of repository gentoo: 95524863af3d40bcd9e67dd52675bfaf1e691144 Head commit of repository kdab-overlay: d6ed3787739bb57f61583ba3e86e28bc50246259 sh bash 5.2_p37 ld GNU ld (Gentoo 2.44 p1) 2.44.0 distcc 3.4 x86_64-pc-linux-gnu [enabled] ccache version 4.11.2 [enabled] app-misc/pax-utils: 1.3.8::gentoo app-shells/bash: 5.2_p37::gentoo dev-build/autoconf: 2.13-r8::gentoo, 2.72-r1::gentoo dev-build/automake: 1.16.5-r2::gentoo, 1.17-r2::gentoo dev-build/cmake: 3.31.6-r1::gentoo dev-build/libtool: 2.5.4::gentoo dev-build/make: 4.4.1-r100::gentoo dev-build/meson: 1.7.0::gentoo dev-java/java-config: 2.3.4::gentoo dev-lang/perl: 5.40.1::gentoo dev-lang/python: 3.11.11_p2::gentoo, 3.12.9::gentoo, 3.13.2::gentoo dev-lang/rust: 1.85.1::gentoo dev-util/ccache: 4.11.2::gentoo llvm-core/clang: 19.1.7::gentoo, 20.1.1::gentoo llvm-core/lld: 19.1.7::gentoo, 20.1.1::gentoo llvm-core/llvm: 19.1.7::gentoo, 20.1.1::gentoo sys-apps/baselayout: 2.17::gentoo sys-apps/sandbox: 2.45::gentoo sys-apps/systemd: 257.3::gentoo sys-devel/binutils: 2.44::gentoo sys-devel/binutils-config: 5.5.2::gentoo sys-devel/gcc: 12.4.1_p20250227::gentoo, 13.3.1_p20250301::gentoo, 14.2.1_p20250301::gentoo sys-devel/gcc-config: 2.12.1::gentoo sys-kernel/linux-headers: 6.13::gentoo (virtual/os-headers) sys-libs/glibc: 2.41-r1::gentoo Repositories: gentoo location: /usr/portage sync-type: git sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 volatile: True sync-git-pull-extra-opts: --depth 1000 Octal location: /home/dang/work/portage masters: gentoo volatile: True RandomLAN location: /home/dang/dev/portage masters: gentoo volatile: True kdab-overlay location: /var/lib/layman/kdab-overlay sync-type: git sync-uri: https://git.randomdan.homeip.net/git/kdab masters: gentoo priority: 50 volatile: True ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="@FREE linux-fw-redistributable no-source-code vim.org MSttfEULA free-noncomm CC-Sampling-Plus-1.0 PUEL mysql_fdw" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O3 -march=skylake -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.9/conf /usr/share/themes/oxygen-gtk/gtk-2.0 /var/bind" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d" CXXFLAGS="-O3 -march=skylake -pipe" DISTDIR="/usr/portage/distfiles" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live ccache config-protect-if-modified distcc distlocks ebuild-locks fail-clean fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox strict unknown-features-warn unmerge-backup unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://portage.randomdan.homeip.net/" LANG="en_GB.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -O3 -march=native -pipe" LEX="flex" LINGUAS="en en_GB" MAKEOPTS="-j20 -l10" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/tmp" SHELL="/bin/bash" USE="X a52 acl acpi activities alsa amd64 amt autoshutdown autoupdate bash-completion bluetooth boot branding brotli btrfs bzip2 c++0x cairo caps cdda cddb cdr clamonacc clang cryptsetup cscope css curl custom-cflags custom-optimization cxx dbus declarative device-mapper dot dracut dri dts dv dvb dvd dvdr efistub encode exif fam ffmpeg firewall firmware flac fontconfig frei0r fuse gallium gcrypt gdbm gif git gles1 gles2 glib gnome-keyring gold gpm graphite graphviz grub gtk gui harfbuzz hostonly http2 hwaccel iconv icu ilt imagemagick inkjar inspector introspection ipv6 ithreads javascript jemalloc jit jpeg jpeg2k json jumbo-build kdesu kernel-install kf6compat kwallet lame lcms ldap libkms libnotify libtirpc lightning llvm lm-sensors lto lvm lz4 lzma lzo mad markdown minizip mng mp3 mp4 mpeg mpm-prefork mtp mysql ncurses network network-cron nls nohourlyupdate nscd nuv nvme odbc offensive offload ogg openconnect openexr opengl openmp opus pam pango pcre pcre-jit pcre16 pcre32 pdf perl pipewire pkcs11 plasma plymouth png policykit postgres postproc ppds profiler pulseaudio python qml qt5 qt6 readline rtmp savedconfig screencast seccomp secure-delete silc smp sndfile sound spell spi sqlite ssd ssh ssl startup-notification svg svg2 symlink syslog system-act system-av1 system-boost system-bootloader system-bootstrap system-cmark system-crontab system-ffmpeg system-harfbuzz system-heimdal system-icu system-info system-ipxe system-jpeg system-lcms system-leveldb system-libcxx system-libevent system-libs system-libvpx system-libyaml system-llvm system-lua system-lz4 system-man system-mathjax system-mesa system-mitkrb5 system-numpy system-png system-python system-qemu system-seabios system-sqlite system-ssl system-tbb system-webp system-wfconfig system-wide system-wlroots system-zlib systemd taglib test-rust theora threads thumbnail tiff truetype udev udisks uefi uki ukify unicode upower usb user-session uuid vaapi vim-pager vim-syntax virtualbox visio vlc vorbis vpx vulkan wayland webp widevine widgets winbind wxwidgets x264 xattr xcb xft xinerama xml xmp xv xvfb xvid zip zlib zstd" ABI_X86="64" ADA_TARGET="gcc_14" APACHE2_MODULES="macro actions alias allowmethods auth_basic authn_alias authn_anon authn_core authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias proxy proxy_http cache_socache cache_disk remoteip" APACHE2_MPMS="event" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="evdev joystick" KERNEL="linux" L10N="en en-GB" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby32" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Created attachment 922365 [details] build.log
> -- Checking for module 'snappy' > -- Package 'snappy' not found > -- Found Snappy: /usr/lib64/libsnappy.so Seems that pkgconfig checks snappy, I have nothing like that here.
I too get: -- Checking for module 'snappy' -- Package 'snappy' not found -- Found Snappy: /usr/lib64/libsnappy.so -- Found ZLIB: /usr/lib64/libz.so (found suitable version "1.3.1", minimum required is "1.2.6") This appears to come from the root CMakeLists.txt:526, all is well here (I was perhaps jumping the gun in my opening comment as to what was going on) CMake Error at lib/trace/CMakeLists.txt:30 (target_link_libraries): Target "common" links to: Snappy::snappy but the target was not found. Possible reasons include: * There is a typo in the target name. * A find_package call is missing for an IMPORTED target. * An ALIAS target is missing. The later error actually comes from lib/trace/CMakeLists.txt:30. Whether or not that is related to the above package 'snappy' is beyond my cmake knowledge.
Changing line 34 from Snappy::snappy to just snappy makes it "work for me", but that's me stabbing in the dark and hitting lucky.
*** Bug 951994 has been marked as a duplicate of this bug. ***
Thanks, because I still can't reproduce this error but remove "Snappy::" works here too. And it links against (call -lsnappy instead of /usr/lib64/libsnappy.so.1.2.1) I hope to find out what's going on before proposing a patch.
This only happens with USE=gui. Because then /usr/lib64/cmake/Qt6 is in CMAKE_MODULE_PATH and /usr/lib64/cmake/Qt6/FindSnappy.cmake is us. That defines Snappy::Snappy instead of Snappy::snappy. This can be mitigated by passing -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=yes via MYCMAKEARGS or by patching lib/trace/CMakeLists.txt and lib/trace/CMakeLists.txt to use Snappy::Snappy.
I have no issue with gui.
What package provides /usr/lib64/cmake/Qt6/FindSnappy.cmake ?
Thanks Paul Zander, that's qtwebengine. Dan Goodliffe, could you confirm that you have qtwebengine installed and that -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=yes does the job ?
~ qfile -v /usr/lib64/cmake/Qt6/FindSnappy.cmake dev-qt/qtwebengine-6.8.2-r1: /usr/lib64/cmake/Qt6/FindSnappy.cmake ~ git -C /usr/portage/dev-debug/apitrace/ --no-pager diff diff --git i/dev-debug/apitrace/apitrace-12.0.ebuild w/dev-debug/apitrace/apitrace-12.0.ebuild index a42ec871ba..863afb8362 100644 --- i/dev-debug/apitrace/apitrace-12.0.ebuild +++ w/dev-debug/apitrace/apitrace-12.0.ebuild @@ -66,6 +66,7 @@ src_prepare() { src_configure() { my_configure() { local mycmakeargs=( + -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=yes -DBUILD_TESTING=$(usex test) -DDOC_INSTALL_DIR="${EPREFIX}"/usr/share/doc/${PF} -DENABLE_X11=$(usex X) ~ ebuild /usr/portage/dev-debug/apitrace/apitrace-12.0.ebuild clean configure ... -- Performing Test CXX_COMPILER_FLAG_VISIBILITY -- Performing Test CXX_COMPILER_FLAG_VISIBILITY - Success -- Found ZLIB: /usr/lib64/libz.so (found suitable version "1.3.1", minimum required is "1.2.6") -- Found ZLIB: /usr/lib64/libz.so (found version "1.3.1") ... -- Build files have been written to: /tmp/portage/dev-debug/apitrace-12.0/work/apitrace-12.0_build-abi_x86_64.amd64 >>> Source configured. The reference to snappy in configure disappears completely. The compile completes successfully and links with: -ldl /usr/lib64/libsnappy.so.1.2.1
Thanks both, it breaks gtest detection now but it's a detail.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78b2a3cd052fc4cdd7201c540203dcaa5fd9c3c5 commit 78b2a3cd052fc4cdd7201c540203dcaa5fd9c3c5 Author: Nicolas PARLANT <nicolas.parlant@parhuet.fr> AuthorDate: 2025-03-25 12:52:55 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-03-25 13:50:59 +0000 dev-debug/apitrace: fix snappy detection Use config mode for find_package(Snappy) to prevent conflict with /usr/lib64/cmake/Qt6/FindSnappy.cmake provided by qtwebengine Thanks to Paul Zander <negril.nx+gentoo@gmail.com> for finding conflict. Closes: https://bugs.gentoo.org/951977 Signed-off-by: Nicolas PARLANT <nicolas.parlant@parhuet.fr> Closes: https://github.com/gentoo/gentoo/pull/41279 Signed-off-by: Sam James <sam@gentoo.org> dev-debug/apitrace/apitrace-12.0.ebuild | 1 + dev-debug/apitrace/files/apitrace-12.0-find_snappy.patch | 14 ++++++++++++++ 2 files changed, 15 insertions(+)