Skip to content

Commit d9cbd5a

Browse files
avikivitytravisdowns
authored andcommitted
build: update supported C++ standards to C++23, C++26
Since C++26 was completed [1], we retire C++20 support and introduce C++26. The tests matrix was regenerated. Cooking fmt version updated to 12.2.0 to include a bug fix for std::optional formatting with C++26 [2]. The build environment for testing was updated to cook fmt for C++26, not just clang. [1] https://herbsutter.com/2026/03/29/c26-is-done-trip-report-march-2026-iso-c-standards-meeting-london-croydon-uk/ [2] fmtlib/fmt#4760 Closes scylladb#3462
1 parent 616e09e commit d9cbd5a

6 files changed

Lines changed: 21 additions & 22 deletions

File tree

.github/workflows/gen-matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
[f"clang++-{v}" for v in CLANG_VERSIONS]
6363
+ [f"g++-{v}" for v in GCC_VERSIONS]
6464
)
65-
STANDARDS: list[int] = [20, 23]
65+
STANDARDS: list[int] = [23, 26]
6666
MODES: list[str] = ["debug", "release", "sanitize"]
6767
ARCHS: list[str] = ["x86", "arm"]
6868

.github/workflows/install-build-env.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,17 @@ if [[ "$ENABLE_CCACHE" != "false" ]]; then
8787
ccache_opt=(--compiler-cache=ccache)
8888
fi
8989

90-
# --cook fmt for clang >= 20: the system libfmt-dev on ubuntu:26.04 is
90+
# --cook fmt for clang >= 20 or C++26: the system libfmt-dev on ubuntu:26.04 is
9191
# 10.1.1, and clang-20+ enforces consteval strictly enough to reject
92-
# fmt/chrono.h's FMT_STRING("{:.{}f}") path. The gcc matrix items
93-
# work fine with the system fmt. The check is version-guarded rather
92+
# fmt/chrono.h's FMT_STRING("{:.{}f}") path. C++26 requires a fmt fix
93+
# for std::optional formatting (https://github.com/fmtlib/fmt/issues/4760)
94+
# The check is version-guarded rather
9495
# than blanket-applied so future pre-20 clang versions in the matrix
9596
# don't pay the build cost.
9697
cook_args=()
97-
if [[ "$COMPILER" == clang++-* ]]; then
98-
clang_ver="${COMPILER#clang++-}"
99-
if [ "$clang_ver" -ge 20 ]; then
100-
cook_args=(--cook fmt)
101-
fi
98+
clang_ver="${COMPILER#clang++-}"
99+
if [[ "$COMPILER" == clang++-* && "$clang_ver" -ge 20 || "$STANDARD" -ge 26 ]] ; then
100+
cook_args=(--cook fmt)
102101
fi
103102

104103
group "configure.py"

.github/workflows/tests.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ jobs:
2222
# This include block is AUTOGENERATED, do not edit by hand
2323
# instead edit + re-run .github/workflows/gen-matrix.py
2424
include:
25-
- {compiler: clang++-21, standard: 20, mode: debug, arch: x86}
26-
- {compiler: clang++-22, standard: 23, mode: release, arch: x86}
27-
- {compiler: g++-15, standard: 23, mode: release, arch: arm}
28-
- {compiler: g++-16, standard: 20, mode: release, arch: arm}
29-
- {compiler: g++-16, standard: 23, mode: release, arch: x86}
30-
- {compiler: g++-15, standard: 20, mode: release, arch: x86}
31-
- {compiler: clang++-22, standard: 20, mode: sanitize, arch: arm}
32-
- {compiler: clang++-21, standard: 23, mode: sanitize, arch: x86}
33-
- {compiler: clang++-21, standard: 23, mode: debug, arch: arm}
25+
- {compiler: clang++-21, standard: 23, mode: debug, arch: x86}
26+
- {compiler: clang++-22, standard: 26, mode: release, arch: x86}
27+
- {compiler: g++-15, standard: 26, mode: release, arch: arm}
28+
- {compiler: g++-16, standard: 23, mode: release, arch: arm}
29+
- {compiler: g++-16, standard: 26, mode: release, arch: x86}
30+
- {compiler: g++-15, standard: 23, mode: release, arch: x86}
31+
- {compiler: clang++-22, standard: 23, mode: sanitize, arch: arm}
32+
- {compiler: clang++-21, standard: 26, mode: sanitize, arch: x86}
33+
- {compiler: clang++-21, standard: 26, mode: debug, arch: arm}
3434
- {compiler: clang++-22, standard: 23, arch: x86, mode: dev}
3535
- {compiler: clang++-22, standard: 23, arch: x86, mode: release, enables: --enable-dpdk, options: --cook dpdk --dpdk-machine corei7-avx, info: 'dpdk, '}
3636
- {compiler: clang++-22, standard: 23, arch: x86, mode: debug, enables: --enable-cxx-modules, enable-ccache: false, info: 'modules, '}

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ set (CMAKE_CXX_FLAGS_SANITIZE
145145
FORCE)
146146

147147
set (CMAKE_CXX_STANDARD
148-
"23"
148+
"26"
149149
CACHE
150150
STRING
151151
"C++ standard to build with.")

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def identify_best_standard(cpp_standards, compiler):
244244

245245

246246
if not args.cpp_standard:
247-
cpp_standards = ['23', '20']
247+
cpp_standards = ['26', '23']
248248
args.cpp_standard = identify_best_standard(cpp_standards, compiler=args.cxx)
249249

250250
# Resolve compiler cache

cooking_recipe.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ cooking_ingredient (dpdk
309309

310310
cooking_ingredient (fmt
311311
EXTERNAL_PROJECT_ARGS
312-
URL https://github.com/fmtlib/fmt/archive/11.2.0.tar.gz
313-
URL_MD5 2f3701cada629ca455c3388d1089f5bd
312+
URL https://github.com/fmtlib/fmt/archive/12.2.0.tar.gz
313+
URL_MD5 7be257d8bfad55bc9eabb1288ad895be
314314
CMAKE_ARGS
315315
-DFMT_DOC=OFF
316316
-DFMT_TEST=OFF)

0 commit comments

Comments
 (0)