-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
Hello!
While Readme states ZLib is optional and required only in certain cases, in fact build will fail on Linux if there is no ZLib in the system. This happens because in file external_dependencies.cmake we have check if platform is NOT windows and it is NOT custom - then throw an error if ZLib is not found, even if -DENABLE_ZLIB_REQUEST_COMPRESSION is set to "OFF" or just absent.
This seems like a bug because if this dependency is optional and we don't use features that require ZLib - build should not fail because of "Could not find zlib".
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
Build on Linux without -DENABLE_ZLIB_REQUEST_COMPRESSION flag OR with -DENABLE_ZLIB_REQUEST_COMPRESSION="OFF" should pass even if there is no ZLib in the build system(container).
Current Behavior
Build on Linux will fail if there is no ZLib in the build system(container).
Reproduction Steps
- Use Docker based on Ubuntu 20.04
- cd /tmp && git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp && cd ./aws-sdk-cpp && mkdir build && cd ./build
- cmake ..
-DCMAKE_C_COMPILER=arm-none-linux-gnueabihf-gcc
-DCMAKE_CXX_COMPILER=arm-none-linux-gnueabihf-g++
-DBUILD_ONLY="s3"
-DENABLE_ZLIB_REQUEST_COMPRESSION=OFF
-DCMAKE_CROSSCOMPILING=TRUE
Possible Solution
Alter checks in external_dependencies.cmake file to take -DENABLE_ZLIB_REQUEST_COMPRESSION flag into account.
Additional Information/Context
This is only observed during cross-compiling when we don't have zlib in cross-compilation sysroot. This is NOT observed on normal (non-cross) compilation because zilb from the host is used.
AWS CPP SDK version used
1.11.733
Compiler and Version used
It fails on CMake phase, not on compile phase
Operating System and version
Ubuntu 20.04 (dockerized)