Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use C++20-capable toolchains in the deb/rpm package build images#599

Open
merlimat wants to merge 1 commit into
apache:main from
merlimat:update-build-images-cpp20
Open

Use C++20-capable toolchains in the deb/rpm package build images #599
merlimat wants to merge 1 commit into
apache:main from
merlimat:update-build-images-cpp20

Conversation

@merlimat

@merlimat merlimat commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Why

The scalable-topics SDK (pulsar::st, #598) targets C++20 — it uses concepts, coroutine-awaitable Future<T>, and using enum. The last of these needs GCC 11+. The package-build images shipped older compilers, so two package jobs failed compiling the C++20 examples:

  • RPMrockylinux:8 ships GCC 8.5, which has no -std=c++20 (CMake falls back to -std=c++2a, __cplusplus=201709), so the Cxx20.h guard #errors.
  • Debdebian:11 ships GCC 10, which clears the guard but lacks using enum (a GCC 11 feature), so it fails to compile Error.h.

This bumps the package-build toolchains to GCC 11+ while preserving distro compatibility where it matters.

What changed

Image Before After Min OS for the artifact
deb debian:11 (GCC 10) debian:12 (GCC 12) Debian 12 / glibc 2.36
rpm rockylinux:8 (GCC 8.5) rockylinux:8 + gcc-toolset-12 (GCC 12) unchanged — RHEL/Rocky/CentOS 8
apk alpine:3.19 (GCC 13) unchanged

For the RPM I deliberately kept the el8 base so the published RPM still runs on RHEL/Rocky/CentOS 8 (glibc 2.28). gcc-toolset-12 provides GCC 12 against the el8 ABI; it's enabled in the spec %build with source /opt/rh/gcc-toolset-12/enable, and ships its own static libstdc++ for the static libpulsar.a. The Debian image had no equivalent (bullseye can't install GCC 11+ from its repos), so it moves to debian:12 — i.e. the deb artifact now requires Debian 12+, while the RPM keeps el8 support.

Verification

Done locally against the real toolchains, not just a syntax check:

  • Built both images from the updated Dockerfiles — all packages resolve on the new bases; gcc-toolset-12 installs alongside the el8 powertools/devel repos.
  • Compiled all four pulsar::st examples with -std=c++20 -Wextra -Werror under debian:12 (GCC 12.2.0) and gcc-toolset-12 on rockylinux:8 (GCC 12.2.1) — all pass.
  • Confirmed . /opt/rh/gcc-toolset-12/enable works under /bin/sh (what rpmbuild's %build uses) and that the toolset provides a static libstdc++.a for -static-libstdc++.

Notes

  • This is the prerequisite that unblocks the package-build jobs on #598. The library itself remains C++17; only the new pulsar::st code requires C++20.
  • apk/Alpine already ships GCC 13, so it needed no change.

The scalable-topics SDK (pulsar::st) requires C++20 -- concepts, coroutines
and `using enum` -- which needs GCC 11+. The package-build images shipped
older compilers, so the RPM (rockylinux:8 / GCC 8.5) and Deb (debian:11 /
GCC 10, no `using enum`) builds failed compiling the st examples.
- deb: bump debian:11 -> debian:12 (default GCC 12).
- rpm: keep rockylinux:8 to preserve the el8 / glibc-2.28 ABI (so the RPM
 still runs on RHEL/Rocky/CentOS 8) and install gcc-toolset-12 (GCC 12),
 enabled in the spec %build via 'source /opt/rh/gcc-toolset-12/enable'.
 The toolset ships its own static libstdc++ for libpulsar.a.
- apk (alpine:3.19) already provides GCC 13; unchanged.
Verified by building both images and compiling the st examples with
-std=c++20 under debian:12 and gcc-toolset-12 on rockylinux:8.
Signed-off-by: Matteo Merli <mmerli@apache.org>
@merlimat merlimat marked this pull request as ready for review June 25, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /