Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 889822 - dev-util/cmake issues after merged-usr migration
Summary: dev-util/cmake issues after merged-usr migration
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: usrmerge, usrmerge-fixes
  Show dependency tree
 
Reported: 2023-01-05 10:17 UTC by Fabio Coatti
Modified: 2023-04-13 09:43 UTC (History)
5 users (show)

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


Attachments
Build log (build.log.gz,1.47 KB, application/gzip)
2023-01-05 17:16 UTC, Fabio Coatti
Details
cmake output (CMakeOutput.log.gz,6.42 KB, application/gzip)
2023-01-05 17:16 UTC, Fabio Coatti
Details
dev-util/cmake-3.25.1 add GetRealPath to CollapseFullPath (cmake-3.25.1-realpath.patch,1.54 KB, patch)
2023-01-15 07:01 UTC, Jon Daniel
Details | Diff
[New Ebuild] dev-util/cmake-3.25.1-r1.ebuild (cmake-3.25.1-r1.ebuild,8.65 KB, text/plain)
2023-01-15 07:01 UTC, Jon Daniel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Coatti 2023-01-05 10:17:22 UTC
After moving to merged-usr I'm having troubles in compiling packages with cmake. below you can find an example, but I have many more.

I tried to use portage-9999 as it seemed that the problem was similar to bug #888543 but no success. I can share some other build logs if needed, not sure which one will be more useful. 

-- No  executable found. Can't check QT_INSTALL_PREFIX
CMake Error at /usr/share/ECM/modules/ECMQueryQt.cmake:84 (message):
  No executable found.  Can't check QT_INSTALL_PLUGINS as required
Call Stack (most recent call first):
  /usr/share/ECM/kde-modules/KDEInstallDirs5.cmake:255 (ecm_query_qt)
  /usr/share/ECM/kde-modules/KDEInstallDirs.cmake:15 (include)
  CMakeLists.txt:13 (include)


-- Configuring incomplete, errors occurred!
See also "/var/tmp/portage/kde-frameworks/threadweaver-5.101.0/work/threadweaver-5.101.0_build/CMakeFiles/CMakeOutput.log".
 * ERROR: kde-frameworks/threadweaver-5.101.0::gentoo failed (configure phase):
 *   cmake failed

Reproducible: Always




⌙➤ ls -ld /bin /sbin /usr/bin /usr/sbin /lib64 /usr/lib64
lrwxrwxrwx 1 root root      7 Dec  4 13:09 /bin -> usr/bin/
lrwxrwxrwx 1 root root      9 Dec  4 13:09 /lib64 -> usr/lib64/
lrwxrwxrwx 1 root root      7 Dec  4 13:09 /sbin -> usr/bin/
drwxr-xr-x 1 root root 112134 Jan  5 10:45 /usr/bin/
drwxrwxr-x 1 root root 215444 Jan  4 21:05 /usr/lib64/
lrwxrwxrwx 1 root root      3 Dec  4 13:09 /usr/sbin -> bin/


⌙➤ emerge --info
Portage 3.0.43 (python 3.10.9-final-0, default/linux/amd64/23.0/desktop/plasma/systemd, gcc-12, glibc-2.36-r6, 6.1.0-cova x86_64)
=================================================================
System uname: Linux-6.1.0-cova-x86_64-Intel-R-_Core-TM-_i7-6820HQ_CPU_@_2.70GHz-with-glibc2.36
KiB Mem:    65680176 total,  31354684 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Wed, 04 Jan 2023 19:17:12 +0000
Head commit of repository gentoo: 3127231b50b1108333d5db809877d27d841dc52c

