From faa87ec85f68f483f017e6bee3f799a2047dd09c Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Fri, 1 Nov 2024 14:11:43 -0700 Subject: [PATCH 1/5] test shared-libs with many old compilers --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fc023abd..59d7661af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,7 +84,7 @@ jobs: - name: Build ${{ env.PACKAGE_NAME }} run: | aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh - ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }} --cmake-extra=-DUSE_OPENSSL=ON + ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }} --cmake-extra=-DUSE_OPENSSL=ON --cmake-extra=-DBUILD_SHARED_LIBS=ON raspberry: runs-on: ubuntu-22.04 # latest From b9fd554ef65437698c266d16d6893df87dc30d4a Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Fri, 1 Nov 2024 14:17:59 -0700 Subject: [PATCH 2/5] keep going --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59d7661af..501cb0703 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,11 @@ env: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: us-east-1 +# cancel in-progress builds after a new commit +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: linux-compat-use-openssl: runs-on: ubuntu-22.04 # latest @@ -62,6 +67,7 @@ jobs: linux-compiler-compat: runs-on: ubuntu-22.04 # latest strategy: + fail-fast: false matrix: compiler: - clang-3 From 94825418a281aac159807cae4ffd36cf821b30da Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Fri, 1 Nov 2024 14:40:54 -0700 Subject: [PATCH 3/5] run shared-libs CI with gcc-4.8 --- .github/workflows/ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 501cb0703..a41c629a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,6 @@ jobs: linux-compiler-compat: runs-on: ubuntu-22.04 # latest strategy: - fail-fast: false matrix: compiler: - clang-3 @@ -90,7 +89,7 @@ jobs: - name: Build ${{ env.PACKAGE_NAME }} run: | aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh - ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }} --cmake-extra=-DUSE_OPENSSL=ON --cmake-extra=-DBUILD_SHARED_LIBS=ON + ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }} --cmake-extra=-DUSE_OPENSSL=ON raspberry: runs-on: ubuntu-22.04 # latest @@ -134,12 +133,16 @@ jobs: linux-shared-libs: runs-on: ubuntu-22.04 # latest + strategy: + matrix: + compiler: [gcc-4.8, gcc-11] # oldest, latest + steps: # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages - name: Build ${{ env.PACKAGE_NAME }} run: | aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh - ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBUILD_SHARED_LIBS=ON + ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }} --cmake-extra=-DBUILD_SHARED_LIBS=ON linux-openssl-static: runs-on: ubuntu-22.04 # latest From edfed1419841cd20bd21c0421861329f2deb2aad Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Fri, 1 Nov 2024 14:49:50 -0700 Subject: [PATCH 4/5] this fixes the test crashes --- .github/workflows/ci.yml | 1 - include/aws/crt/StlAllocator.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a41c629a1..37879946f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -136,7 +136,6 @@ jobs: strategy: matrix: compiler: [gcc-4.8, gcc-11] # oldest, latest - steps: # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages - name: Build ${{ env.PACKAGE_NAME }} diff --git a/include/aws/crt/StlAllocator.h b/include/aws/crt/StlAllocator.h index 0c45d0d53..0358e9f78 100644 --- a/include/aws/crt/StlAllocator.h +++ b/include/aws/crt/StlAllocator.h @@ -17,7 +17,7 @@ namespace Aws * Stateful allocator variant that uses an underlying CRT allocator * @tparam T type that allocator can allocate */ - template class StlAllocator : public std::allocator + template class AWS_CRT_CPP_API StlAllocator : public std::allocator { public: using Base = std::allocator; From 34f86fb2fecd95aecab928c9084495a66133ff04 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Fri, 1 Nov 2024 17:01:39 -0700 Subject: [PATCH 5/5] let's try simply not touching visibility for GCC 4.x --- CMakeLists.txt | 8 +++++++- include/aws/crt/StlAllocator.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 560ed5259..7b703140a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -302,7 +302,13 @@ endif() set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD ${CMAKE_CXX_STANDARD}) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON) + +# Hide symbols by default +# Except for ancient GCC, because it leads to crashes in shared-lib builds +# see: https://github.com/awslabs/aws-crt-cpp/pull/675 +if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")) + set_target_properties(${PROJECT_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON) +endif() aws_prepare_symbol_visibility_args(${PROJECT_NAME} "AWS_CRT_CPP") diff --git a/include/aws/crt/StlAllocator.h b/include/aws/crt/StlAllocator.h index 0358e9f78..0c45d0d53 100644 --- a/include/aws/crt/StlAllocator.h +++ b/include/aws/crt/StlAllocator.h @@ -17,7 +17,7 @@ namespace Aws * Stateful allocator variant that uses an underlying CRT allocator * @tparam T type that allocator can allocate */ - template class AWS_CRT_CPP_API StlAllocator : public std::allocator + template class StlAllocator : public std::allocator { public: using Base = std::allocator;