From 260aefb220409ac5317111aadf281a5b5262e1ef Mon Sep 17 00:00:00 2001 From: Bryan Moffatt Date: Tue, 30 Nov 2021 12:13:59 -0800 Subject: [PATCH 1/5] add files for running the CI tests on alpine linux --- ci/codebuild/alpine-3.15.yml | 16 ++++++++++++++++ ci/docker/alpine-linux-3.15 | 5 +++++ ci/docker/alpine-linux-3.8 | 5 ----- 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 ci/codebuild/alpine-3.15.yml create mode 100644 ci/docker/alpine-linux-3.15 delete mode 100644 ci/docker/alpine-linux-3.8 diff --git a/ci/codebuild/alpine-3.15.yml b/ci/codebuild/alpine-3.15.yml new file mode 100644 index 0000000..6954b97 --- /dev/null +++ b/ci/codebuild/alpine-3.15.yml @@ -0,0 +1,16 @@ +version: 0.2 +# This uses the docker image specified in ci/docker/alpine-linux-3.15 +phases: + pre_build: + commands: + - pip install awscli + - ci/codebuild/build-cpp-sdk.sh + build: + commands: + - echo Build started on `date` + - ci/codebuild/build.sh -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_TESTS=ON -DTEST_RESOURCE_PREFIX=alpine315 + - ci/codebuild/run-tests.sh aws-lambda-package-lambda-test-fun alpine315 + post_build: + commands: + - echo Build completed on `date` + diff --git a/ci/docker/alpine-linux-3.15 b/ci/docker/alpine-linux-3.15 new file mode 100644 index 0000000..d06544b --- /dev/null +++ b/ci/docker/alpine-linux-3.15 @@ -0,0 +1,5 @@ +FROM alpine:3.15 + +RUN apk update; apk add g++ cmake git bash py3-pip libexecinfo-dev ninja curl-dev zlib-dev zip + +RUN git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp.git diff --git a/ci/docker/alpine-linux-3.8 b/ci/docker/alpine-linux-3.8 deleted file mode 100644 index a042e4c..0000000 --- a/ci/docker/alpine-linux-3.8 +++ /dev/null @@ -1,5 +0,0 @@ -FROM alpine:latest - -RUN apk update; apk add g++ cmake git ninja curl-dev zlib-dev - -RUN git clone https://github.com/aws/aws-sdk-cpp.git From 1c8f35aa062c27c537219c96c3fe6f84aca42655 Mon Sep 17 00:00:00 2001 From: Bryan Moffatt Date: Tue, 30 Nov 2021 12:16:00 -0800 Subject: [PATCH 2/5] ensure that libexecinfo is linked in builds not using glibc --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce7296e..01e6313 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,9 @@ endif() target_include_directories(${PROJECT_NAME} PRIVATE ${CURL_INCLUDE_DIRS}) +find_package(Backtrace REQUIRED) +target_link_libraries(${PROJECT_NAME} PRIVATE ${Backtrace_LIBRARIES}) + target_compile_options(${PROJECT_NAME} PRIVATE "-fno-exceptions" "-fno-rtti" From 94c38f9d401ba554813933bc8a5a4d1f802b7831 Mon Sep 17 00:00:00 2001 From: Ildar Sagdejev Date: Thu, 25 Nov 2021 18:46:58 -0500 Subject: [PATCH 3/5] busybox grep doesn't know -F as --fixed-strings (cherry picked from commit 935f4f59efe170c75e4e7ab5543bdff245a77d5b) --- packaging/packager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/packager b/packaging/packager index f5a3c8b..cf384da 100755 --- a/packaging/packager +++ b/packaging/packager @@ -61,7 +61,7 @@ function pluck_so_files() { } function package_libc_alpine() { - if grep --fixed-strings "Alpine Linux" < /etc/os-release > /dev/null; then + if grep -F "Alpine Linux" < /etc/os-release > /dev/null; then if type apk > /dev/null 2>&1; then apk info --contents musl 2>/dev/null | pluck_so_files | sed 's/^/\//' fi From f0418e4dd83889c0f43276685d176ac7d4bcd247 Mon Sep 17 00:00:00 2001 From: Ildar Sagdejev Date: Tue, 30 Nov 2021 09:21:48 -0500 Subject: [PATCH 4/5] Added comment that explains -F flag (cherry picked from commit c1480f79b139ee3f427f12e25dfd09f24e89236c) --- packaging/packager | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/packager b/packaging/packager index cf384da..0c4e749 100755 --- a/packaging/packager +++ b/packaging/packager @@ -61,6 +61,7 @@ function pluck_so_files() { } function package_libc_alpine() { + # -F matches a fixed string rather than a regex (grep that comes with busybox doesn't know --fixed-strings) if grep -F "Alpine Linux" < /etc/os-release > /dev/null; then if type apk > /dev/null 2>&1; then apk info --contents musl 2>/dev/null | pluck_so_files | sed 's/^/\//' From a6fe7926ff77f89a4bc4da9db89def1ed055d60c Mon Sep 17 00:00:00 2001 From: Bryan Moffatt Date: Thu, 2 Dec 2021 11:02:27 -0800 Subject: [PATCH 5/5] update dockerfile --- ci/docker/alpine-linux-3.15 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/docker/alpine-linux-3.15 b/ci/docker/alpine-linux-3.15 index d06544b..8b0837e 100644 --- a/ci/docker/alpine-linux-3.15 +++ b/ci/docker/alpine-linux-3.15 @@ -1,5 +1,5 @@ FROM alpine:3.15 -RUN apk update; apk add g++ cmake git bash py3-pip libexecinfo-dev ninja curl-dev zlib-dev zip +RUN apk add --no-cache g++ cmake git bash py3-pip libexecinfo-dev ninja curl-dev zlib-dev zip RUN git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp.git