Skip to content

Add support for GCC 15#802

Draft
laurynas-biveinis wants to merge 1 commit into
masterfrom
gcc-15
Draft

Add support for GCC 15#802
laurynas-biveinis wants to merge 1 commit into
masterfrom
gcc-15

Conversation

@laurynas-biveinis
Copy link
Copy Markdown
Collaborator

@laurynas-biveinis laurynas-biveinis commented Nov 17, 2025

  • Fix a warning in the codebase
  • Enable new non-default warnings
  • Bump the versions in CI, move GCC 14 to the old compilers job
  • Bump the version in the CMake preset

Summary by CodeRabbit

  • Chores
    • Updated CI to use GCC 15 across build and sanitizer variants, including renaming job labels to reflect GCC 15.
    • Added GCC 15-specific compiler warning flags to enable stricter checks when using GCC 15.
    • Improved legacy-compiler workflows: added a Noble workflow and made older-compiler installs use a dynamic version selection for testing GCC 13/14.

✏️ Tip: You can customize this high-level summary in your review settings.

@laurynas-biveinis laurynas-biveinis self-assigned this Nov 17, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 17, 2025

Walkthrough

The PR updates CI and build configuration to use GCC 15: GitHub Actions workflows replace GCC 14 with GCC 15 and parameterize an old-compiler job; CMakeLists adds GCC ≥15 version checks and new GCC 15-specific warning flags gated for standalone GNU builds.

Changes

Cohort / File(s) Summary
Main CI & CMake (GCC 14→15)
​.github/workflows/build.yml, CMakeLists.txt
Replaces GCC 14 references with GCC 15 across CI matrices and install steps; sets CC/CXX to generic gcc/g++; adds GCC_GE_15_CXX_WARNING_FLAGS (-Wleading-whitespace=spaces, -Wtrailing-whitespace=any), defines cxx_ge_15 and is_gxx_ge_15, and applies those flags conditionally in COMMON_TARGET_PROPERTIES for standalone GNU builds.
Old-compiler workflows
​.github/workflows/old-compilers-jammy.yml, ​.github/workflows/old-compilers-noble.yml
Renames Jammy workflow and parameterizes install command to use g++-${VERSION}; adds a new Noble workflow that defines a GCC 14 build matrix (Release/Debug plus optional sanitizers) and runs configure/build/test steps.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • CMake gating and new warning flags — verify condition expressions and correct application only for GNU standalone targets.
  • CI matrix and install-step changes — confirm package names (g++-15, multilib) and ubuntu-toolchain PPA usage behave across runners.
  • New Noble workflow — validate matrix entries and sanitizer/job naming.

Possibly related PRs

Suggested reviewers

  • thompsonbry

Poem

GCC fifteen strides in, bold and keen, 🚀
Whitespace warnings now on the scene,
Jammy and Noble keep watch through the night,
CI swaps versions and tests take flight,
A modest bump, compiled just right.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add support for GCC 15' directly aligns with the main changeset, which upgrades CI workflows from GCC 14 to GCC 15, adds GCC 15-specific warning flags in CMake, and introduces new compiler version checks.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch gcc-15

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@laurynas-biveinis laurynas-biveinis force-pushed the gcc-15 branch 2 times, most recently from 58d5ccc to 76dc974 Compare November 17, 2025 12:35
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 58d5ccc and 76dc974.

📒 Files selected for processing (7)
  • .circleci/config.yml (2 hunks)
  • .github/workflows/build.yml (3 hunks)
  • .github/workflows/old-compilers-jammy.yml (2 hunks)
  • .github/workflows/old-compilers-noble.yml (1 hunks)
  • CMakeLists.txt (3 hunks)
  • CMakePresets.json (1 hunks)
  • test/test_key_encode_decode.cpp (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.8)
.github/workflows/old-compilers-noble.yml

27-27: property "spinlock_loop" is not defined in object type {build_type: string; name: string; sanitize_address: string; sanitize_thread: string; sanitize_ub: string; version: number}

(expression)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (29)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
  • GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
🔇 Additional comments (13)
CMakePresets.json (1)

87-88: LGTM - Compiler version bump is correct.

The preset now points to GCC 15 toolchain, consistent with the PR's objective.

.circleci/config.yml (2)

7-7: LGTM - Default GCC version updated.


41-41: LGTM - PPA addition is necessary.

GCC 15 requires the ubuntu-toolchain-r PPA. Correctly placed before the apt-get update.

test/test_key_encode_decode.cpp (1)

351-351: LGTM - Removes redundant cast.

This addresses the warning fix mentioned in the PR description. The explicit cast was unnecessary since ~0ULL is already the correct type, and this makes it consistent with line 348.

.github/workflows/old-compilers-jammy.yml (1)

730-737: LGTM - Correctly extends support to GCC 14.

The dynamic version variable is cleaner than hardcoding, and the condition properly gates for both GCC 13 and 14 now that GCC 15 is the default.

.github/workflows/build.yml (3)

39-98: LGTM - Consistent job name updates.

All GCC-based CI jobs properly renamed to reflect the GCC 15 upgrade.


288-289: LGTM - GCC 15 installation configured correctly.

PPA addition and g++-15 package installation are properly set up.


347-347: LGTM - Version variable correctly set.

