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

Install fails with CMake Warnings and missing s2n files #3229

Closed
1 task
nabelekt opened this issue Dec 20, 2024 · 6 comments
Closed
1 task

Install fails with CMake Warnings and missing s2n files #3229

nabelekt opened this issue Dec 20, 2024 · 6 comments
Labels
build-problem problems with building this sdk p2 This is a standard priority issue

Comments

@nabelekt
Copy link

nabelekt commented Dec 20, 2024

Describe the bug

I am trying to do a fresh install of the latest SDK version, on Ubuntu 24.04, with the following script:

version_to_install="1.11.471"

apt update
apt install libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev libpulse-dev -y

cd ../build
if [ -d "aws-sdk-cpp" ]; then
    rm -rf aws-sdk-cpp
fi
git clone --recurse-submodules -j8 https://github.com/aws/aws-sdk-cpp --branch $version_to_install
mkdir aws_sdk_build
cd aws_sdk_build
# DLEGACY_BUILD=OFF shouldn't be needed for v1.12+
cmake ../aws-sdk-cpp \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_PREFIX_PATH=/usr/local/ \
    -DCMAKE_INSTALL_PREFIX=/usr/local/ \
    -DBUILD_ONLY="core;iot;s3;dynamodb" \
    -DLEGACY_BUILD=ON
    # -DLEGACY_BUILD=OFF
make
make install
cd ..
rm aws-sdk-cpp -rf
rm aws_sdk_build -rf

I get several CMake warnings like this:

CMake Warning at crt/aws-crt-cpp/CMakeLists.txt:284 (add_library):
  Cannot generate a safe runtime search path for target aws-crt-cpp because
  there is a cycle in the constraint graph:

    dir 0 is [/root/gateway/build/aws_sdk_build/crt/aws-crt-cpp/crt/aws-c-mqtt]
    dir 1 is [/root/gateway/build/aws_sdk_build/lib]
      dir 6 must precede it due to runtime library [libs2n.so.1]
    dir 2 is [/root/gateway/build/aws_sdk_build/crt/aws-crt-cpp/crt/aws-c-s3]
    dir 3 is [/root/gateway/build/aws_sdk_build/crt/aws-crt-cpp/crt/aws-c-auth]
    dir 4 is [/root/gateway/build/aws_sdk_build/crt/aws-crt-cpp/crt/aws-c-http]
    dir 5 is [/root/gateway/build/aws_sdk_build/crt/aws-crt-cpp/crt/aws-c-io]
    dir 6 is [/usr/local/lib]
      dir 0 must precede it due to runtime library [libaws-c-mqtt.so.1.0.0]
      dir 1 must precede it due to runtime library [libaws-c-event-stream.so.1.0.0]
      dir 2 must precede it due to runtime library [libaws-c-s3.so.0unstable]
      dir 3 must precede it due to runtime library [libaws-c-auth.so.1.0.0]
      dir 4 must precede it due to runtime library [libaws-c-http.so.1.0.0]
      dir 5 must precede it due to runtime library [libaws-c-io.so.1.0.0]
      dir 7 must precede it due to runtime library [libaws-c-compression.so.1.0.0]
      dir 8 must precede it due to runtime library [libaws-c-cal.so.1.0.0]
      dir 9 must precede it due to runtime library [libaws-c-sdkutils.so.1.0.0]
      dir 10 must precede it due to runtime library [libaws-checksums.so.1.0.0]
      dir 11 must precede it due to runtime library [libaws-c-common.so.1]
    dir 7 is [/root/gateway/build/aws_sdk_build/crt/aws-crt-cpp/crt/aws-c-compression]
    dir 8 is [/root/gateway/build/aws_sdk_build/crt/aws-crt-cpp/crt/aws-c-cal]
    dir 9 is [/root/gateway/build/aws_sdk_build/crt/aws-crt-cpp/crt/aws-c-sdkutils]
    dir 10 is [/root/gateway/build/aws_sdk_build/crt/aws-crt-cpp/crt/aws-checksums]
    dir 11 is [/root/gateway/build/aws_sdk_build/crt/aws-crt-cpp/crt/aws-c-common]

  Some of these libraries may not be found correctly.

And then, the build eventually fails with errors:

[ 21%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/s2n/s2n_tls_channel_handler.c.o
/root/gateway/build/aws-sdk-cpp/crt/aws-crt-cpp/crt/aws-c-io/source/s2n/s2n_tls_channel_handler.c:26:14: fatal error: s2n/unstable/cleanup.h: No such file or directory
   26 | #    include <s2n/unstable/cleanup.h>
      |              ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/build.make:356: crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/s2n/s2n_tls_channel_handler.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:691: crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
[ 12%] Built target aws-c-common
[ 13%] Built target aws-checksums
[ 15%] Built target aws-c-sdkutils
[ 17%] Built target aws-c-cal
[ 18%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/s2n/s2n_tls_channel_handler.c.o
/root/gateway/build/aws-sdk-cpp/crt/aws-crt-cpp/crt/aws-c-io/source/s2n/s2n_tls_channel_handler.c:26:14: fatal error: s2n/unstable/cleanup.h: No such file or directory
   26 | #    include <s2n/unstable/cleanup.h>
      |              ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/build.make:356: crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/s2n/s2n_tls_channel_handler.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:691: crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

The full build output is attached.

Is there something I should be doing differently to build and install?
Thanks.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Build finishes successfully.

Current Behavior

Build errors out.

Reproduction Steps

Run the script given at the top on Ubuntu 24.04. May need to change the ../build path.

Possible Solution

No response

Additional Information/Context

No response

AWS CPP SDK version used

1.11.471

Compiler and Version used

13.2.0

Operating System and version

Ubuntu 24.04.1

Edit: Attaching log
aws_build_failure.log

@nabelekt nabelekt added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 20, 2024
@nabelekt
Copy link
Author

Seems related: #3219 (comment). Also s2n_tls, but I am using the latest version. The submodules should all be checked out to the correct pointers for the specified tag.

@sbiscigl
Copy link
Contributor

Ported your script to a dockerfile and seems to be working as expected.

FROM public.ecr.aws/ubuntu/ubuntu:24.04

# Install dependencies
RUN apt update
RUN apt install build-essential -y
RUN apt install git cmake libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev libpulse-dev -y

# Build and install SDK
RUN git clone --branch 1.11.471 --recurse-submodules https://github.com/aws/aws-sdk-cpp && \
    cd aws-sdk-cpp && \
    mkdir build && \
    cd build && \
    cmake -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_PREFIX_PATH=/usr/local/ \
      -DCMAKE_INSTALL_PREFIX=/usr/local/ \
      -DBUILD_ONLY="core;iot;s3;dynamodb" \
      -DLEGACY_BUILD=ON \
      -DAUTORUN_UNIT_TESTS=OFF .. && \
    cmake --build . && \
    cmake --install .

With this working in a clean environment I would suggest looking for the differences between your environment and this or starting with a clean environment. If you can update the docker file to fail, will be more than happy to take a look at it.

@sbiscigl sbiscigl added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. build-problem problems with building this sdk and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 23, 2024
@nabelekt
Copy link
Author

Thanks. I'll take a look and respond by 1/2/25.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. label Dec 24, 2024
@jmklix jmklix added the p2 This is a standard priority issue label Dec 26, 2024
@nabelekt
Copy link
Author

nabelekt commented Jan 1, 2025

I think my previous installation (v1.11.340) was interfering. This worked fine for me in the same environment:

version_to_install="1.11.476"

set -e  # Exit on error

# Remove previous installations to avoid conflicts
rm -rf /usr/local/include/aws
rm -rf /usr/local/include/s2n
rm -rf /usr/local/include/s2n*
rm -rf /usr/local/lib/aws
rm -rf /usr/local/lib/aws*
rm -rf /usr/local/lib/cmake/aws*
rm -rf /usr/local/lib/libaws*
rm -rf /usr/local/lib/libs2n*
rm -rf /usr/local/lib/pkgconfig/aws/*
rm -rf /usr/local/lib/s2n

# Make sure dependencies are installed
apt update
apt install build-essential libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev libpulse-dev -y

# Clone, build, and install the SDK
cd ../build
rm -rf aws-sdk-cpp
git clone --recurse-submodules -j8 https://github.com/aws/aws-sdk-cpp --branch $version_to_install
mkdir aws-sdk-cpp/build
cd aws-sdk-cpp/build
# After v1.12+ when legacy build will be removed,a nd the flag -DLEGACY_BUILD=ON may need to be removed
cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_PREFIX_PATH=/usr/local/ \
    -DCMAKE_INSTALL_PREFIX=/usr/local/ \
    -DBUILD_ONLY="core;iot;s3;dynamodb" \
    -DAUTORUN_UNIT_TESTS=OFF \
    -DLEGACY_BUILD=ON
cmake --build .
cmake --install .
cd ../../
rm aws-sdk-cpp -rf

echo Done installing AWS SDK C++ version $version_to_install

Feel free to close the issue. Thanks!

@sbiscigl
Copy link
Contributor

sbiscigl commented Jan 2, 2025

Feel free to close the issue. Thanks!

Nice! thanks for following up, give a shout if you have any more questions

@sbiscigl sbiscigl closed this as completed Jan 2, 2025
Copy link

github-actions bot commented Jan 2, 2025

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
build-problem problems with building this sdk p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants