Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 918676 - dev-util/cmake-3.26.5-r2: fails to correctly report version of sys-libs/zlib-1.3-r1
Summary: dev-util/cmake-3.26.5-r2: fails to correctly report version of sys-libs/zlib-...
Status: RESOLVED FIXED
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: https://gitlab.kitware.com/cmake/cmak...
Whiteboard:
Keywords:
Depends on: 915949
Blocks:
  Show dependency tree
 
Reported: 2023-11-27 22:00 UTC by i.Dark_Templar
Modified: 2023-11-28 07:27 UTC (History)
1 user (show)

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 i.Dark_Templar 2023-11-27 22:00:25 UTC
Cmake started reporting incorrect version for zlib.

dev-util/cmake-3.26.5-r2
sys-libs/zlib-1.3-r1

CMakeLists.txt (3 lines):
cmake_minimum_required(VERSION 3.13)
FIND_PACKAGE(ZLIB REQUIRED)
message(STATUS "ZLIB VERSION: ${ZLIB_VERSION}")

When running "cmake ." I get following line:
ZLIB VERSION: 1.3.#define ZLIB_VERSION "1.3"

Expected output:
ZLIB VERSION: 1.3
or at least:
ZLIB VERSION: 1.3.0

It looks like cmake expects 3 digits in component but gets only 2.

Due to that media-libs/opencolorio, versions 2.2.1 and 2.3.0 at least, generate invalid cmake file "/usr/lib64/cmake/OpenColorIO/OpenColorIOConfig.cmake", which contains lines like:

    if (NOT TARGET ZLIB::ZLIB)
        # ZLIB_VERSION is available starting CMake 3.26+.
        # ZLIB_VERSION_STRING is still available for backward compatibility.
        # See https://cmake.org/cmake/help/git-stage/module/FindZLIB.html
        
        if (1.3.#define ZLIB_VERSION "1.3") # 1.3.#define ZLIB_VERSION "1.3"
            find_dependency(ZLIB 1.3.#define ZLIB_VERSION "1.3")
        else()
            find_dependency(ZLIB 1.3.#define ZLIB_VERSION "1.3")
        endif()
    endif()

Due to that malformed file, media-libs/openimageio fails to merge.

Reproducible: Always

Steps to Reproduce:
1. Run cmake with CMakeLists.txt from above. Incorrect version string is reported.

OR:
1. emerge -1 =dev-util/cmake-3.26.5-r2 =sys-libs/zlib-1.3-r1 =media-libs/opencolorio-2.3.0
2. emerge -1 =media-libs/openimageio-2.5.4.0
Actual Results:  
openimageio fails to emerge:

CMake Error at /usr/lib64/cmake/OpenColorIO/OpenColorIOConfig.cmake:63:
  Parse error.  Function missing ending ")".  End of file reached.
Call Stack (most recent call first):
  src/cmake/modules/FindOpenColorIO.cmake:35 (find_package)
  src/cmake/checked_find_package.cmake:127 (find_package)
  src/cmake/externalpackages.cmake:177 (checked_find_package)
  CMakeLists.txt:166 (include)

Expected Results:  
openimageio successfully emerges
Comment 1 i.Dark_Templar 2023-11-27 23:03:45 UTC
This should be fixed in cmake 3.27.4:

https://gitlab.kitware.com/cmake/cmake/-/commit/903439495033da40f798db9ec064d9b16ea672fc
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-28 07:27:13 UTC
3.27.x is stable now on amd64.