From cb701bf146b6ca0bc89d761cac2cac193dae0707 Mon Sep 17 00:00:00 2001 From: Aleksandr Golubov Date: Wed, 2 Jul 2025 16:53:39 +0500 Subject: [PATCH 1/4] Added Alpine 3.21 build target --- .github/workflows/release.yml | 4 +++- Earthfile | 10 ++++++++++ cpp/CMakeLists.txt | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) 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..f894bac8bd 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 diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 27e4680ccc..919d3f3c5d 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -105,7 +105,7 @@ find_package(absl) 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( @@ -427,7 +427,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::absl_check absl::node_hash_set absl::strings absl::synchronization) if (USE_BOOST) list (APPEND LIBRARY_DEPS ${Boost_LIBRARIES}) From a9c2691919a2282958c90d51f5be63f5e05eed73 Mon Sep 17 00:00:00 2001 From: Aleksandr Golubov Date: Wed, 2 Jul 2025 18:06:42 +0500 Subject: [PATCH 2/4] Include 'absl::absl_check' deps for Alpine 3.21 --- cpp/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 919d3f3c5d..48d65e98bf 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -102,6 +102,8 @@ 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) @@ -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::absl_check 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}) From d1b6abc09e5cf228fee389825d0ff415aab350dd Mon Sep 17 00:00:00 2001 From: Aleksandr Golubov Date: Thu, 3 Jul 2025 14:00:15 +0500 Subject: [PATCH 3/4] remove extra build artifact --- Earthfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Earthfile b/Earthfile index f894bac8bd..4662fd0f77 100644 --- a/Earthfile +++ b/Earthfile @@ -61,6 +61,7 @@ libphonenumber: RUN make install WORKDIR assets + RUN rm -rf 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 From 6f19a15aa60b0a37cedc86bac13a444b8ee504e9 Mon Sep 17 00:00:00 2001 From: Aleksandr Golubov Date: Thu, 3 Jul 2025 14:37:08 +0500 Subject: [PATCH 4/4] remove extra build artifact --- Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Earthfile b/Earthfile index 4662fd0f77..a0f126b1cf 100644 --- a/Earthfile +++ b/Earthfile @@ -61,7 +61,7 @@ libphonenumber: RUN make install WORKDIR assets - RUN rm -rf cmake + 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