Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 895466 - sys-libs/minizip-ng-3.0.8 - tries to find_dependency(ZLIBNG) but sys-libs/zlib-ng doesn't install cmake files
Summary: sys-libs/minizip-ng-3.0.8 - tries to find_dependency(ZLIBNG) but sys-libs/zli...
Status: UNCONFIRMED
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: 895714
  Show dependency tree
 
Reported: 2023-02-19 19:53 UTC by Bernd
Modified: 2023-02-21 11:40 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd 2023-02-19 19:53:55 UTC
The current cmake config file for minizip-ng contains at the end

(chroot-multi) # tail -n 5 /usr/lib64/cmake/minizip-ng/minizip-ng-config.cmake 
find_dependency(ZLIBNG REQUIRED)
find_dependency(BZip2 REQUIRED)
find_dependency(LibLZMA REQUIRED)
find_dependency(Iconv REQUIRED)
include("${CMAKE_CURRENT_LIST_DIR}/minizip-ng.cmake")

but current zlib-ng only provides a pkgconfig file, but no cmake files are installed. This leads to failures at configuration time for consumers of minizip-ng.

I discovered this, while working on a bump of OCIO-2.2.1, but a trivial CMakeLists.txt fails as well:

```
cmake_minimum_required(VERSION 3.24)
project(mztest LANGUAGES C VERSION 1.0)
find_package(minizip-ng REQUIRED)
```

Also tested whether unmasking the compat USE flag and build with USE=compat populates the cmake file with different dependencies, but the issue remains.

The error is
(chroot-multi) # cmake -G Ninja ..
-- The C compiler identification is GNU 12.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  By not providing "FindZLIBNG.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "ZLIBNG", but
  CMake did not find one.

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

    ZLIBNGConfig.cmake
    zlibng-config.cmake

  Add the installation prefix of "ZLIBNG" to CMAKE_PREFIX_PATH or set
  "ZLIBNG_DIR" to a directory containing one of the above files.  If "ZLIBNG"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  /usr/lib64/cmake/minizip-ng/minizip-ng-config.cmake:37 (find_dependency)
  CMakeLists.txt:7 (find_package)


-- Configuring incomplete, errors occurred!
See also "/tmp/mztest/build/CMakeFiles/CMakeOutput.log".

Reproducible: Always




Portage 3.0.44 (python 3.10.10-final-0, default/linux/amd64/17.1/systemd/merged-usr, gcc-11, glibc-2.36-r7, 6.1.12-gentoo-0 x86_64)
=================================================================
System uname: Linux-6.1.12-gentoo-0-x86_64-AMD_Ryzen_7_3800X_8-Core_Processor-with-glibc2.36
KiB Mem:    32829780 total,  16794480 free
KiB Swap:   33554428 total,  33554428 free
Head commit of repository guru: 455d4433bc5c31d26f8fcdd634d74c8bb2461504

Timestamp of repository steam-overlay: Tue, 07 Feb 2023 14:47:33 +0000
Head commit of repository steam-overlay: 8121a25bc99056e35ab2dd7924bb01ad8f80df8d

Head commit of repository qt: 89c3b54f581b42fbfab5e6f7c443255449f3a711

Head commit of repository science: 88e8521322b88f52071c7f7b1ad395627c0296cb

Head commit of repository gentoo-git: 6c6b1231149c2969230966288d4e9ac223c0d9c1

Head commit of repository waebbl: f7a973d71f0ae9dcec2cc8ed83e7b867a059d8c4

Timestamp of repository gentoo: Sun, 19 Feb 2023 06:31:57 +0000
Head commit of repository gentoo: f144337f9c5aa7f8a3edcbd98af4d2aacc6c78c7

sh bash 5.2_p15-r2
ld GNU ld (Gentoo 2.40 p2) 2.40.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r2::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.0-r2::gentoo
dev-lang/python:           3.10.10_p1::gentoo, 3.11.2_p1::gentoo
dev-lang/rust:             1.67.1::gentoo
dev-util/cmake:            3.25.2::gentoo
dev-util/meson:            1.0.0::gentoo
sys-apps/baselayout:       2.13-r1::gentoo
sys-apps/sandbox:          2.30-r1::gentoo
sys-apps/systemd:          253::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.40-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           14.0.6-r1::gentoo, 15.0.7-r1::gentoo
sys-devel/gcc:             11.3.1_p20230120-r1::gentoo, 12.2.1_p20230121-r1::gentoo
sys-devel/gcc-config:      2.10::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             15.0.7::gentoo
sys-devel/llvm:            14.0.6-r2::gentoo, 15.0.7::gentoo
sys-devel/make:            4.4::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r7::gentoo
Repositories:

guru
    location: /mnt/data/code/github/portage-overlays/guru
    sync-type: git
    sync-uri: git@git.gentoo.org:repo/proj/guru.git
    masters: gentoo
    priority: -1000
    volatile: True

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo
    volatile: True

qt
    location: /mnt/data/code/github/portage-overlays/qt
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/qt.git
    masters: gentoo
    priority: 60
    volatile: True

science
    location: /mnt/data/code/github/portage-overlays/sci
    sync-type: git
    sync-uri: git://github.com/waebbl/sci.git
    masters: gentoo
    priority: 60
    volatile: True

gentoo-git
    location: /mnt/data/code/github/portage-overlays/gentoo-git
    sync-type: git
    sync-uri: https://github.com/waebbl/gentoo.git
    masters: gentoo
    priority: 99
    volatile: True

waebbl
    location: /mnt/data/code/github/portage-overlays/waebbl
    sync-type: git
    sync-uri: https://github.com/waebbl/waebbl-gentoo.git
    masters: gentoo
    priority: 99
    volatile: True

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: 100
    volatile: True

Installed sets: @3D, @Qt6, @admin-tools, @desktop, @dev-tools, @docs, @esteam, @fonts, @games, @net-tools, @science
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=znver2 -frecord-gcc-switches"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
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="-O2 -pipe -march=znver2 -frecord-gcc-switches"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--complete-graph --keep-going --fail-clean --usepkg --buildpkg --buildpkg-exclude='x11-drivers/nvidia-drivers virtual/* acct-user/* acct-group/* app-eselect/* dev-util/nvidia-cuda-toolkit' --autounmask=n --binpkg-respect-use=y --binpkg-changed-deps=y"
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 -march=znver2 -frecord-gcc-switches"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live buildsyspkg cgroup clean-logs config-protect-if-modified distlocks downgrade-backup ebuild-locks fail-clean fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms sign split-elog split-log strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=znver2 -frecord-gcc-switches"
GENTOO_MIRRORS="https://ftp.fau.de/gentoo/ https://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/         https://ftp.halifax.rwth-aachen.de/gentoo/"
INSTALL_MASK="/usr/share/locale -/usr/share/locale/de* -/usr/share/locale/en*"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0"
LEX="flex"
MAKEOPTS="-j16"
PKGDIR="/var/cache/binpkgs"
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"
SHELL="/bin/bash"
USE="X acl alsa amd64 branding bzip2 cli crypt dbus dri egl emacs fortran gdbm gif gnome gtk-doc iconv ipv6 jpeg jpeg2k kde lcms libglvnd libinput libtirpc man multilib ncurses networkmanager nls nptl offensive ogg opengl openmp pam pcre pic png policykit pulseaudio python qml qt5 readline seccomp sound ssl svg systemd test-rust tga theora threads tiff udev unicode vorbis webp wifi x264 x265 xattr xpm zlib zstd" ABI_X86="64" 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 pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a 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="pc multiboot qemu" INPUT_DEVICES="libinput wacom" KERNEL="linux" L10N="de de-DE en en-GB en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="nlpsolver" LLVM_TARGETS="NVPTX WebAssembly" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby31" STEAMGAMES="witcher2" USERLAND="GNU" VIDEO_CARDS="dummy fbdev nvidia vesa" 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, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-19 19:56:40 UTC
I'd appreciate it if you could take a look at fixing zlib-ng, it's kind of a mess overall.
Comment 2 Bernd 2023-02-19 21:13:21 UTC
Could it be the issue is related to https://github.com/zlib-ng/minizip-ng/blob/master/CMakeLists.txt#L226-L230 in combination with our dependency on zlib-ng?

The variable MINIZIP_DEP_PKG is later (lines 736..741) used to populate the list of dependencies for minizip-config.cmake. The logic emits ZLIBNG if zlib-ng is found or if not in compat mode, else ZLIB is emitted. If I build with USE=compat and remove zlib-ng prior to configuring the package, I verified that it emits find_dependency(ZLIB REQUIRED) instead of find_dependency(ZLIBNG REQUIRED). Even without USE=compat but zlib-ng not installed, it emits ZLIB, although I'm not sure yet why that's the case.

So far, I'd say we should possibly drop the zlib-ng dep for now and only add it in as an any-of-depencency with zlib once it's ready to be replaced completely.

As for the OCIO dep which brought me to this issue, they require zlib and minizip-ng (configured with MZ_ZLIB=ON and MZ_COMPAT=OFF), but not zlib-ng and it seems to work on their github CI workflows.
Comment 3 Bernd 2023-02-19 22:19:08 UTC
An issue for adding cmake config files is at https://github.com/zlib-ng/zlib-ng/issues/1320