sh bash 5.2_p15
ld GNU ld (Gentoo 2.39 p5) 2.39.0
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.2_p15::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.0-r1::gentoo
dev-lang/python:           3.10.9::gentoo, 3.11.1::gentoo, 3.12.0_alpha3::gentoo
dev-lang/rust:             1.65.0::gentoo
dev-util/cmake:            3.25.0::gentoo
dev-util/meson:            1.0.0::gentoo
sys-apps/baselayout:       2.9::gentoo
sys-apps/sandbox:          2.30-r1::gentoo
sys-apps/systemd:          252.4::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.39-r4::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           14.0.6-r1::gentoo, 15.0.6::gentoo
sys-devel/gcc:             12.2.1_p20221210::gentoo
sys-devel/gcc-config:      2.9::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             15.0.6::gentoo
sys-devel/llvm:            14.0.6-r2::gentoo, 15.0.6::gentoo
sys-devel/make:            4.4::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git
    priority: -1000
    volatile: True
    sync-git-verify-commit-signature: yes

kde
    location: /var/lib/layman/kde
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/proj/kde.git
    masters: gentoo
    priority: 50
    volatile: True

nix-guix
    location: /var/lib/layman/nix-guix
    sync-type: laymansync
    sync-uri: https://github.com/trofi/nix-guix-gentoo.git
    masters: gentoo
    priority: 50
    volatile: True

local
    location: /usr/overlay
    masters: gentoo
    priority: 51
    volatile: True

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -flto=4 -fuse-linker-plugin -pipe -fpie -fpic -fstack-protector-strong -fstack-clash-protection"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/sddm/scripts/Xsetup"
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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -flto=4 -fuse-linker-plugin -pipe -fpie -fpic -fstack-protector-strong -fstack-clash-protection"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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 clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/"
LANG="en_IE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -march=native -O3 -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -flto=4 -fuse-linker-plugin -pipe -fpie -fpic -fstack-protector-strong -fstack-clash-protection -Wl,--as-needed -Wl,--hash-style=gnu"
LEX="flex"
LINGUAS="en it de"
MAKEOPTS="-j4"
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="/var/tmp"
RUSTFLAGS="-C target-cpu=native"
SHELL="/bin/bash"
USE="3dnow 3dnowext 3dnowprefetch X \ a52 aac aalib acl acpi activities aim alsa amd64 apng appstream ares asf ati audio audiofile avahi bash-completion bidi bl bluetooth branding bri bzip2 cairo caps cdda cdr cjk crypt cups curl dba dbus declarative device-mapper dga divx divx4linux dri dts dv dvb dvd dvdr dvdread eap-sim edl egl encode ethereal evdev exif expat faad fam fame fbcon ffmpeg fftw flac force-cgi-redirect fortran ftp gallium garmin gd gdbm gif gimp gmedia gmp gnutls gphoto2 gpm gps gsm gtk gui h264 h323 iconv icq icu idn ifp ilbc imagemagick imap innodb ipod iproute2 ipv6 ithreads jabber java javascript joystick jpeg kde kontact kvm kwallet lastfm lcms libglvnd libnotify libtirpc libvirtd live lm_sensors lua lvm lxc lzma lzo mad maildir matroska mbox mdnsresponder-compat mhash mime mjpeg mmap mmx mmxext mng mozdevelop mozilla mp3 mp4 mpeg msn mtp multilib mysql ncurses network networkmanager new-hpcups nfsv4 njb nls nptl nptlonly offensive ofx ogg oggvorbis ogm openal openexr opengl openmp oscar pam pango parted pcap pcre pdf phonon php plasma plotutils png policykit ppds pulseaudio qemu qml qt5 readline real rtc ruby samba sasl screencast sdl seccomp semantic-desktop semantic-destkop sha512 sip slang slp smartcard sndfile snmp sound sox speex spell srt sse sse2 ssh ssl ssse3 startup-notification svg systemd tcltk telepathy test-rust theora threads tiff tk touchpad tremor truetype udev udisks unicode upower usb utempter v4l v4l2 vcd vde vhosts video videos vim-syntax virt-network virtualbox vorbis vulkan wav wayland widgets wifi wmf wmp wps wxwidgets wxwindows x264 xanim xattr xcb xface xft xine xinerama xml xosd xpm xscreensaver xsl xv xvid zeroconf zlib zpm zstd" ABI_X86="64 32" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" 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 popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="libinput wacom" KERNEL="linux" L10N="en it de en_IE" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="X86" LUA_SINGLE_TARGET="luajit" LUA_TARGETS="lua5-1 lua5-4 luajit" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby27 ruby30 ruby31" USERLAND="GNU" VIDEO_CARDS="i965 intel nvidia v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat 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, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-05 10:23:01 UTC
For completeness, can you include:
1. build.log of a package which broke (threadweaver is fine, but if you can find something "simpler", that might be useful too)
2. CMakeOutput.log as well for the same package as 1.

