zlib-ng / minizip-ng

Fork of the popular zip manipulation library found in the zlib distribution.
Other
1.22k stars 428 forks source link

Fails to build with newest zlib #764

Closed GeckoEidechse closed 3 months ago

GeckoEidechse commented 7 months ago

Since the following commit on zlib (https://github.com/madler/zlib/commit/2e3d86c4e12c4c23db4229eea7d0c1cd4571273e), mini-zip fails building for us.

Truncated output from CI logs: https://github.com/R2Northstar/NorthstarLauncher/actions/runs/7634172734/job/20797658775#step:4:337

 -- Looking for fseeko
-- Looking for fseeko - not found
-- Fetching zlib https://github.com/madler/zlib master
-- Looking for unistd.h
-- Looking for unistd.h - not found
-- Renaming
--     D:/a/NorthstarLauncher/NorthstarLauncher/primedev/thirdparty/minizip/third_party/zlib/zconf.h
-- to 'zconf.h.included' because this file is included with zlib
-- but CMake generates it automatically in the build directory.
-- The following features have been enabled:

 * MZ_COMPAT, Enables compatibility layer
 * MZ_ZLIB, Enables ZLIB compression
 * MZ_FETCH_LIBS, Enables fetching third-party libraries if not found

-- The following features have been disabled:

 * MZ_BZIP2, Enables BZIP2 compression
 * MZ_LZMA, Enables LZMA & XZ compression
 * MZ_ZSTD, Enables ZSTD compression
 * MZ_LIBCOMP, Enables Apple compression
 * MZ_FORCE_FETCH_LIBS, Enables fetching third-party libraries always
 * MZ_PKCRYPT, Enables PKWARE traditional encryption
 * MZ_WZAES, Enables WinZIP AES encryption
 * MZ_OPENSSL, Enables OpenSSL for encryption
 * MZ_LIBBSD, Builds with libbsd crypto random
 * MZ_ICONV, Enables iconv string encoding conversion library
 * MZ_COMPRESS_ONLY, Only support compression
 * MZ_DECOMPRESS_ONLY, Only support decompression
 * MZ_FILE32_API, Builds using posix 32-bit file api
 * MZ_BUILD_TESTS, Builds minizip test executable
 * MZ_BUILD_UNIT_TESTS, Builds minizip unit test project
 * MZ_BUILD_FUZZ_TESTS, Builds minizip fuzzer executables
 * MZ_CODE_COVERAGE, Builds with code coverage flags

-- Configuring done (77.4s)
CMake Error in primedev/thirdparty/minizip/third_party/zlib/CMakeLists.txt:
  Target "zlibstatic" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "D:/a/NorthstarLauncher/NorthstarLauncher/_deps/zlib-build"

  which is prefixed in the build directory.

CMake Error in primedev/thirdparty/minizip/third_party/zlib/CMakeLists.txt:
  Target "zlibstatic" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "D:/a/NorthstarLauncher/NorthstarLauncher/primedev/thirdparty/minizip/third_party/zlib"

  which is prefixed in the build directory.

-- Generating done (0.4s)
CMake Generate step failed.  Build files cannot be regenerated correctly.
ASpoonPlaysGames commented 7 months ago

When setting the tag to v1.3 (https://github.com/madler/zlib/tree/v1.3) other issues arise, potentially related to the fact that we submodule minizip?

1> [CMake] -- NS: Building to C:/Users/Spoon/NorthstarLauncher/build/game
1> [CMake] -- curl version=[7.81.0-DEV]
1> [CMake] -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) 
1> [CMake] -- Enabled features: SSL IPv6 unixsockets AsynchDNS Largefile SSPI alt-svc HSTS SPNEGO Kerberos NTLM
1> [CMake] -- Enabled protocols: HTTP HTTPS
1> [CMake] -- Enabled SSL backends: Schannel
1> [CMake] -- Using CMake version 3.25.1-msvc1
1> [CMake] -- Fetching zlib https://github.com/madler/zlib v1.3
1> [CMake] HEAD is now at 09155ea zlib 1.3
1> [CMake] Index was not unstashed.
1> [CMake] The stash entry is kept in case you need it again.
1> [CMake] The stash entry is kept in case you need it again.
1> [CMake] CMake Error at C:/Users/Spoon/NorthstarLauncher/build/_deps/zlib-subbuild/zlib-populate-prefix/tmp/zlib-populate-gitupdate.cmake:264 (message):
1> [CMake]   
1> [CMake] 
1> [CMake]   Failed to unstash changes in: 'C:/Users/Spoon/Desktop/Northstar
1> [CMake]   Things/Northstar Github
1> [CMake]   Fork/NorthstarLauncher/primedev/thirdparty/minizip/third_party/zlib'.
1> [CMake] 
1> [CMake]   You will have to resolve the conflicts manually
1> [CMake] 
1> [CMake] 
1> [CMake] [0/7] Performing update step for 'zlib-populate'
1> [CMake] FAILED: zlib-populate-prefix/src/zlib-populate-stamp/zlib-populate-update C:/Users/Spoon/NorthstarLauncher/build/_deps/zlib-subbuild/zlib-populate-prefix/src/zlib-populate-stamp/zlib-populate-update 
1> [CMake] cmd.exe /C "cd /D "C:\Users\Spoon\Desktop\Northstar Things\Northstar Github Fork\NorthstarLauncher\primedev\thirdparty\minizip\third_party\zlib" && "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -P "C:/Users/Spoon/NorthstarLauncher/build/_deps/zlib-subbuild/zlib-populate-prefix/tmp/zlib-populate-gitupdate.cmake""
1> [CMake] ninja: build stopped: subcommand failed.
ASpoonPlaysGames commented 7 months ago

Corresponding issue on zlib repo: https://github.com/madler/zlib/issues/915

ekantik1 commented 7 months ago

https://github.com/madler/zlib/issues/915 is closed as the changes made to develop branch. how to pick up the change here to fix this issue?

NorbertEff commented 7 months ago

I was able to compile with the tag set to develop as a workaround.

nmoinvaz commented 6 months ago

It is an error in zlib's current CMake in their master branch. You can delete your temporary build files and try using:

cmake -S . -B build -DZLIB_TAG=develop
nmoinvaz commented 3 months ago

I have switched to using zlib-ng.