diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83806c1..60e394c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ env: jobs: linux-compat: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 # latest strategy: fail-fast: false matrix: @@ -39,7 +39,7 @@ jobs: ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }} downstream linux-compiler-compat: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 # latest strategy: matrix: compiler: @@ -62,7 +62,7 @@ jobs: ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }} --spec downstream clang-sanitizers: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 # latest strategy: matrix: sanitizers: [",thread", ",address,undefined"] @@ -74,7 +74,7 @@ jobs: ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=clang-11 --cmake-extra=-DENABLE_SANITIZERS=ON --cmake-extra=-DSANITIZERS="${{ matrix.sanitizers }}" linux-shared-libs: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 # latest steps: # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages - name: Build ${{ env.PACKAGE_NAME }} @@ -83,7 +83,7 @@ jobs: ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBUILD_SHARED_LIBS=ON windows: - runs-on: windows-latest + runs-on: windows-2022 # latest steps: - name: Build ${{ env.PACKAGE_NAME }} + consumers run: | @@ -91,7 +91,7 @@ jobs: python builder.pyz build -p ${{ env.PACKAGE_NAME }} windows-vc14: - runs-on: windows-latest + runs-on: windows-2019 # windows-2019 is last env with Visual Studio 2015 (v14.0) strategy: matrix: arch: [x86, x64] @@ -102,7 +102,7 @@ jobs: python builder.pyz build -p ${{ env.PACKAGE_NAME }} --target windows-${{ matrix.arch }} --compiler msvc-14 windows-shared-libs: - runs-on: windows-latest + runs-on: windows-2022 # latest steps: - name: Build ${{ env.PACKAGE_NAME }} + consumers run: | @@ -110,7 +110,7 @@ jobs: python builder.pyz build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBUILD_SHARED_LIBS=ON osx: - runs-on: macos-latest + runs-on: macos-11 # latest steps: - name: Build ${{ env.PACKAGE_NAME }} + consumers run: | diff --git a/source/sdkutils.c b/source/sdkutils.c index 8ae93f1..666e74f 100644 --- a/source/sdkutils.c +++ b/source/sdkutils.c @@ -31,7 +31,13 @@ static struct aws_log_subject_info_list s_sdkutils_log_subjects = { .count = AWS_ARRAY_SIZE(s_log_subject_infos), }; +static int s_library_init_count = 0; + void aws_sdkutils_library_init(struct aws_allocator *allocator) { + if (s_library_init_count++ != 0) { + return; + } + aws_common_library_init(allocator); aws_register_error_info(&s_sdkutils_error_info); @@ -39,6 +45,10 @@ void aws_sdkutils_library_init(struct aws_allocator *allocator) { } void aws_sdkutils_library_clean_up(void) { + if (--s_library_init_count != 0) { + return; + } + aws_unregister_log_subject_info_list(&s_sdkutils_log_subjects); aws_unregister_error_info(&s_sdkutils_error_info);