diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 28be095cb3..268eff68b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,11 +13,13 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - os: [alpine-3.17, ubuntu-20.04, ubuntu-22.04] + os: [alpine-3.17, alpine-3.21, ubuntu-20.04, ubuntu-22.04] platform: [linux/amd64] include: - os: alpine-3.17 platform: linux/arm64 + - os: alpine-3.21 + platform: linux/arm64 steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/Earthfile b/Earthfile index e19cb9f550..a0f126b1cf 100644 --- a/Earthfile +++ b/Earthfile @@ -10,6 +10,16 @@ alpine-3.17: rm -rf /var/cache/apk/* RUN apk add openjdk8-jre +alpine-3.21: + FROM --platform=$BUILDPLATFORM alpine:3.21 + RUN apk add --no-progress --update git build-base zip + RUN apk --no-cache --update add libgcc libstdc++ \ + git make g++ \ + build-base gtest gtest-dev boost boost-dev protobuf protobuf-dev cmake icu icu-dev openssl \ + && \ + rm -rf /var/cache/apk/* + RUN apk add openjdk8-jre + ubuntu-20.04: FROM --platform=$BUILDPLATFORM ubuntu:20.04 RUN apt-get update && apt-get -y upgrade @@ -51,6 +61,7 @@ libphonenumber: RUN make install WORKDIR assets + RUN rm -rf lib/cmake RUN zip -r ../libphonenumber_${TARGETARCH}-${buildos}.zip * SAVE ARTIFACT /libphonenumber/cpp/build/libphonenumber_${TARGETARCH}-${buildos}.zip AS LOCAL cpp/build/libphonenumber_${TARGETARCH}-${buildos}.zip diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 27e4680ccc..48d65e98bf 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -102,10 +102,12 @@ endif () # Find all the required libraries and programs. find_package(absl) +set (ABSL_LIB absl::node_hash_set absl::strings absl::synchronization) + if(NOT absl_FOUND) # Overide abseil install rules for subprojects set(ABSL_ENABLE_INSTALL ON) - + # Downloading the abseil sources at particular version to not catch up # with its new build requirements like min C++14 is mandated in that lib. FetchContent_Declare( @@ -128,7 +130,11 @@ if(NOT absl_FOUND) # https://github.com/abseil/abseil-cpp/issues/225 set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) add_subdirectory(${abseil-cpp_SOURCE_DIR} ${abseil-cpp_BINARY_DIR}) -endif() +else () + # Alpine 3.21, absl installed by default, + # protobuf generated with ABSL_DCHECK macros, so we need 'absl_check' deps + list (APPEND ABSL_LIB absl::absl_check) +endif () if (BUILD_TESTING) include (../tools/cpp/gtest.cmake) @@ -427,7 +433,7 @@ include_directories ("src") # Collate dependencies #---------------------------------------------------------------- -set (LIBRARY_DEPS ${ICU_LIB} ${PROTOBUF_LIB} absl::node_hash_set absl::strings absl::synchronization) +set (LIBRARY_DEPS ${ICU_LIB} ${PROTOBUF_LIB} ${ABSL_LIB}) if (USE_BOOST) list (APPEND LIBRARY_DEPS ${Boost_LIBRARIES})