Thanks!
Comment 2 Fabio Coatti 2023-01-05 17:15:20 UTC
I picked kde-misc/openofficeorg-thumbnail-1.0.0-r500 that seems simple enough. Attached you can find bot files as requested.
Thanks!
Comment 3 Fabio Coatti 2023-01-05 17:16:04 UTC
Created attachment 847336 [details]
Build log
Comment 4 Fabio Coatti 2023-01-05 17:16:51 UTC
Created attachment 847338 [details]
cmake output
Comment 5 Mike Gilbert gentoo-dev 2023-01-06 18:07:55 UTC
Could you remove the word "QUIET" from line 49 of /usr/share/ECM/modules/ECMQueryQt.cmake, and retry building kde-misc/openofficeorg-thumbnail? That might provide a more useful error.

>    find_package(Qt${QT_MAJOR_VERSION}Core QUIET)
Comment 6 Fabio Coatti 2023-01-07 10:04:04 UTC
(In reply to Mike Gilbert from comment #5)
> Could you remove the word "QUIET" from line 49 of
> /usr/share/ECM/modules/ECMQueryQt.cmake, and retry building
> kde-misc/openofficeorg-thumbnail? That might provide a more useful error.
> 
> >    find_package(Qt${QT_MAJOR_VERSION}Core QUIET)

The visible difference in build is this message:

CMake Warning at /usr/share/ECM/modules/ECMQueryQt.cmake:49 (find_package):
  By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5Core", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5Core" with any
  of the following names:

    Qt5CoreConfig.cmake
    qt5core-config.cmake

  Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
  "Qt5Core_DIR" to a directory containing one of the above files.  If
  "Qt5Core" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  /usr/share/ECM/kde-modules/KDEInstallDirs5.cmake:240 (include)
  /usr/share/ECM/kde-modules/KDEInstallDirs.cmake:15 (include)
  CMakeLists.txt:11 (include)
Comment 7 Fabio Coatti 2023-01-07 10:09:00 UTC
No other differences either in build.log and cmake log. (only trivial temp files names)
Comment 8 Mike Gilbert gentoo-dev 2023-01-07 17:00:49 UTC
Does /usr/lib64/cmake/Qt5Core/Qt5CoreConfig.cmake exist on your system?

It should be provided by dev-qt/qtcore:5.
Comment 9 Mike Gilbert gentoo-dev 2023-01-07 17:06:03 UTC
Also, you have a 23.0 profile selected.
You should know that 23.0 is NOT ready for general use.
Comment 10 Fabio Coatti 2023-01-08 09:34:38 UTC
(In reply to Mike Gilbert from comment #8)
> Does /usr/lib64/cmake/Qt5Core/Qt5CoreConfig.cmake exist on your system?
> 
> It should be provided by dev-qt/qtcore:5.

⌙➤ ls -la  /usr/lib64/cmake/Qt5Core/Qt5CoreConfig.cmake
-rw-r--r-- 1 root root 11207 Dec 20 10:31 /usr/lib64/cmake/Qt5Core/Qt5CoreConfig.cmake

Now I'm re emerging qtcore just in case, but the file is there.

> Also, you have a 23.0 profile selected.
> You should know that 23.0 is NOT ready for general use.

yep, I'm not complaining about this issue, I'm just trying to figure out what is going on, if this could help others to run in the same issue
Comment 11 Fabio Coatti 2023-01-08 12:00:00 UTC
If it could be useful, in a package (sys-fs/cryfs) requiring boost i get this error:

-- Found Threads: TRUE
-- Boost will be dynamically linked
CMake Error at /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake:141 (find_package):
  Found package configuration file:

    /usr/lib/cmake/boost_filesystem-1.81.0/boost_filesystem-config.cmake

  but it set boost_filesystem_FOUND to FALSE so package "boost_filesystem" is
  considered to be NOT FOUND.  Reason given by package:

  No suitable build variant has been found.

  The following variants have been tried and rejected:

  * libboost_filesystem.so.1.81.0 (32 bit, need 64)

Call Stack (most recent call first):
  /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake:262 (boost_find_component)
  /usr/share/cmake/Modules/FindBoost.cmake:594 (find_package)
  cmake-utils/utils.cmake:119 (find_package)
  src/cpp-utils/CMakeLists.txt:98 (target_add_boost)

Apparently, it seems another effect of the same issue
Comment 12 Mike Gilbert gentoo-dev 2023-01-09 17:37:19 UTC
It seems like cmake is ignoring /usr/lib64/cmake and is looking in /usr/lib/cmake instead. I'm not sure what would cause that, but I don't think it is directly related to the usr merge.
Comment 13 Fabio Coatti 2023-01-09 20:09:13 UTC
(In reply to Mike Gilbert from comment #12)
> It seems like cmake is ignoring /usr/lib64/cmake and is looking in
> /usr/lib/cmake instead. I'm not sure what would cause that, but I don't
> think it is directly related to the usr merge.

I can't argue with that, but if this is the case I wonder what change triggered this behavior and more importantly how can it be fixed.

Could it be that the search is done in lexicographic order and the changes affected that? Just a stab in the dark, admittedly.
Comment 14 Fabio Coatti 2023-01-10 20:15:16 UTC
In the meantime, I found a way around this issue by forcing the prefix for cmake:

export CMAKE_PREFIX_PATH=/usr/lib64/cmake ; emerge [...]

This allows the compilation to complete.
Comment 15 Mike Gilbert gentoo-dev 2023-01-10 21:56:34 UTC
(In reply to Fabio Coatti from comment #14)

Interesting. It might be worth doing something like that in cmake.eclass.
Comment 16 Jon Daniel 2023-01-15 06:59:57 UTC
I can confirm this issue and resolved it by add GetRealPath to FullPathCollapse in cmake
Comment 17 Jon Daniel 2023-01-15 07:01:07 UTC
Created attachment 848549 [details, diff]
dev-util/cmake-3.25.1 add GetRealPath to CollapseFullPath
Comment 18 Jon Daniel 2023-01-15 07:01:35 UTC
Created attachment 848551 [details]
[New Ebuild] dev-util/cmake-3.25.1-r1.ebuild
Comment 19 Jon Daniel 2023-01-15 07:04:38 UTC
See Also: https://bugs.gentoo.org/889822
Comment 20 Fabio Coatti 2023-01-15 14:03:57 UTC
I just tried and the reported issue is indeed solved, as I can avoid to use export CMAKE_PREFIX_PATH=/usr/lib64/cmake ; emerge [...]

However, now I end up in this situation:

r/cmCursesPathWidget.cxx.o CMakeFiles/ccmake.dir/cmCursesStringWidget.cxx.o CMakeFiles/ccmake.dir/cmCursesWidget.cxx.o -o ../../bin/ccmake  ../../libCMakeLib.a /usr/lib/libform.so /usr/lib/libncurses.so /usr/lib/libtinfo.so ../../libcmstd.a ../../libcmsys.a -ldl /usr/lib64/libcurl.so /usr/lib64/libexpat.so /usr/lib64/libjsoncpp.so /usr/lib/libarchive.so /usr/lib/librhash.so /usr/lib64/libuv.so /usr/lib/libz.so
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/libform.so: error adding symbols: file in wrong format

Basically cmake finds the wrong lib (32) instead of the right one. Looking at the checks performed to find libs, it seems that the check fails with 32bit libs but the failure is not detected and lib it is used.
I'm not sure if this can be considered the same bug or another one, hence I'm not sure if it is better to open another bug or provide details here.
Comment 21 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-15 14:05:24 UTC
(In reply to Jon Daniel from comment #17)
> Created attachment 848549 [details, diff] [details, diff]
> dev-util/cmake-3.25.1 add GetRealPath to CollapseFullPath

Could you send this upstream at https://gitlab.kitware.com/cmake/cmake?
Comment 22 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-18 10:27:49 UTC
It'd be really helpful if you could try replicate this in a clean chroot (extract to /tmp or some other temp. location) and figure out steps to make it happen again.
Comment 23 Fabio Coatti 2023-02-18 12:07:02 UTC
(In reply to Sam James from comment #22)
> It'd be really helpful if you could try replicate this in a clean chroot
> (extract to /tmp or some other temp. location) and figure out steps to make
> it happen again.

Will try to do that. In the meanwhile, I fiddled around with cmake.eclass and I was able to have llvm/lld and other cmake based packages to compile. 
As you may see, it is some "hack&pray" approach, with debug lines sprinkled around and an llvm hardcoded path. In any way, this stuff allowed me to get to the bottom of compilation, barring the case of firefox ( bug #894452 )that is not using the eclass apparently:
        if [[ "${ARCH}" == amd64 ]]; then
                einfo "Current ABI ${ABI}"
                if [[ "${ABI}" == "amd64" ]]; then
                        sed -i '/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX/d' "${common_config}"
                        sed -i '/CMAKE_PREFIX_PATH/d' "${common_config}"
                        echo 'set(CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX '"64"' CACHE STRING "library search suffix" FORCE)' >> "${common_config}" || die
                        echo 'set(CMAKE_PREFIX_PATH "/usr/lib64/cmake" CACHE STRING "" FORCE)' >> "${common_config}" || die
                        export CMAKE_PREFIX_PATH=/usr/lib64/cmake
                        export LLVM_DIR=/usr/lib/llvm/15/lib64/cmake/llvm
                        ewarn "$(env)"
                        einfo "ABI 64 TRIGGERED"
                elif [[ "${ABI}" == "x86" ]]; then
                        sed -i '/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX/d' "${common_config}"
                        sed -i '/CMAKE_PREFIX_PATH/d' "${common_config}"
                        echo 'set(CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX '""' CACHE STRING "library search suffix" FORCE)' >> "${common_config}" || die
                        echo 'set(CMAKE_PREFIX_PATH "/usr/lib/cmake" CACHE STRING "" FORCE)' >> "${common_config}" || die
                        ewarn "$(env)"
                        einfo "ABI 32 TRIGGERED"
                else
                        eerror "ABI ${ABI} UNEXPECTED"
                fi
        fi

(I know, ugly, but again it's just poking around)
Comment 24 Fabio Coatti 2023-02-20 13:03:54 UTC
I finally got to the bottom (more or less of this issue). Basically it seems that I had some old/weird stuff, probably old configuration leftovers that apparently confused cmake modules, thus preventing a proper libs detection. Cmake itself was not providing enough details to spot the issue (or I was not good enough in spotting it, more likely).
I got it fixed when I decided to run thru basically all /etc/ files and removing anything not understandable as recent or meaningful config.
After that and after a "env-update" things started to behave properly.

Sorry for the noise.. at least this could be a reminder for the future: "cmake is a beast to manage with care :) "