conan: [package] aws-sdk-cpp/1.11.352: Fails to cross-compile for Windows (with MinGW)

Description

When cross-compiling the package with MinGW, it doesn’t seem to correctly find zlib.

-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) See full log below.

Package and Environment Details

  • Package Name/Version: aws-sdk-cpp/1.11.352
  • Operating System+version: Ubuntu 24.04
  • Compiler+version: x86_64-w64-mingw32-gcc-posix (GCC) 13-posix
  • Conan version: 2.12.2
  • Python version: Python 3.12.3

Conan profile

[settings] os=Windows arch=x86_64 compiler=gcc compiler.version=13 compiler.libcxx=libstdc++11 compiler.cppstd=17 build_type=Release

[conf] tools.cmake.cmaketoolchain:toolchain_file=/tmp/mingw-toolchain.cmake tools.build:compiler_executables={“c”: “/usr/bin/x86_64-w64-mingw32-gcc-posix”, “cpp”: “/usr/bin/x86_64-w64-mingw32-g+±posix”} tools.build:cxxflags=[“-static-libstdc++”, “-static-libgcc”] tools.build:exelinkflags=[“-static-libstdc++”, “-static-libgcc”] tools.build:skip_test=True

[buildenv] CC=/usr/bin/x86_64-w64-mingw32-gcc-posix CXX=/usr/bin/x86_64-w64-mingw32-g+±posix

mingw-toolchain.cmake.txt

Steps to reproduce

conan install --require aws-sdk-cpp/1.11.352 -pr:b=default -pr:h=/tmp/mingw-profile.txt --build=missing

mingw-profile.txt

Logs

Click to expand log
conan install . -pr:b=default -pr:h=/tmp/mingw-profile.txt --build=missing

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=17
compiler.libcxx=libstdc++11
compiler.version=13
os=Windows
[conf]
tools.build:compiler_executables={'c': '/usr/bin/x86_64-w64-mingw32-gcc-posix', 'cpp': '/usr/bin/x86_64-w64-mingw32-g++-posix'}
tools.build:cxxflags=['-static-libstdc++', '-static-libgcc']
tools.build:exelinkflags=['-static-libstdc++', '-static-libgcc']
tools.build:skip_test=True
tools.cmake.cmaketoolchain:toolchain_file=/home/vbv/Documents/MinGwCompile/mingw-toolchain.cmake
[buildenv]
CC=/usr/bin/x86_64-w64-mingw32-gcc-posix
CXX=/usr/bin/x86_64-w64-mingw32-g++-posix

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux


======== Computing dependency graph ========
Graph root
    conanfile.txt: /home/vbv/SandBox/conan_aws/conanfile.txt
Requirements
    aws-c-auth/0.7.16#4cd2a4dd2c291290ff1e3be7472f0235 - Cache
    aws-c-cal/0.6.14#4212409bde6890c04bc6473f6a1b9b6f - Cache
    aws-c-common/0.9.15#3ab6a82080b0fe947b0af01f8a5561a8 - Cache
    aws-c-compression/0.2.18#b53cb2f5e4328057fc2a30c024eeee89 - Cache
    aws-c-event-stream/0.4.2#2ac4c091f655ad62cb841d0f2d57a52f - Cache
    aws-c-http/0.8.1#5ee3a3c604ac4df76de464ddb2c1d8b6 - Cache
    aws-c-io/0.14.7#4289fb3e053db418bc245f837c9091e9 - Cache
    aws-c-mqtt/0.10.3#21b889d3f099966b9caab84c5c76a0c4 - Cache
    aws-c-s3/0.5.5#934ed11784b03a3009d8f3db35e9274a - Cache
    aws-c-sdkutils/0.1.15#818341072d2a1dfba34a5cab307ae3df - Cache
    aws-checksums/0.1.18#03dd0aa4b25f31fbc0eafb6f277b1f66 - Cache
    aws-crt-cpp/0.26.9#d19efc484629b006d8c37fe472a14f03 - Cache
    aws-sdk-cpp/1.11.352#6d1a2ed262601525c5687f91235a2d42 - Cache
    zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76 - Cache
Resolved version ranges
    zlib/[>=1.2.11 <2]: zlib/1.3.1

