Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fails because of null conversion error #3033

Closed
anna-prins1 opened this issue Jul 12, 2024 · 3 comments
Closed

build fails because of null conversion error #3033

anna-prins1 opened this issue Jul 12, 2024 · 3 comments
Assignees
Labels
bug This issue is a bug. build-problem problems with building this sdk p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.

Comments

@anna-prins1
Copy link

Describe the bug

When building the sdk using the steps in this tutorial, the build fails on the step Building CXX object src/aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/ub_core.cpp.o.

Expected Behavior

Expected behavior would be to make without error.

Current Behavior

Here's the trace:

In file included from /home/annaprins/sdk_build/src/aws-cpp-sdk-core/ub_core.cpp:26:
/home/annaprins/aws-sdk-cpp/src/aws-cpp-sdk-core/source/client/RequestCompression.cpp: In member function ‘iostream_outcome Aws::Client::RequestCompression::compress(std::shared_ptr<std::basic_iostream<char> >, const Aws::Client::CompressionAlgorithm&) const’:
/home/annaprins/aws-sdk-cpp/src/aws-cpp-sdk-core/source/client/RequestCompression.cpp:102:19: error: converting to non-pointer type ‘int’ from NULL [-Werror=conversion-null]
  102 |         int ret = Z_NULL;
      |                   ^~~~~~
/home/annaprins/aws-sdk-cpp/src/aws-cpp-sdk-core/source/client/RequestCompression.cpp: In member function ‘Aws::Utils::Outcome<std::shared_ptr<std::basic_iostream<char> >, bool> Aws::Client::RequestCompression::uncompress(std::shared_ptr<std::basic_iostream<char> >, const Aws::Client::CompressionAlgorithm&) const’:
/home/annaprins/aws-sdk-cpp/src/aws-cpp-sdk-core/source/client/RequestCompression.cpp:221:19: error: converting to non-pointer type ‘int’ from NULL [-Werror=conversion-null]
  221 |         int ret = Z_NULL;
      |                   ^~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [src/aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/build.make:977: src/aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/ub_core.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:987: src/aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Reproduction Steps

I used this line to cmake:
cmake ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/local/ -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBUILD_ONLY="logs"
and then it failed on make
I tried both Debug and Release build types. I don't know why I thought that would change anything, but I thought it was worth a shot.. It fails the same way with both.

Possible Solution

No response

Additional Information/Context

No response

AWS CPP SDK version used

latest

Compiler and Version used

gcc 14.1.1

Operating System and version

Fedora 40

@anna-prins1 anna-prins1 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 12, 2024
@jmklix
Copy link
Member

jmklix commented Jul 12, 2024

I can't seem to reproduce this error that you're seeing. I made a dockerfile to see if it's reproducible on Fedora 40 and I didn't run into the build error that you're seeing. Can you take a look at the dockerfile below and see if you're able to get the sdk build in your environment or modify it to reproduce the same error that you get?

Dockerfile

layer.tar was downloaded from here

# This is a Jinja2 compatible Dockerfile template
FROM scratch
LABEL maintainer="Clement Verna <cverna@fedoraproject.org>"
ENV DISTTAG=f40container FGC=f40 FBR=f40
ADD layer.tar /
CMD ["/bin/bash"]

RUN yum update -y
RUN yum install -y git cmake gcc-c++ libcurl-devel zlib-devel openssl-devel

RUN git clone --depth 1 --recurse-submodules https://github.com/aws/aws-sdk-cpp && \
    cd aws-sdk-cpp && \
    mkdir build && \
    cd build

Commands

docker build -t 3033 .
docker run --name 3033_cont -it 3033 /bin/bash

Then inside the docker container I ran these commands

cd aws-sdk-cpp/build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/aws-sdk-cpp/install/ -DBUILD_ONLY="logs"
make

@jmklix jmklix added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. p3 This is a minor priority issue build-problem problems with building this sdk and removed needs-triage This issue or PR still needs to be triaged. labels Jul 12, 2024
@jmklix jmklix self-assigned this Jul 12, 2024
@anna-prins1
Copy link
Author

anna-prins1 commented Jul 15, 2024

I was able to build it using the Dockerfile you sent me on in a container on my Mac. But on my Fedora machine on the bare OS I was not able to get it to build. I tried to use the same commands you used in the Dockerfile and the ones you used to build, but I still got the same error. So I diff-ed the output of the cmake command for each, and it turns out my Fedora machine had zlib version 1.3.0 on it and the docker container had v 1.3.1. I updated zlib and built successfully. So, something must have been broken in the last version of zlib.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. build-problem problems with building this sdk p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.
Projects
None yet
Development

No branches or pull requests

2 participants