Skip to content

[libpng] build failure #49057

@Kurapikov

Description

@Kurapikov

Operating system

macos

Compiler

clang

Steps to reproduce the behavior

./vcpkg install libpng:arm64-osx

Failure logs

It seems that libpng rely on a special version of zlib, but vcpkg tried to use zlib installed on my local system instead of vcpkg dependency tree.

CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
Command failed: /opt/homebrew/bin/cmake --build . --config Debug --target install -- -v -j15
Working Directory: /Users/k/Proj/vcpkg/buildtrees/libpng/arm64-osx-dbg
See logs for more information:
/Users/k/Proj/vcpkg/buildtrees/libpng/install-arm64-osx-dbg-out.log
Call Stack (most recent call first):
/Users/k/Proj/vcpkg_installed/arm64-osx/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
/Users/k/Proj/vcpkg_installed/arm64-osx/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
/Users/k/Proj/vcpkg/registries/git-trees/6bf3aa4213d63a42bdcf18f229df7e703f80c5aa/portfile.cmake:92 (vcpkg_cmake_install)
scripts/ports.cmake:206 (include)

The file "install-arm64-osx-dbg-out.log" writes:

[14/33] /usr/bin/cc -DPNG_ARM_NEON_OPT=2 -I/Users/k/Proj/vcpkg/buildtrees/libpng/src/v1.6.53-b98b476139.clean -I/Users/k/Proj/vcpkg/buildtrees/libpng/arm64-osx-dbg -isystem /Users/k/Proj/vcpkg_installed/arm64-osx/include -fPIC -g -arch arm64 -MD -MT CMakeFiles/png_static.dir/pngwio.c.o -MF CMakeFiles/png_static.dir/pngwio.c.o.d -o CMakeFiles/png_static.dir/pngwio.c.o -c /Users/k/Proj/vcpkg/buildtrees/libpng/src/v1.6.53-b98b476139.clean/pngwio.c
FAILED: [code=1] CMakeFiles/png_static.dir/pngwio.c.o
/usr/bin/cc -DPNG_ARM_NEON_OPT=2 -I/k/Proj/KCAD_qt/vcpkg/buildtrees/libpng/src/v1.6.53-b98b476139.clean -I/Users/k/Proj/vcpkg/buildtrees/libpng/arm64-osx-dbg -isystem /Users/k/Proj/vcpkg_installed/arm64-osx/include -fPIC -g -arch arm64 -MD -MT CMakeFiles/png_static.dir/pngwio.c.o -MF CMakeFiles/png_static.dir/pngwio.c.o.d -o CMakeFiles/png_static.dir/pngwio.c.o -c /Users/k/Proj/vcpkg/buildtrees/libpng/src/v1.6.53-b98b476139.clean/pngwio.c
In file included from /Users/k/Proj/vcpkg/buildtrees/libpng/src/v1.6.53-b98b476139.clean/pngwio.c:20:
/Users/k/Proj/vcpkg/buildtrees/libpng/src/v1.6.53-b98b476139.clean/pngpriv.h:1027:4: error: The include path of <zlib.h> is incorrect
# error The include path of <zlib.h> is incorrect

the file "pngpriv.h" line 1027 writes:

/* Validate the include paths - the include path used to generate pnglibconf.h
* must match that used in the build, or we must be using pnglibconf.h.prebuilt:
*/
#if PNG_ZLIB_VERNUM != 0 && PNG_ZLIB_VERNUM != ZLIB_VERNUM
# error The include path of <zlib.h> is incorrect
/* When pnglibconf.h was built, the copy of zlib.h that it used was not the
* same as the one being used here. Considering how libpng makes decisions
* to use the zlib API based on the zlib version number, the -I options must
* match.
*
* A possible cause of this mismatch is that you passed an -I option in
* CFLAGS, which is unlikely to work. All the preprocessor options, and all
* the -I options in particular, should be in CPPFLAGS.
*/
#endif

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:port-bugThe issue is with a library, which is something the port should already support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions