This is an automated email from the ASF dual-hosted git repository.
BewareMyPower pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-client-cpp.git
The following commit(s) were added to refs/heads/main by this push:
new 0711b31 Use C++20-capable toolchains in the deb/rpm package build
images (#599)
0711b31 is described below
commit 0711b3171a9ead96ad8b564d54f92735dfad856d
Author: Matteo Merli <[email protected]>
AuthorDate: Mon Jun 29 03:02:30 2026 -0700
Use C++20-capable toolchains in the deb/rpm package build images (#599)
---
pkg/deb/Dockerfile | 2 +-
pkg/rpm/Dockerfile | 5 +++++
pkg/rpm/SPECS/pulsar-client.spec | 4 ++++
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/pkg/deb/Dockerfile b/pkg/deb/Dockerfile
index 4d0212d..6be5911 100644
--- a/pkg/deb/Dockerfile
+++ b/pkg/deb/Dockerfile
@@ -19,7 +19,7 @@
# Build pulsar client library in Centos with tools to
-FROM debian:11
+FROM debian:12
ARG PLATFORM
diff --git a/pkg/rpm/Dockerfile b/pkg/rpm/Dockerfile
index d3475cf..6fcb26f 100644
--- a/pkg/rpm/Dockerfile
+++ b/pkg/rpm/Dockerfile
@@ -23,9 +23,14 @@ FROM rockylinux:8
ARG PLATFORM
+# gcc-toolset-12 supplies GCC 12 for the C++20 scalable-topics code (concepts,
+# coroutines, `using enum`) while keeping the el8 / glibc 2.28 ABI, so the
produced
+# RPM still runs on RHEL/Rocky/CentOS 8. It is enabled in the spec %build via
+# `source /opt/rh/gcc-toolset-12/enable`.
RUN yum update -y && \
yum install -y \
gcc-c++ \
+ gcc-toolset-12 \
make \
rpm-build \
which \
diff --git a/pkg/rpm/SPECS/pulsar-client.spec b/pkg/rpm/SPECS/pulsar-client.spec
index 425eec5..ff5a6ff 100644
--- a/pkg/rpm/SPECS/pulsar-client.spec
+++ b/pkg/rpm/SPECS/pulsar-client.spec
@@ -53,6 +53,10 @@ static library.
%setup -q -n apache-pulsar-client-cpp-%{pom_version}
%build
+# Build with GCC 12 from gcc-toolset-12 (installed in the build image) for
C++20
+# support, while keeping the el8 ABI. Sets PATH/LD_LIBRARY_PATH to the toolset
for
+# the cmake build below.
+source /opt/rh/gcc-toolset-12/enable
git clone https://github.com/microsoft/vcpkg.git
cmake -B build -DINTEGRATE_VCPKG=ON -DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=OFF -DBUILD_DYNAMIC_LIB=ON -DBUILD_STATIC_LIB=ON