-
Notifications
You must be signed in to change notification settings - Fork 86
Use C++20-capable toolchains in the deb/rpm package build images#599
Open
merlimat wants to merge 1 commit into
Open
Use C++20-capable toolchains in the deb/rpm package build images #599merlimat wants to merge 1 commit into
merlimat wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The scalable-topics SDK (
pulsar::st, #598) targets C++20 — it uses concepts, coroutine-awaitableFuture<T>, andusing 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:rockylinux:8ships GCC 8.5, which has no-std=c++20(CMake falls back to-std=c++2a,__cplusplus=201709), so theCxx20.hguard#errors.debian:11ships GCC 10, which clears the guard but lacksusing enum(a GCC 11 feature), so it fails to compileError.h.This bumps the package-build toolchains to GCC 11+ while preserving distro compatibility where it matters.
What changed
debian:11(GCC 10)debian:12(GCC 12)rockylinux:8(GCC 8.5)rockylinux:8+gcc-toolset-12(GCC 12)alpine:3.19(GCC 13)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-12provides GCC 12 against the el8 ABI; it's enabled in the spec%buildwithsource /opt/rh/gcc-toolset-12/enable, and ships its own staticlibstdc++for the staticlibpulsar.a. The Debian image had no equivalent (bullseye can't install GCC 11+ from its repos), so it moves todebian: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:
gcc-toolset-12installs alongside the el8powertools/develrepos.pulsar::stexamples with-std=c++20 -Wextra -Werrorunder debian:12 (GCC 12.2.0) and gcc-toolset-12 on rockylinux:8 (GCC 12.2.1) — all pass.. /opt/rh/gcc-toolset-12/enableworks under/bin/sh(what rpmbuild's%builduses) and that the toolset provides a staticlibstdc++.afor-static-libstdc++.Notes
pulsar::stcode requires C++20.apk/Alpine already ships GCC 13, so it needed no change.