======== Computing necessary packages ========
Connecting to remote 'conancenter' anonymously
aws-sdk-cpp/1.11.352: Main binary package '2a0c0fd6779c844268beda15e6de014dc650789e' missing
aws-sdk-cpp/1.11.352: Checking 11 compatible configurations
aws-sdk-cpp/1.11.352: Compatible configurations not found in cache, checking servers
aws-sdk-cpp/1.11.352: '39c2ddc43efdb12d1d4d83a15aa84009ee7cebb2': compiler.cppstd=98
aws-sdk-cpp/1.11.352: '57d0bc7ae85b2e44eb8c2be262ecdce9f23a23a1': compiler.cppstd=gnu98
aws-sdk-cpp/1.11.352: '4fd87f5611679ce52eff6c8f5c4159c83030072d': compiler.cppstd=11
aws-sdk-cpp/1.11.352: '73e7c8380021742952f2b22985547d87186dbc45': compiler.cppstd=gnu11
aws-sdk-cpp/1.11.352: '50d39d222d8daf22cf5367dd8a20c6a309b3ce72': compiler.cppstd=14
aws-sdk-cpp/1.11.352: '151aa8d94a740c746953b028261377abb57ce811': compiler.cppstd=gnu14
aws-sdk-cpp/1.11.352: '873312e175c6783457311ac06dbef2afc8c13fda': compiler.cppstd=gnu17
aws-sdk-cpp/1.11.352: 'c34b7ef3fa7f1ce373febe0465a9b0e9e00c624a': compiler.cppstd=20
aws-sdk-cpp/1.11.352: '78e8e72e75a14e212e61f9790e7171ff29f6f4ba': compiler.cppstd=gnu20
aws-sdk-cpp/1.11.352: '0317668a53f836542b7948804564fec12b381b5d': compiler.cppstd=23
aws-sdk-cpp/1.11.352: '78d5a436d51fdf2bab184301550a901adee130e9': compiler.cppstd=gnu23
Requirements
    aws-c-auth/0.7.16#4cd2a4dd2c291290ff1e3be7472f0235:c3cf8ea7fda75b0f0e679634407a129a0ae9dfa8#2691cdfc50334c42fc4b7e64c48650b8 - Cache
    aws-c-cal/0.6.14#4212409bde6890c04bc6473f6a1b9b6f:e5d66c0e6f2d7be36ac0688de02ef697f29d0cee#c2d08d3f71e2d6cd93593a2dc703c22b - Cache
    aws-c-common/0.9.15#3ab6a82080b0fe947b0af01f8a5561a8:6183c3fa3fec8b004fd6331fd769eac84324fe59#5da86014630980be68c8e96f615f1b71 - Cache
    aws-c-compression/0.2.18#b53cb2f5e4328057fc2a30c024eeee89:e5d66c0e6f2d7be36ac0688de02ef697f29d0cee#3068f2d0c984b1fbaaf5e22b2aed7894 - Cache
    aws-c-event-stream/0.4.2#2ac4c091f655ad62cb841d0f2d57a52f:cdcb4d38057796b4b16e30a6e9bbd6b1e3365ff7#fb74e6ee77c418576d1d6e09df17452a - Cache
    aws-c-http/0.8.1#5ee3a3c604ac4df76de464ddb2c1d8b6:a4cdc0907c0f998c123ed6cf0542449ba7dbff5c#b1aa42458afa9fd3282c02d638ebf499 - Cache
    aws-c-io/0.14.7#4289fb3e053db418bc245f837c9091e9:07a4bce393153c32068150b2b6443a255d01d24c#b0662b273cc907ee8dc34c2b948acd1c - Cache
    aws-c-mqtt/0.10.3#21b889d3f099966b9caab84c5c76a0c4:02e7502f485510d40ddcfbd890f3e15390802188#739fe830538ae8308f2a0b7858ee7c2a - Cache
    aws-c-s3/0.5.5#934ed11784b03a3009d8f3db35e9274a:bee26ac50297cafb6a9b08925aae111969527ccf#e38259cf5afb08f563140cc6cbc1d189 - Cache
    aws-c-sdkutils/0.1.15#818341072d2a1dfba34a5cab307ae3df:e5d66c0e6f2d7be36ac0688de02ef697f29d0cee#df1f51f079d9dbbbc43ab2ae031600c3 - Cache
    aws-checksums/0.1.18#03dd0aa4b25f31fbc0eafb6f277b1f66:e5d66c0e6f2d7be36ac0688de02ef697f29d0cee#ff993a157bec49ed55709e723ae180be - Cache
    aws-crt-cpp/0.26.9#d19efc484629b006d8c37fe472a14f03:f661965ec2c4cabae2740d518d073c20213875b5#ae5cd0f5eefc79e024cf5a9f955b6f59 - Cache
    aws-sdk-cpp/1.11.352#6d1a2ed262601525c5687f91235a2d42:2a0c0fd6779c844268beda15e6de014dc650789e - Build
    zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76:74fce2c720f804facc619f996bab77ff99796c4d#2256409d04a1f3919da52366d63ca3f6 - Cache

======== Installing packages ========
aws-c-common/0.9.15: Already installed! (1 of 14)
zlib/1.3.1: Already installed! (2 of 14)
aws-c-cal/0.6.14: Already installed! (3 of 14)
aws-c-compression/0.2.18: Already installed! (4 of 14)
aws-c-sdkutils/0.1.15: Already installed! (5 of 14)
aws-checksums/0.1.18: Already installed! (6 of 14)
aws-c-io/0.14.7: Already installed! (7 of 14)
aws-c-event-stream/0.4.2: Already installed! (8 of 14)
aws-c-http/0.8.1: Already installed! (9 of 14)
aws-c-auth/0.7.16: Already installed! (10 of 14)
aws-c-mqtt/0.10.3: Already installed! (11 of 14)
aws-c-s3/0.5.5: Already installed! (12 of 14)
aws-crt-cpp/0.26.9: Already installed! (13 of 14)

-------- Installing package aws-sdk-cpp/1.11.352 (14 of 14) --------
aws-sdk-cpp/1.11.352: Building from source
aws-sdk-cpp/1.11.352: Package aws-sdk-cpp/1.11.352:2a0c0fd6779c844268beda15e6de014dc650789e
aws-sdk-cpp/1.11.352: Copying sources to build folder
aws-sdk-cpp/1.11.352: Building your package in /home/vbv/.conan2/p/b/aws-sf034c235156db/b
aws-sdk-cpp/1.11.352: Calling generate()
aws-sdk-cpp/1.11.352: Generators folder: /home/vbv/.conan2/p/b/aws-sf034c235156db/b/build/Release/generators
aws-sdk-cpp/1.11.352: CMakeToolchain generated: /home/vbv/.conan2/p/b/aws-sf034c235156db/b/build/Release/generators/CMakePresets.json
aws-sdk-cpp/1.11.352: CMakeToolchain generated: /home/vbv/.conan2/p/b/aws-sf034c235156db/b/src/CMakeUserPresets.json
aws-sdk-cpp/1.11.352: Generating aggregated env files
aws-sdk-cpp/1.11.352: Generated aggregated env files: ['conanbuild.sh', 'conanrun.bat']
aws-sdk-cpp/1.11.352: Calling build()
aws-sdk-cpp/1.11.352: Apply patch (conan): Use pulseaudio from conan
aws-sdk-cpp/1.11.352: Apply patch (file): patches/1.11.352-0002-disable-sort-links.patch
aws-sdk-cpp/1.11.352: Apply patch (file): patches/1.9.100-0002-aws-plugin-conf.patch
aws-sdk-cpp/1.11.352: Running CMake.configure()
aws-sdk-cpp/1.11.352: RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="../../../../../../../Documents/MinGwCompile/mingw-toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/vbv/.conan2/p/b/aws-sf034c235156db/p" -DBUILD_ONLY="core;access-management;cognito-identity;iam;identity-management;kms;monitoring;polly;queues;s3;s3-encryption;sqs;sts;text-to-speech;transfer" -DENABLE_UNITY_BUILD="ON" -DENABLE_TESTING="OFF" -DAUTORUN_UNIT_TESTS="OFF" -DBUILD_DEPS="OFF" -DMINIMIZE_SIZE="OFF" -DCURL_HAS_H2_EXITCODE="0" -DCURL_HAS_H2_EXITCODE__TRYRUN_OUTPUT="" -DCURL_HAS_TLS_PROXY_EXITCODE="0" -DCURL_HAS_TLS_PROXY_EXITCODE__TRYRUN_OUTPUT="" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DBUILD_TESTING="OFF" -DCMAKE_BUILD_TYPE="Release" "/home/vbv/.conan2/p/b/aws-sf034c235156db/b/src"
CMake Warning at CMakeLists.txt:9 (message):
  In 1.11 releases, we are releasing experimental alternative building
  mode.By setting -DLEGACY_BUILD=OFF you can test our advances in modern
  CMake building and provide early feedback.  The legacy support is set by
  default in 1.11, when you complete build updating scripts please update the
  build flags as mentioned in README.md and set -DLEGACY_BUILD=OFF.  The
  legacy support will be removed at 1.12.0 release.


CMake Deprecation Warning at CMakeLists.txt:17 (cmake_policy):
  The OLD behavior for policy CMP0077 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- TARGET_ARCH not specified; inferring host OS to be platform compilation target
-- Building AWS libraries as static objects
-- Generating linux build config
-- Building project version: 1.11.352
-- The CXX compiler identification is GNU 13.0.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/x86_64-w64-mingw32-g++-posix - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Python3 (missing: Python3_LIBRARIES Python3_INCLUDE_DIRS Development Development.Module Development.Embed) (found version "3.12.3")
CMake Warning at CMakeLists.txt:171 (message):
  ZLIB is not available, it will not be used to compress requests


-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) 
CMake Error at cmake/external_dependencies.cmake:9 (message):
  Could not find zlib
Call Stack (most recent call first):
  CMakeLists.txt:198 (include)


-- Configuring incomplete, errors occurred!

aws-sdk-cpp/1.11.352: ERROR: 
Package '2a0c0fd6779c844268beda15e6de014dc650789e' build failed
aws-sdk-cpp/1.11.352: WARN: Build folder /home/vbv/.conan2/p/b/aws-sf034c235156db/b/build/Release
ERROR: aws-sdk-cpp/1.11.352: Error in build() method, line 631
	cmake.configure()
	ConanException: Error 1 while executing

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 18 (13 by maintainers)

Most upvoted comments

Hi again @franramirez688

Thanks for your reply. I don’t believe that something is wrong with Mingw but more that the aws-cpp-sdk recipe doesn’t set TARGET_ARCH.

See this line in the output: -- TARGET_ARCH not specified; inferring host OS to be platform compilation target

I’ve tried:

  • to set set(TARGET_ARCH WINDOWS) in the mingw-toolchain.cmake
  • to add -c tools.cmake.cmaketoolchain:extra_variables='{"TARGET_ARCH": "WINDOWS"}' to the conan command

with no difference