conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
943 stars 1.71k forks source link

[package] minizip/1.2.13: Windows MinGW Clang fails to compile #14440

Open LargoUsagi opened 1 year ago

LargoUsagi commented 1 year ago

Description

This compiles using GCC and Clang under Arch Linux, and GCC using mingw on windows, but I had the preference of using clang through mingw.

Package and Environment Details

Conan profile

[settings] os=Windows os_build=Windows arch=x86_64 arch_build=x86_64 build_type=Release compiler=clang compiler.version=15 compiler.libcxx=libstdc++11 [options] [build_requires] [env] CC=C:/msys64/mingw64/bin/clang CXX=C:/msys64/mingw64/bin/clang++

Steps to reproduce

conan install . --build=missing --profile=gcc -if=cmake-build-release -s build_type=Release conan install . --build=missing --profile=gcc -if=cmake-build-debug -s build_type=Debug

[requires]
glfw/3.3.8
glm/cci.20220420
assimp/5.2.2

[generators]
cmake

Logs

Click to expand log ``` minizip/1.2.13: Copying sources to build folder minizip/1.2.13: Building your package in C:\Users\LargoUsagi\.conan\data\minizip\1.2.13\_\_\build\3822ec74d7dc1a129150f4f5e1c981542581f77c minizip/1.2.13: Generator txt created conanbuildinfo.txt minizip/1.2.13: Calling generate() minizip/1.2.13: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior minizip/1.2.13: Preset 'debug' added to CMakePresets.json. Invoke it manually using 'cmake --preset debug' minizip/1.2.13: If your CMake version is not compatible with CMakePresets (<3.19) call cmake like: 'cmake -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE=C:\Users\LargoUsagi\.conan\data\minizip\1.2.13\_\_\build\3822ec74d7dc1a129150f4f5e1c981542581f77c\build\gener ators\conan_toolchain.cmake -DCMAKE_SH=CMAKE_SH-NOTFOUND -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Debug' minizip/1.2.13: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior minizip/1.2.13: Aggregating env generators minizip/1.2.13: Calling build() minizip/1.2.13: CMake command: cmake -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE="C:/Users/LargoUsagi/.conan/data/minizip/1.2.13/_/_/build/3822ec74d7dc1a129150f4f5e1c981542581f77c/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/LargoUsagi/.c onan/data/minizip/1.2.13/_/_/package/3822ec74d7dc1a129150f4f5e1c981542581f77c" -DCMAKE_SH="CMAKE_SH-NOTFOUND" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Debug" "C:\Users\LargoUsagi\.conan\data\minizip\1.2.13\_\_\build\3822ec74d7dc1a129150f4f5e1c9815425 81f77c\src\.." -- Using Conan toolchain: C:/Users/LargoUsagi/.conan/data/minizip/1.2.13/_/_/build/3822ec74d7dc1a129150f4f5e1c981542581f77c/build/generators/conan_toolchain.cmake -- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF -- The C compiler identification is Clang 15.0.3 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/msys64/mingw64/bin/clang.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Conan: Target declared 'ZLIB::ZLIB' CMake Error at build/generators/cmakedeps_macros.cmake:39 (message): Library 'zlib' not found in package. If 'zlib' is a system library, declare it with 'cpp_info.system_libs' property Call Stack (most recent call first): build/generators/ZLIB-Target-debug.cmake:34 (conan_package_library_targets) build/generators/ZLIBTargets.cmake:26 (include) build/generators/ZLIBConfig.cmake:10 (include) CMakeLists.txt:11 (find_package) -- Configuring incomplete, errors occurred! See also "C:/Users/LargoUsagi/.conan/data/minizip/1.2.13/_/_/build/3822ec74d7dc1a129150f4f5e1c981542581f77c/build/Debug/CMakeFiles/CMakeOutput.log". minizip/1.2.13: minizip/1.2.13: ERROR: Package '3822ec74d7dc1a129150f4f5e1c981542581f77c' build failed minizip/1.2.13: WARN: Build folder C:\Users\LargoUsagi\.conan\data\minizip\1.2.13\_\_\build\3822ec74d7dc1a129150f4f5e1c981542581f77c\build\Debug ERROR: minizip/1.2.13: Error in build() method, line 78 cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) ConanException: Error 1 while executing cmake -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE="C:/Users/LargoUsagi/.conan/data/minizip/1.2.13/_/_/build/3822ec74d7dc1a129150f4f5e1c981542581f77c/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Us ers/LargoUsagi/.conan/data/minizip/1.2.13/_/_/package/3822ec74d7dc1a129150f4f5e1c981542581f77c" -DCMAKE_SH="CMAKE_SH-NOTFOUND" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Debug" "C:\Users\LargoUsagi\.conan\data\minizip\1.2.13\_\_\build\3822ec74d7dc1a129 150f4f5e1c981542581f77c\src\.." ```
LargoUsagi commented 1 year ago

This profile passed on the same system will complete successfully

[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.version=12
compiler.libcxx=libstdc++11
[options]
[build_requires]
[env]
CC=C:/msys64/mingw64/bin/gcc
CXX=C:/msys64/mingw64/bin/g++
SpaceIm commented 1 year ago

This is a never ended story where we fix a clang windows flavor and break another one, until we can have some conan helper like https://github.com/conan-io/conan/issues/12336. For the moment assume that conan-center recipes don't support clang flavors targeting Windows, because we don't have any easy way to predict lib names of libraries built with CMake when they rely on MINGW or MSVC variables to change lib name.

/cc @memsharded

LargoUsagi commented 1 year ago

This is a never ended story where we fix a clang windows flavor and break another one, until we can have some conan helper like conan-io/conan#12336. For the moment assume that conan-center recipes don't support clang flavors targeting Windows.

/cc @memsharded

Does that include if you use clang/llvm with MSVC

SpaceIm commented 1 year ago

Yes, it may or may not work. Most recipes should work, and other fail to predict correct lib name or even use the proper build system.

SpaceIm commented 1 year ago

Does it work with https://github.com/conan-io/conan-center-index/pull/14644?

seppeon commented 1 year ago

I've submitted this to resolve this issue: https://github.com/conan-io/conan-center-index/pull/18283

If possible, please approve my PR: User-approval pending