.github/workflows/old-compilers-noble.yml (1)

1-70: New workflow for GCC 14 on Noble looks good.

The structure properly covers GCC 14 testing across Release/Debug builds and sanitizer variants on Ubuntu 24.04.

CMakeLists.txt (4)

118-119: LGTM - New GCC 15 warning flags added.

The whitespace warnings are appropriate for maintaining code quality and align with the PR's objective to enable new non-default warnings.


405-405: LGTM - Version gate correctly defined.

Follows the existing pattern for compiler version checks.


412-412: LGTM - Combined gate correctly defined.

Consistent with existing version-gated patterns for other GCC versions.


718-718: LGTM - Warning flags correctly applied.

The flags are properly gated behind both the standalone condition and GCC >= 15 check, consistent with how other version-specific warning flags are applied.

Comment thread .github/workflows/old-compilers-noble.yml Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.36%. Comparing base (61773d1) to head (8799435).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #802      +/-   ##
==========================================
+ Coverage   98.30%   98.36%   +0.06%     
==========================================
  Files          35       35              
  Lines        6497     6497              
==========================================
+ Hits         6387     6391       +4     
+ Misses        110      106       -4     
Flag Coverage Δ
Debug 98.36% <ø> (+0.27%) ⬆️
Release 97.74% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Enable new non-default warnings
- Bump the versions in CI, move GCC 14 to the old compilers job, which is split
  over Jammy and Noble runners
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b041a32 and 8799435.

📒 Files selected for processing (4)
  • .github/workflows/build.yml (4 hunks)
  • .github/workflows/old-compilers-jammy.yml (2 hunks)
  • .github/workflows/old-compilers-noble.yml (1 hunks)
  • CMakeLists.txt (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (4)
.github/workflows/old-compilers-jammy.yml (1)

776-781: Clean parametrization of GCC version.

The change to g++-${VERSION} makes the step reusable across versions while maintaining the conditional guard on VERSION == '13'.

.github/workflows/old-compilers-noble.yml (1)

1-120: Well-structured GCC 14 reference platform for Noble.

The workflow correctly avoids SPINLOCK_LOOP complexity that jammy requires, keeping the noble configuration simpler and appropriate for an "old compilers" reference. GCC 14 matrix is complete across Debug/Release and sanitizer variants.

.github/workflows/build.yml (1)

39-101: Verify GCC 15 labels are accurately reflected after compiler binding fix.

Once the CC/CXX issue above is resolved, confirm that all "GCC 15" matrix names actually run with GCC 15 and not a fallback version. The label changes here are correct in spirit, but depend on the compiler setup fix.

Also applies to: 270-315

CMakeLists.txt (1)

122-123: GCC 15 warning flags properly gated and integrated.

The new flags follow the established pattern for version-gated compiler warnings: defined as constants, wrapped in generator expressions, and applied conditionally in COMMON_TARGET_PROPERTIES only when building standalone with GCC ≥15. Implementation is consistent and correct.

Also applies to: 416-416, 427-427, 740-740

Comment on lines 442 to +445
if [[ $COMPILER == "gcc" ]]; then
V=14
EXTRA_CMAKE_ARGS=()
export CC=gcc-$V
export CXX=g++-$V
export CC=gcc
export CXX=g++
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: GCC 15 build will use system default GCC, not GCC 15.

Line 444-445 removed version specifiers from CC and CXX, so the build uses gcc and g++ from $PATH (typically GCC 11 on ubuntu-latest), not the installed g++-15 from line 380. This defeats the entire PR objective of testing GCC 15.

The VERSION matrix variable becomes unused, and all GCC matrix entries will compile with whatever default GCC is on the runner.

Apply this diff to restore version binding:

          if [[ $COMPILER == "gcc" ]]; then
            EXTRA_CMAKE_ARGS=()
-           export CC=gcc
-           export CXX=g++
+           export CC=gcc-15
+           export CXX=g++-15

Alternatively, if dynamic versioning is desired (not just GCC 15):

          if [[ $COMPILER == "gcc" ]]; then
            EXTRA_CMAKE_ARGS=()
-           export CC=gcc
-           export CXX=g++
+           export CC=gcc-${VERSION}
+           export CXX=g++-${VERSION}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [[ $COMPILER == "gcc" ]]; then
V=14
EXTRA_CMAKE_ARGS=()
export CC=gcc-$V
export CXX=g++-$V
export CC=gcc
export CXX=g++
if [[ $COMPILER == "gcc" ]]; then
EXTRA_CMAKE_ARGS=()
export CC=gcc-${VERSION}
export CXX=g++-${VERSION}
🤖 Prompt for AI Agents
.github/workflows/build.yml around lines 442-445: the script currently exports
CC and CXX as unversioned gcc/g++, causing builds to use the system default GCC
(e.g., gcc-11) instead of the intended gcc-15; restore version binding by
setting CC and CXX to the versioned compiler (e.g., gcc-15 and g++-15) or use
the matrix VERSION variable (e.g., export CC=gcc-${VERSION} and export
CXX=g++-${VERSION}) so the installed compiler from earlier steps is actually
used during the build.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Dec 2, 2025

@laurynas-biveinis laurynas-biveinis marked this pull request as draft December 3, 2025 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant