Skip to content

Remove Ubuntu 20.04 job from GitHub Actions [circle skip]#790

Merged
laurynas-biveinis merged 1 commit into
masterfrom
rm-ubuntu-20.04
Apr 21, 2025
Merged

Remove Ubuntu 20.04 job from GitHub Actions [circle skip]#790
laurynas-biveinis merged 1 commit into
masterfrom
rm-ubuntu-20.04

Conversation

@laurynas-biveinis
Copy link
Copy Markdown
Collaborator

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

Move the tested compiler versions there to old-compilers.yml.

Summary by CodeRabbit

  • Chores
    • Expanded CI test coverage with detailed build configurations for Clang 11, Clang 12, and GCC 10 including sanitizer variants.
    • Updated dependency installation steps to support a wider range of LLVM and GCC versions in CI workflows.
    • Removed the Ubuntu 20.04-specific CI workflow, consolidating build and test processes.
    • Enhanced build configuration error reporting by displaying detailed logs on failure.
    • Added a workaround for Clang 11 UBSan issues on Ubuntu 22.04 to improve sanitizer stability.

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

coderabbitai Bot commented Apr 17, 2025

Walkthrough

This change updates the GitHub Actions CI configuration by expanding the build matrix in .github/workflows/old-compilers.yml to include Clang 11, Clang 12, and GCC 10, each with Release/Debug and sanitizer variants (ASan, TSan, UBSan). It also adjusts dependency installation logic to cover these compiler versions. Simultaneously, the ubuntu-20.04.yml workflow is deleted, consolidating all older compiler and sanitizer testing into the remaining workflow. Additionally, the CMake configuration step in .github/workflows/build.yml was enhanced to capture and display CMake error logs on failure. No source code or public API changes are involved.

Changes

File(s) Change Summary
.github/workflows/old-compilers.yml Expanded build matrix to add Clang 11, Clang 12, and GCC 10 (with Release/Debug and sanitizer variants); updated dependency installation logic for LLVM and GCC versions; renamed and conditioned LLVM setup steps; enhanced CMake step to capture exit code and print diagnostic logs on failure.
.github/workflows/ubuntu-20.04.yml Deleted workflow that previously handled CI for Ubuntu 20.04 with older compilers and sanitizer configurations.
.github/workflows/build.yml Improved CMake configuration step to disable set -e before running cmake, capture exit code, print CMake error and output logs on failure, and exit immediately to prevent further steps.
CMakeLists.txt Added detection for Clang 11 compiler version; implemented a workaround for LLVM bug #55785 affecting UBSan on Clang 11 by setting SANITIZER_ENV and UBSAN_OPTIONS accordingly; fixed a variable name typo in version comparison.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Job Matrix
    participant Build Steps

    GitHub Actions->>Job Matrix: Expand with Clang 11, 12, GCC 10 (Release/Debug, Sanitizers)
    Job Matrix->>Build Steps: For each configuration, run checkout, setup, build, and test
    Build Steps->>Build Steps: Install dependencies (LLVM/GCC) as per version
    Build Steps->>Build Steps: Configure and build with CMake/make
    Build Steps->>Build Steps: If CMake fails, print CMakeError.log and CMakeOutput.log, then exit
    Build Steps->>Build Steps: Run tests and benchmarks
Loading

Possibly related PRs

Suggested reviewers

  • thompsonbry

Poem

Old compilers march back in line,
Sanitizers ready, debug or fine.
Ubuntu 20.04 bows out with grace,
One workflow now takes its place.
Matrix grows, the tests resume—
CI’s orchestra, in perfect tune! 🎶🐇


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 3

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 544dd12 and 1921180.

📒 Files selected for processing (2)
  • .github/workflows/old-compilers.yml (4 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
⏰ Context from checks skipped due to timeout of 90000ms (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 (1)
.github/workflows/old-compilers.yml (1)

644-656:

Details

✅ Verification successful

Verify numeric comparisons and package coverage.

  • GitHub Actions treats env vars as strings; env.VERSION <= 13 may perform lexicographical comparison. Confirm this works for all version values.
  • The llvm-toolchain repo step installs clang-${VERSION} (C compiler) but doesn’t guarantee clang++-${VERSION}. Make sure C++ compiler is available for CMake.

🌐 Web query:

Does GitHub Actions compare env.VERSION <= 13 numerically or lexicographically?

💡 Result:

When you compare values like (\text{env.VERSION} <= 13) in GitHub Actions, the evaluation depends on the data type of (\text{env.VERSION}).

By default, all environment variables in GitHub Actions (such as (\text{env.VERSION})) are strings. If you write a comparison like:

if: env.VERSION <= 13

GitHub Actions will generally attempt to coerce both sides to numbers if possible. According to the documentation, when you use relational operators ((<, >, <=, >=)), GitHub Actions first tries to interpret string values as numbers using a loose conversion (via fromJSON() internally). This means:

  • If (\text{env.VERSION}) is the string "12", it will be parsed as the number 12 and compared numerically.
  • If (\text{env.VERSION}) is the string "13", it will become the number 13, and "13" <= 13 evaluates to true.
  • If (\text{env.VERSION}) is "13.1", "14", or "12.9", it is compared as a number, so "12.9" <= 13 is true, but "14" <= 13 is false.
  • If (\text{env.VERSION}) is a non-numeric string (like "beta"), it will be converted to NaN, and any comparison with NaN is false[7].

If the string cannot be converted to a number (for example, "v1.2.3"), the value becomes NaN, and comparisons like (\text{env.VERSION} <= 13) always result in false[7].

Lexicographical vs. Numerical Comparison:

  • Numerical: GitHub Actions attempts numerical comparison if both operands can be parsed as numbers[7].
  • Lexicographical: If either value is not a numeric string (e.g., version strings like "1.10.0" vs "1.2.0"), coercion fails, resulting in NaN, so relational comparisons do not work as expected in those cases[7][10].

For comparing actual semantic version numbers (like "1.10.0" vs "1.2.0"), you should use a dedicated version comparison tool or action (e.g., actions that handle semantic versioning), because numeric coercion will not yield correct results for multi-part versions[1][3][6].

Summary Table

env.VERSION Value Comparison Result type Example outcome
"13" <= 13 Numeric (13 <= 13) true
"12" <= 13 Numeric (12 <= 13) true
"13.1" <= 13 Numeric (13.1 <= 13) false
"beta" <= 13 NaN comparison false
"1.10.0" <= 13 NaN comparison false

Best Practice

If you need to compare semantic versions or dotted strings, use a dedicated action or script that correctly parses and compares version components, since simple comparisons in GitHub Actions do not handle versions lexicographically or semantically[1][3][6].

In summary: GitHub Actions compares (\text{env.VERSION} <= 13) numerically if possible. If (\text{env.VERSION}) cannot be coerced to a number, the result is always false, and lexicographical comparison is not performed by default[7][10].

Citations:


🏁 Script executed:

#!/bin/bash
set -e
# Locate matrix definition and VERSION usages in the workflow
rg -n "matrix" .github/workflows/old-compilers.yml || true
rg -n "VERSION" .github/workflows/old-compilers.yml

Length of output: 4236


Both numeric comparisons and C++ compiler are already covered

  • GitHub Actions relational operators coerce string values like "10""19" to numbers, so (env.VERSION <= 13 || env.VERSION >= 15) works as intended.
  • The clang‑${VERSION} meta‐package from apt.llvm.org provides both clang-${VERSION} and the clang++-${VERSION} driver, so you get out‑of‑the‑box C++ support for CMake.

No changes required here.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.23%. Comparing base (0ae5bb7) to head (c2d98d9).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #790      +/-   ##
==========================================
- Coverage   98.38%   98.23%   -0.15%     
==========================================
  Files          35       35              
  Lines        7040     7040              
==========================================
- Hits         6926     6916      -10     
- Misses        114      124      +10     
Flag Coverage Δ
Debug 98.16% <ø> (-0.02%) ⬇️
Release 97.59% <ø> (-0.19%) ⬇️

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.

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

♻️ Duplicate comments (4)
.github/workflows/old-compilers.yml (4)

38-83: Matrix enumeration for Clang 11 is excessively verbose
Manual listing of Release/Debug + ASan/TSan/UBSan combinations for Clang 11 is error‑prone and hard to maintain. Consider using YAML anchors or generating the matrix dynamically to DRY this up.


84-129: Matrix enumeration for Clang 12 is excessively verbose
Similar to Clang 11, the Clang 12 combinations could be consolidated via YAML anchors or a script-generated matrix to reduce duplication and maintenance overhead.


472-517: GCC 10 matrix entries look correct but are verbose
As noted previously, the manual enumeration for GCC 10 (all build types and sanitizers) can be DRYed with anchors or a generated matrix. This will improve readability and reduce the risk of drift when adding new variants.


659-665: Install matching C++ compiler for versioned GCC
Installing only gcc-${VERSION} omits the g++-${VERSION} package, which is required for CXX="g++-${VERSION}".

Apply this diff:

- sudo apt-get install -y "gcc-${VERSION}"
+ sudo apt-get install -y "gcc-${VERSION}" "g++-${VERSION}"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1921180 and a66f5c7.

📒 Files selected for processing (2)
  • .github/workflows/old-compilers.yml (3 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
⏰ Context from checks skipped due to timeout of 90000ms (30)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 14 Debug with UBSan, Debug, ON, clang, 14, OFF, OFF)
  • GitHub Check: build (MSVC Debug without AVX2, msvc-debug-no-avx2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 14 Debug with UBSan, Debug, ON, clang, 14, OFF, OFF)
  • GitHub Check: build (MSVC Debug without AVX2, msvc-debug-no-avx2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 14 Debug with UBSan, Debug, ON, clang, 14, OFF, OFF)
  • GitHub Check: build (MSVC Debug without AVX2, msvc-debug-no-avx2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 14 Debug with UBSan, Debug, ON, clang, 14, OFF, OFF)
  • GitHub Check: build (MSVC Debug without AVX2, msvc-debug-no-avx2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 14 Debug with UBSan, Debug, ON, clang, 14, OFF, OFF)
  • GitHub Check: build (MSVC Debug without AVX2, msvc-debug-no-avx2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 14 Debug with UBSan, Debug, ON, clang, 14, OFF, OFF)
  • GitHub Check: build (MSVC Debug without AVX2, msvc-debug-no-avx2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 14 Debug with UBSan, Debug, ON, clang, 14, OFF, OFF)
  • GitHub Check: build (MSVC Debug without AVX2, msvc-debug-no-avx2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 14 Debug with UBSan, Debug, ON, clang, 14, OFF, OFF)
  • GitHub Check: build (MSVC Debug without AVX2, msvc-debug-no-avx2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 14 Debug with UBSan, Debug, ON, clang, 14, OFF, OFF)
  • GitHub Check: build (MSVC Debug without AVX2, msvc-debug-no-avx2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 14 Debug with UBSan, Debug, ON, clang, 14, OFF, OFF)
  • GitHub Check: build (MSVC Debug without AVX2, msvc-debug-no-avx2)

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

♻️ Duplicate comments (5)
.github/workflows/old-compilers.yml (5)

659-665: Install g++-${VERSION} alongside gcc-${VERSION}
CMake will invoke g++-${VERSION} and fail if it’s not present. Add the C++ package to the install.

- sudo apt-get install -y "gcc-${VERSION}"
+ sudo apt-get install -y "gcc-${VERSION}" "g++-${VERSION}"

38-83: 🧹 Nitpick (assertive)

Matrix enumeration for clang 11 is overly verbose
You’ve manually listed all Release/Debug + sanitizers for Clang 11. This is error‑prone and hard to maintain—consider using YAML anchors or a generated matrix to DRY up the entries.


84-129: 🧹 Nitpick (assertive)

Matrix enumeration for clang 12 is overly verbose
Same pattern as Clang 11: you can collapse these entries with anchors or a dynamic matrix generation approach.


472-517: 🧹 Nitpick (assertive)

Matrix enumeration for GCC 10 is overly verbose
All Release/Debug + sanitizers for GCC 10 are hand‑listed. To reduce duplication and simplify updates, switch to YAML anchors or a script‑generated matrix.


644-652: 🧹 Nitpick (assertive)

Use non‑deprecated key import for LLVM repo
apt-key add is deprecated on newer Ubuntu releases. Import the GPG key with gpg --dearmor into /etc/apt/trusted.gpg.d/ and reference it via signed-by in your source list.

- curl 'https://apt.llvm.org/llvm-snapshot.gpg.key' | sudo apt-key add -
- sudo add-apt-repository -y "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${VERSION} main"
+ curl 'https://apt.llvm.org/llvm-snapshot.gpg.key' \
+   | gpg --dearmor \
+   | sudo tee /usr/share/keyrings/llvm-archive-keyring.gpg > /dev/null
+ echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] \
+   http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${VERSION} main" \
+   | sudo tee /etc/apt/sources.list.d/llvm.list
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a66f5c7 and 8959c3f.

📒 Files selected for processing (3)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (3 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
⏰ Context from checks skipped due to timeout of 90000ms (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 (1)
.github/workflows/old-compilers.yml (1)

653-658: No changes needed here
LLVM package install step looks correct for all Clang versions.

Comment thread .github/workflows/build.yml
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

♻️ Duplicate comments (4)
.github/workflows/old-compilers.yml (4)

38-129: 🧹 Nitpick (assertive)

Matrix enumeration is excessively verbose
The manual listing of every combination for Clang 11 and Clang 12 (Release/Debug + ASan/TSan/UBSan) is error‑prone and hard to maintain. Consider DRYing this up using YAML anchors or dynamically generating the matrix.


472-517: 🧹 Nitpick (assertive)

Verbose GCC 10 matrix entries; consider DRYing up
Similar to Clang, the GCC 10 variants are explicitly enumerated. You could leverage YAML anchors or a small script to generate these entries, reducing duplication and easing future updates.


644-652: 🛠️ Refactor suggestion

Avoid deprecated apt-key
apt-key add is deprecated on Ubuntu 22.04. For better security and forward compatibility, import the key with gpg --dearmor into /etc/apt/trusted.gpg.d:

- curl 'https://apt.llvm.org/llvm-snapshot.gpg.key' \
-   | sudo apt-key add -
+ curl 'https://apt.llvm.org/llvm-snapshot.gpg.key' \
+   | gpg --dearmor \
+   | sudo tee /etc/apt/trusted.gpg.d/llvm-snapshot.gpg > /dev/null

659-665: ⚠️ Potential issue

Missing g++ package for GCC 10 & 12
Only gcc-${VERSION} is installed, but CMake sets CXX=g++-${VERSION}. The absence of g++-${VERSION} will break the C++ build. Please install both:

- sudo apt-get install -y "gcc-${VERSION}"
+ sudo apt-get install -y "gcc-${VERSION}" "g++-${VERSION}"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8959c3f and e51ea2d.

📒 Files selected for processing (3)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (3 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
⏰ Context from checks skipped due to timeout of 90000ms (40)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)

Comment thread .github/workflows/build.yml
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

♻️ Duplicate comments (6)
.github/workflows/build.yml (1)

416-424: Typo in CMakeOutput log group name
The group label is "CMakeOutput.Log", but the file is CMakeOutput.log. This mismatch hides the output in the Actions UI.

- echo "::group::CMakeOutput.Log"
+ echo "::group::CMakeOutput.log"
.github/workflows/old-compilers.yml (5)

38-83: 🧹 Nitpick (assertive)

Verbose matrix for Clang 11
You've manually enumerated every Release/Debug + sanitizer combination for Clang 11, which is error‑prone and hard to maintain. Consider using YAML anchors or generating this matrix dynamically to reduce duplication.


84-129: 🧹 Nitpick (assertive)

Verbose matrix for Clang 12
The Clang 12 section repeats the same patterns as Clang 11. Applying YAML anchors across compilers/sanitizers will DRY up the configuration and simplify future updates.


472-517: 🧹 Nitpick (assertive)

Verbose matrix for GCC 10
Similarly, the GCC 10 entries enumerate each sanitizer + build type manually. Using YAML anchors or a template-based script can dramatically reduce repetition and maintenance overhead.


644-652: 🧹 Nitpick (assertive)

Avoid deprecated apt-key usage
You import the LLVM GPG key with apt-key add, which is deprecated on Ubuntu 22.04+. To future‑proof and harden security, use gpg --dearmor into /etc/apt/trusted.gpg.d/ and mark the source entry with signed-by.


659-665: ⚠️ Potential issue

Install missing C++ compiler for GCC 10 & 12
The step only installs gcc-${VERSION}, but CMake sets CXX="g++-${VERSION}". Without g++-${VERSION}, builds will fail.

- sudo apt-get install -y "gcc-${VERSION}"
+ sudo apt-get install -y "gcc-${VERSION}" "g++-${VERSION}"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e51ea2d and 17ac3de.

📒 Files selected for processing (3)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (3 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml

Comment thread .github/workflows/build.yml
@laurynas-biveinis laurynas-biveinis force-pushed the rm-ubuntu-20.04 branch 4 times, most recently from 67725ee to 593b393 Compare April 17, 2025 15:03
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

♻️ Duplicate comments (2)
.github/workflows/old-compilers.yml (2)

38-129: Matrix enumeration still excessively verbose. You've manually duplicated every combination for Clang 11 and 12, which is error‑prone and hard to maintain. Consider using YAML anchors or generating the matrix dynamically to DRY up this section.


472-517: ⚠️ Potential issue

Critical: Missing C++ compiler packages for GCC 10 & 12. You install only gcc-${VERSION}, but later set CXX=g++-${VERSION}. This will break C++ builds.
Apply this diff:

-        sudo apt-get install -y "gcc-${VERSION}"
+        sudo apt-get install -y "gcc-${VERSION}" "g++-${VERSION}"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 67725ee and 593b393.

📒 Files selected for processing (3)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (4 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
🔇 Additional comments (2)
.github/workflows/build.yml (1)

406-428: CMake error-handling improvement is solid. The snippet correctly disables set -e, captures CMAKE_EXIT_CODE, re-enables fail‑fast, and prints build/CMakeFiles logs with accurate group labels.

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

700-722: CMake configuration error handling aligns with the main build. The block correctly mirrors the build.yml improvements: disabling exit, capturing the code, printing logs, and restoring set -e. Looks good.

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

♻️ Duplicate comments (2)
.github/workflows/old-compilers.yml (2)

38-129: Matrix enumeration is excessively verbose; DRY it up.
There’s a lot of repetitive blocks for Clang 11 and 12 (Release/Debug with sanitizers). Consider using YAML anchors, reusable snippets, or generating the matrix dynamically to reduce duplication and maintenance overhead.


659-665: ⚠️ Potential issue

Missing C++ compiler for GCC 10 & 12.
The step installs only gcc-${VERSION}, but CMake will invoke g++-${VERSION}. Please include g++-${VERSION} to ensure the C++ compiler is available:

- sudo apt-get install -y "gcc-${VERSION}"
+ sudo apt-get install -y "gcc-${VERSION}" "g++-${VERSION}"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 593b393 and 439a577.

📒 Files selected for processing (3)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (4 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
🔇 Additional comments (1)
.github/workflows/build.yml (1)

406-428: CMake error-handling enhancement looks solid.
The new block correctly disables set -e, captures CMAKE_EXIT_CODE, restores set -e, and prints both build/CMakeFiles/CMakeError.log and build/CMakeFiles/CMakeOutput.log within log groups on failure. This greatly improves diagnostic output.

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

♻️ Duplicate comments (3)
.github/workflows/old-compilers.yml (3)

38-129: 🧹 Nitpick (assertive)

Matrix enumeration for Clang 11/12 is excessively verbose
Manually listing all variants (Release/Debug + sanitizers) for Clang 11/12 bloats this file and is error‑prone. Consider using YAML anchors or generating the matrix dynamically to DRY this up.


644-652: 🧹 Nitpick (assertive)

APT key import is deprecated
apt-key add is deprecated on Ubuntu 22.04. Switch to gpg --dearmor and place the key in /etc/apt/trusted.gpg.d/, then reference it with signed-by in your APT source entry.


659-665: ⚠️ Potential issue

Install C++ compiler for GCC 10/12
Only gcc-${VERSION} is installed, but CMake uses g++-${VERSION} for CXX. Add g++-${VERSION} or the C++ toolchain step will fail.

Apply this diff:

- sudo apt-get install -y "gcc-${VERSION}"
+ sudo apt-get install -y "gcc-${VERSION}" "g++-${VERSION}"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 439a577 and 5f43f51.

📒 Files selected for processing (3)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (4 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
🔇 Additional comments (5)
.github/workflows/build.yml (2)

406-415: Well done: Capture and restore shell failure settings around CMake
Capturing CMAKE_EXIT_CODE with set +e and re-enabling set -e is solid for error diagnostics.


416-428: Nice: Printing CMake logs on failure
Failing build now dumps build/CMakeFiles/CMakeError.log and CMakeOutput.log for easier debugging.

.github/workflows/old-compilers.yml (3)

653-658: Confirm LLVM package set includes linker tools and tidy
Installing llvm-${VERSION}-linker-tools, clang-${VERSION}, and clang-tidy-${VERSION} covers the needed toolchain components.


700-708: Capture CMake exit code for old compilers
Disabling set -e before cmake and capturing its exit code enhances diagnostics for legacy builds.


709-722: Dump CMake logs on configuration failures
Printing build/CMakeFiles/CMakeError.log and CMakeOutput.log when configuration fails boosts troubleshooting efficiency.

@laurynas-biveinis laurynas-biveinis force-pushed the rm-ubuntu-20.04 branch 3 times, most recently from c96a818 to f8bec76 Compare April 17, 2025 19:04
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: 2

♻️ Duplicate comments (3)
.github/workflows/old-compilers.yml (3)

472-517: Matrix enumeration for GCC 10 is inconsistent and verbose
The GCC 10 variant matrix (lines 472–517) mirrors the Clang blocks and bloats the workflow. Reuse anchors or a dynamic generation approach to streamline these entries and ensure consistency across compilers.


644-652: Avoid deprecated apt-key add for LLVM key import
Using apt-key add is deprecated on Ubuntu 22.04+. Replace this with a gpg --dearmor import into /etc/apt/trusted.gpg.d/ and reference the key via signed-by in the APT source entry.


659-665: Install missing C++ packages for GCC 10 & 12
Only gcc-${VERSION} is installed for versions 10 and 12, but CMake later invokes g++-${VERSION}. Add g++-${VERSION} to the install line to prevent missing compiler errors.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44c013d and f8bec76.

📒 Files selected for processing (3)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (5 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
🔇 Additional comments (2)
.github/workflows/old-compilers.yml (2)

676-676: Enable verbose tracing in CMake setup
The addition of set -x at line 676 will help trace all configuration commands. This is a useful change for debugging setup issues.


701-723: Enhanced CMake configuration diagnostics for old compilers
Disabling fail‑fast (set +e), capturing the exit code, listing the entire build directory, and grouping the CMakeError.log and CMakeOutput.log outputs will significantly improve investigation speed for configuration failures across older compiler versions.

@laurynas-biveinis laurynas-biveinis force-pushed the rm-ubuntu-20.04 branch 2 times, most recently from b83d182 to 88e2b19 Compare April 18, 2025 05:33
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: 3

🔭 Outside diff range comments (1)
.github/workflows/old-compilers.yml (1)

676-720: 🧹 Nitpick (assertive)

Enhance CMake failure diagnostics with grouping
Capturing the exit code and printing CMakeConfigureLog.yaml is solid. Consider wrapping the ls -alR build/ output in its own ::group::build directory::endgroup:: block for consistency and easier navigation in the logs.

♻️ Duplicate comments (2)
.github/workflows/build.yml (1)

406-427: Consider listing the build directory when CMake fails
Adding ls -alR build/ before the log groups can help surface missing files or unexpected structure if errors don’t generate logs.

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

659-665: ⚠️ Potential issue

Install g++-${VERSION} alongside gcc-${VERSION}
Currently only the C compiler is installed for versioned GCC (10/12), but CMake sets CXX="g++-${VERSION}". This will break C++ builds.

Apply this diff:

-        sudo apt-get install -y "gcc-${VERSION}"
+        sudo apt-get install -y "gcc-${VERSION}" "g++-${VERSION}"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f8bec76 and 88e2b19.

📒 Files selected for processing (4)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (5 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
  • CMakeLists.txt (2 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
🔇 Additional comments (5)
.github/workflows/build.yml (1)

406-427: Improved CMake diagnostic handling
The new set +e/exit code capture and grouped log printing greatly enhance failure visibility. The log paths and group labels correctly reference build/CMakeFiles/....

CMakeLists.txt (3)

31-33: Add is_clang11 helper for version-specific logic
Introducing is_clang11 simplifies conditional checks for the Clang 11 workaround. Well-scoped and consistent with existing patterns.


304-308: Apply UBSan workaround for Clang 11 when enabled
Appending :use_sigaltstack=false under if(is_clang11) addresses issue #55785 cleanly. Good to see the workaround scoped to the relevant branch.


311-316: Ensure UBSan workaround even when sanitizer flag is off
The elseif(is_clang11) branch ensures DeepState-enabled UBSan still gets the workaround. Please verify the if/elseif/endif chain nests correctly and doesn’t inadvertently skip other branches.

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

653-658: Verify the comprehensive LLVM setup step
The "Setup dependencies for LLVM" step installs clang-${VERSION} and clang-tidy-${VERSION} for all versions. Confirm that these packages exist and match the expected toolchain versions on Ubuntu 22.04.

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: 2

♻️ Duplicate comments (3)
.github/workflows/build.yml (1)

406-427: 🛠️ Refactor suggestion

Missing set -e to restore fail‑fast after CMake configuration
You disable exit-on-error (set +e) to capture the CMake exit code, but you never re-enable it. This means subsequent shell failures won’t abort the workflow as intended. Add set -e right after you capture the exit code to restore fail-fast semantics.

Proposed diff:

--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -414,6 +414,7 @@
           CMAKE_EXIT_CODE=$?
+          set -e
           if [ $CMAKE_EXIT_CODE -ne 0 ]; then
             if [ -f build/CMakeFiles/CMakeError.log ]; then
               echo "::group::CMakeError.log"
.github/workflows/old-compilers.yml (2)

659-665: ⚠️ Potential issue

Install both GCC and G++ for versioned packages
You’re only installing gcc-${VERSION} for GCC 10 & 12, but CMake sets CXX="g++-${VERSION}". That will break the build.

Proposed fix:

--- a/.github/workflows/old-compilers.yml
+++ b/.github/workflows/old-compilers.yml
@@ -659,3 +659,4 @@
       - name: Setup dependencies for GCC 10 & 12 (versioned packages)
         run: |
-          sudo apt-get install -y "gcc-${VERSION}"
+          sudo apt-get install -y "gcc-${VERSION}" "g++-${VERSION}"
         if: >
           env.COMPILER == 'gcc'
           && (env.VERSION == '10' || env.VERSION == '12')

644-652: 🧹 Nitpick (assertive)

Deprecation: avoid apt-key add for LLVM GPG key
Ubuntu 22.04 deprecates apt-key add. Switch to importing the key into /etc/apt/trusted.gpg.d/ and add signed-by in your source entry for better future compatibility.

Example diff:

-        run: |
-          curl 'https://apt.llvm.org/llvm-snapshot.gpg.key' \
-            | sudo apt-key add -
-          sudo add-apt-repository -y \
-            "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${VERSION} main"
+        run: |
+          curl 'https://apt.llvm.org/llvm-snapshot.gpg.key' \
+            | gpg --dearmor \
+            | sudo tee /etc/apt/trusted.gpg.d/llvm-snapshot.gpg >/dev/null
+          sudo add-apt-repository -y \
+            "deb [signed-by=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${VERSION} main"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 88e2b19 and 4ef12fc.

📒 Files selected for processing (4)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (5 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
  • CMakeLists.txt (3 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml

Comment thread CMakeLists.txt
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: 2

♻️ Duplicate comments (5)
.github/workflows/build.yml (2)

406-427: Restore fail‑fast behavior after capturing CMake exit code
You disable set -e to capture the CMake exit code but never re‑enable it. Even if no further commands follow in this block, it’s safer to restore set -e immediately after handling errors to prevent silent failures if someone later adds commands here.


416-425: 🧹 Nitpick (assertive)

Consider adding directory listing for richer diagnostics
Before dumping the CMake logs, printing the build directory contents (ls -alR build/) helps surface missing files or odd directory structures—just like in old-compilers.yml.

-            if [ -f build/CMakeFiles/CMakeError.log ]; then
+            ls -alR build/
+            if [ -f build/CMakeFiles/CMakeError.log ]; then
CMakeLists.txt (1)

818-824: ⚠️ Potential issue

Fix undefined variable in sanitizer test condition
The add_sanitized_test function checks (TARGET deepstate AND clang11), but clang11 is undefined. It should reference is_clang11.

-    if(SANITIZE_ADDRESS OR SANITIZE_THREAD OR SANITIZE_UB
-        OR (TARGET deepstate AND clang11))
+    if(SANITIZE_ADDRESS OR SANITIZE_THREAD OR SANITIZE_UB
+        OR (TARGET deepstate AND is_clang11))
.github/workflows/old-compilers.yml (2)

659-665: ⚠️ Potential issue

Install both GCC and G++ for versioned packages
The step for GCC 10 & 12 only installs gcc-${VERSION}, but CMake will invoke g++-${VERSION}. Without the C++ compiler, builds on these versions will fail.

-          sudo apt-get install -y "gcc-${VERSION}"
+          sudo apt-get install -y "gcc-${VERSION}" "g++-${VERSION}"

644-652: 🧹 Nitpick (assertive)

Replace deprecated apt-key add usage
Ubuntu 22.04 deprecates apt-key add. Switch to importing via gpg --dearmor into /etc/apt/trusted.gpg.d/ and use signed-by in the deb entry for future compatibility.

-          curl 'https://apt.llvm.org/llvm-snapshot.gpg.key' \
-            | sudo apt-key add -
+          curl 'https://apt.llvm.org/llvm-snapshot.gpg.key' \
+            | gpg --dearmor \
+            | sudo tee /etc/apt/trusted.gpg.d/llvm-apt-keyring.gpg > /dev/null
           sudo add-apt-repository -y \
             "deb [signed-by=/etc/apt/trusted.gpg.d/llvm-apt-keyring.gpg] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${VERSION} main"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4ef12fc and a6d59d0.

📒 Files selected for processing (4)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (5 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
  • CMakeLists.txt (3 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
🔇 Additional comments (5)
CMakeLists.txt (3)

31-33: New is_clang11 helper for Clang 11 detection is clear and precise.
This boolean simplifies targeting Clang 11‑specific logic.


304-308: Appropriate UBSan workaround for Clang 11.
Appending :use_sigaltstack=false addresses LLVM #55785 when UBSan is enabled.


312-317: Apply workaround even when UBSan is disabled.
Ensuring DeepState’s self‑enabled UBSan run gets the same fix is essential.

.github/workflows/old-compilers.yml (2)

676-683: Enable verbose output for diagnostics
Adding set -x before the CMake invocation will echo every command, making CI failures easier to trace.


701-717: Improve CMake failure diagnostics end‑to‑end
Capturing the exit code, re‑enabling set -e, listing build/, and dumping CMakeConfigureLog.yaml creates a robust debug trail for configuration failures.

Comment on lines +38 to +129
- name: clang 11 Release
BUILD_TYPE: Release
COMPILER: clang
VERSION: 11

- name: clang 11 Release with ASan
BUILD_TYPE: Release
SANITIZE_ADDRESS: ON
COMPILER: clang
VERSION: 11

- name: clang 11 Release with TSan
BUILD_TYPE: Release
SANITIZE_THREAD: ON
COMPILER: clang
VERSION: 11

- name: clang 11 Release with UBSan
BUILD_TYPE: Release
SANITIZE_UB: ON
COMPILER: clang
VERSION: 11

- name: clang 11 Debug
BUILD_TYPE: Debug
COMPILER: clang
VERSION: 11

- name: clang 11 Debug with ASan
BUILD_TYPE: Debug
SANITIZE_ADDRESS: ON
COMPILER: clang
VERSION: 11

- name: clang 11 Debug with TSan
BUILD_TYPE: Debug
SANITIZE_THREAD: ON
COMPILER: clang
VERSION: 11

- name: clang 11 Debug with UBSan
BUILD_TYPE: Debug
SANITIZE_UB: ON
COMPILER: clang
VERSION: 11

- name: clang 12 Release
BUILD_TYPE: Release
COMPILER: clang
VERSION: 12

- name: clang 12 Release with ASan
BUILD_TYPE: Release
SANITIZE_ADDRESS: ON
COMPILER: clang
VERSION: 12

- name: clang 12 Release with TSan
BUILD_TYPE: Release
SANITIZE_THREAD: ON
COMPILER: clang
VERSION: 12

- name: clang 12 Release with UBSan
BUILD_TYPE: Release
SANITIZE_UB: ON
COMPILER: clang
VERSION: 12

- name: clang 12 Debug
BUILD_TYPE: Debug
COMPILER: clang
VERSION: 12

- name: clang 12 Debug with ASan
BUILD_TYPE: Debug
SANITIZE_ADDRESS: ON
COMPILER: clang
VERSION: 12

- name: clang 12 Debug with TSan
BUILD_TYPE: Debug
SANITIZE_THREAD: ON
COMPILER: clang
VERSION: 12

- name: clang 12 Debug with UBSan
BUILD_TYPE: Debug
SANITIZE_UB: ON
COMPILER: clang
VERSION: 12

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.

🛠️ Refactor suggestion

Matrix duplication for Clang 11/12 variants is error‑prone
Listing all Release/Debug × ASan/TSan/UBSan combinations for Clang 11 and 12 manually makes the file huge and risks drift. Use YAML anchors or a generated matrix to DRY this up and improve maintainability.

@laurynas-biveinis laurynas-biveinis force-pushed the rm-ubuntu-20.04 branch 3 times, most recently from e9f617a to 2874c42 Compare April 18, 2025 18:21
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: 2

🔭 Outside diff range comments (1)
CMakeLists.txt (1)

818-833: ⚠️ Potential issue

Fix variable name in add_sanitized_test condition

You reference ${clang11} but the variable is named is_clang11. This typo means the workaround won’t trigger. Update all occurrences of clang11 to is_clang11.

Suggested diff:

-    message(STATUS "clang11: ${clang11}")
-    if(SANITIZE_ADDRESS OR SANITIZE_THREAD OR SANITIZE_UB
-        OR (TARGET deepstate AND clang11))
+    message(STATUS "is_clang11: ${is_clang11}")
+    if(SANITIZE_ADDRESS OR SANITIZE_THREAD OR SANITIZE_UB
+        OR (TARGET deepstate AND is_clang11))
♻️ Duplicate comments (4)
.github/workflows/build.yml (2)

415-427: 🧹 Nitpick (assertive)

Consider adding build directory listing for better diagnostics

Before printing the error logs, a recursive ls -alR build/ helps identify missing or mislocated log files. This can be wrapped in a group for clarity.

Suggested diff:

  if [ $CMAKE_EXIT_CODE -ne 0 ]; then
+   echo "::group::Build directory contents"
+   ls -alR build/
+   echo "::endgroup::"
    if [ -f build/CMakeFiles/CMakeError.log ]; then
      echo "::group::CMakeError.log"
      cat build/CMakeFiles/CMakeError.log
      echo "::endgroup::"
    fi
    ...

406-414: ⚠️ Potential issue

Restore fail‑fast behavior after CMake invocation

After disabling set -e before running cmake to capture its exit code, you never re‑enable it. Subsequent steps won’t abort on failures as intended. Re-add set -e immediately after capturing the exit code to restore fail‑fast behavior.

Suggested diff:

  CMAKE_EXIT_CODE=$?
+ set -e
  if [ $CMAKE_EXIT_CODE -ne 0 ]; then
.github/workflows/old-compilers.yml (2)

644-652: Replace deprecated apt-key add usage
Ubuntu 22.04 deprecates apt-key. Import the GPG key via gpg --dearmor into /etc/apt/trusted.gpg.d/ and add signed-by to the source entry.


659-665: ⚠️ Potential issue

Install missing g++-${VERSION} package

Only gcc-${VERSION} is installed for GCC 10/12. CMake expects g++-${VERSION}, so add it to prevent linker failures.

Suggested diff:

- sudo apt-get install -y "gcc-${VERSION}"
+ sudo apt-get install -y "gcc-${VERSION}" "g++-${VERSION}"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9f617a and 2874c42.

📒 Files selected for processing (4)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (5 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
  • CMakeLists.txt (3 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
⏰ Context from checks skipped due to timeout of 90000ms (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)
CMakeLists.txt (4)

31-33: Definition of is_clang11 looks correct
The boolean helper macro correctly detects Clang versions ≥11 and <12. This variable supports the UBSan workaround.


294-296: Enable -fsanitize=implicit-bitfield-conversion for newer Clangs
The conditional for Clang ≥19 is properly scoped. No issues found.


304-309: Workaround for UBSan on Clang 11 packaged in Ubuntu 22.04
Appending :use_sigaltstack=false to UBSAN_OPTIONS under is_clang11 is correctly placed within the UBSan-enabled block.


312-317: DeepState UBSan workaround in non-sanitizer build
The elseif(is_clang11) block correctly adds the UBSAN_OPTIONS workaround for DeepState.

Comment thread .github/workflows/old-compilers.yml
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

♻️ Duplicate comments (5)
.github/workflows/old-compilers.yml (5)

38-83: Matrix duplication for Clang 11 variants
Listing eight nearly identical Clang 11 configurations inflates the workflow and increases maintenance risk. Please DRY this up using YAML anchors/aliases or a generated matrix.


84-129: Matrix duplication for Clang 12 variants
Similarly, the Clang 12 entries repeat the same pattern. Consolidate these with anchors or a dynamic strategy matrix to reduce repetition.


472-517: Matrix duplication for GCC 10 variants
The GCC 10 section also lists Release/Debug × ASan/TSan/UBSan verbatim. Consider templating or anchors to keep the matrix DRY.


644-652: Deprecated apt-key add usage
Ubuntu 22.04 deprecates apt-key add. Use gpg --dearmor into /etc/apt/trusted.gpg.d/ and add signed-by in the repo entry to future‑proof this step.


659-665: Install missing C++ compiler package for GCC 10 & 12
CMake sets CXX="g++-${VERSION}" later, but only gcc-${VERSION} is installed here. Update the install line to include "g++-${VERSION}" as well.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2874c42 and 5af62d8.

📒 Files selected for processing (4)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (5 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
  • CMakeLists.txt (3 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
⏰ Context from checks skipped due to timeout of 90000ms (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 (7)
.github/workflows/build.yml (1)

406-427: Great enhancement to CMake diagnostics
Capturing the exit code and grouping both build/CMakeFiles/CMakeError.log and CMakeOutput.log makes debugging CI failures much easier.

.github/workflows/old-compilers.yml (2)

653-658: Consolidated LLVM dependency setup
Good job unifying the LLVM setup for all Clang versions. Installing llvm-${VERSION}-linker-tools, clang-${VERSION}, and clang-tidy-${VERSION} under one step simplifies the workflow.


676-720: Verbose CMake configuration logging
Enabling set -x, capturing the exit code, listing build/ contents, and printing CMakeConfigureLog.yaml on failure provides excellent diagnostics for old compiler builds.

CMakeLists.txt (4)

31-33: Define is_clang11 for targeted workarounds
The boolean is_clang11 correctly captures Clang ≥11.0 and <12.0. This cleanly scopes the Ubuntu 22.04 workaround.


294-297: Add implicit-bitfield sanitizer for Clang ≥19
Checking for CMAKE_CXX_COMPILER_VERSION ≥ 19.0 before appending -fsanitize=implicit-bitfield-conversion ensures compatibility. Nice forward‑looking addition.


304-309: UBSan workaround for Clang 11 in UBSan block
Appending :use_sigaltstack=false to UBSAN_ENV when is_clang11 fixes the known LLVM #55785 issue. Correctly placed within the UBSan-enabled branch.


312-318: UBSan workaround for Clang 11 when sanitizer disabled
Including the same use_sigaltstack=false setting in the non-UBSan branch covers DeepState’s implicit sanitizer enabling. Well handled.

Comment thread CMakeLists.txt
Comment on lines +818 to 840
# Set Sanitizer environment on a sanitizer-less build too, if using clang
# 11 and DeepState is built, because it enables sanitizers itself.
message(STATUS "add_sanitizer_test for ${AST_NAME}")
if(TARGET deepstate)
message(STATUS "TARGET deepstate is TRUE")
else()
message(STATUS "TARGET deepstate is FALSE")
endif()
message(STATUS "is_clang11: ${is_clang11}")
if(SANITIZE_ADDRESS OR SANITIZE_THREAD OR SANITIZE_UB
OR (TARGET deepstate AND is_clang11))
message(STATUS "Setting sanitizer environment for ${AST_NAME}")
set_property(TEST "${AST_NAME}" APPEND PROPERTY ENVIRONMENT
"${SANITIZER_ENV}")
endif()
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.

🧹 Nitpick (assertive)

Enhanced add_sanitized_test for Clang 11 and DeepState
Great to extend sanitizer environment to DeepState tests under Clang 11. For less verbosity in normal runs, consider switching message(STATUS ...) calls to message(VERBOSE ...).

@laurynas-biveinis laurynas-biveinis force-pushed the rm-ubuntu-20.04 branch 2 times, most recently from ec0c5a6 to 9bb3672 Compare April 20, 2025 10:54
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: 5

♻️ Duplicate comments (2)
.github/workflows/old-compilers.yml (2)

644-652: 🧹 Nitpick (assertive)

Update deprecated apt-key usage for LLVM repository.
Ubuntu 22.04+ deprecates apt-key add. Import the GPG key via gpg --dearmor into /etc/apt/trusted.gpg.d/ and reference it with signed-by in your source entry to future‑proof the workflow.
Proposed diff:

- curl 'https://apt.llvm.org/llvm-snapshot.gpg.key' | sudo apt-key add -
- sudo add-apt-repository -y "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${VERSION} main"
+ curl -s https://apt.llvm.org/llvm-snapshot.gpg.key \
+   | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/llvm-snapshot.gpg
+ echo "deb [signed-by=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${VERSION} main" \
+   | sudo tee /etc/apt/sources.list.d/llvm.list

659-665: ⚠️ Potential issue

Install missing C++ compiler package for GCC 10 & 12.
Only gcc-${VERSION} is installed, but CMake sets CXX=g++-${VERSION}, which will fail if g++-${VERSION} is absent. Please install both packages.

- sudo apt-get install -y "gcc-${VERSION}"
+ sudo apt-get install -y "gcc-${VERSION}" "g++-${VERSION}"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5af62d8 and ec0c5a6.

📒 Files selected for processing (4)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (5 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
  • CMakeLists.txt (4 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
⏰ Context from checks skipped due to timeout of 90000ms (17)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 11 Debug with UBSan, Debug, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 11 Debug with UBSan, Debug, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 11 Debug with UBSan, Debug, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 11 Debug with UBSan, Debug, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 11 Debug with UBSan, Debug, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 11 Debug with UBSan, Debug, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 11 Debug with UBSan, Debug, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (8)
.github/workflows/old-compilers.yml (2)

676-683: Enable shell tracing for CMake configuration.
Adding set -x before the configuration step logs each command, improving visibility when diagnosing failures in the old‑compilers workflow.


701-720: Enhanced diagnostics for CMake failures in old‑compilers workflow.
Disabling fail-fast (set +e), capturing CMAKE_EXIT_CODE, re-enabling fail-fast, listing the build directory, and printing CMakeConfigureLog.yaml within grouped annotations will greatly aid troubleshooting for older compiler builds.

CMakeLists.txt (6)

31-33: Introduce is_clang11 helper for Clang 11 detection.
The new boolean accurately captures when the compiler is Clang ≥ 11 and < 12. This simplifies conditional logic elsewhere.


294-296: Add -fsanitize=implicit-bitfield-conversion for Clang 19+.
Gating this sanitizer flag on compiler version ≥ 19.0 leverages newer Clang features while avoiding errors on older toolchains.


306-308: Workaround for UBSan on Clang 11.
Appending :use_sigaltstack=false to UBSAN_OPTIONS when is_clang11 addresses LLVM issue #55785 on Ubuntu 22.04. Well scoped.


312-317: Apply UBSan workaround for DeepState on Clang 11.
The elseif(is_clang11) branch ensures DeepState’s internal sanitizer usage also gets the same workaround. This maintains consistency across test types.


574-578: Enable UBSan workaround in benchmarking code.
Setting ENV{SANITIZER_ENV} for Clang 11 benchmarks matches the workaround used elsewhere, preventing spurious failures during performance testing.


832-837: Extend sanitizer environment for DeepState on Clang 11.
The updated condition (OR (TARGET deepstate AND is_clang11)) correctly applies the workaround when DeepState enables sanitizers internally. This resolves known Clang 11 issues in test runs.

Comment on lines +406 to +423
set +e
cmake -B build "$GITHUB_WORKSPACE" "$CBT" -DSTANDALONE=ON \
-DMAINTAINER_MODE=ON -DIWYU=ON \
"-DSANITIZE_ADDRESS=${SANITIZE_ADDRESS}" \
"-DSANITIZE_THREAD=${SANITIZE_THREAD}" \
"-DSANITIZE_UB=${SANITIZE_UB}" \
"-DSTATIC_ANALYSIS=${STATIC_ANALYSIS}" "-DCOVERAGE=${COVERAGE}" \
"-DAVX2=${AVX2}" "${EXTRA_CMAKE_ARGS[@]}"
CMAKE_EXIT_CODE=$?
if [ $CMAKE_EXIT_CODE -ne 0 ]; then
if [ -f build/CMakeFiles/CMakeError.log ]; then
echo "::group::CMakeError.log"
cat build/CMakeFiles/CMakeError.log
echo "::endgroup::"
fi
if [ -f build/CMakeFiles/CMakeOutput.log ]; then
echo "::group::CMakeOutput.log"
cat build/CMakeFiles/CMakeOutput.log
echo "::endgroup::"
fi
exit 1
fi
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.

🧹 Nitpick (assertive)

Improve CMake configuration diagnostics further.
You've correctly disabled immediate exit (set +e), captured CMAKE_EXIT_CODE, and printed logs under grouped annotations.
It might also be beneficial to include a ls -alR build/ before the log checks to surface unexpected directory structures or missing log files when troubleshooting CI failures.

Comment thread .github/workflows/old-compilers.yml
Comment on lines +84 to +129
- name: clang 12 Release
BUILD_TYPE: Release
COMPILER: clang
VERSION: 12

- name: clang 12 Release with ASan
BUILD_TYPE: Release
SANITIZE_ADDRESS: ON
COMPILER: clang
VERSION: 12

- name: clang 12 Release with TSan
BUILD_TYPE: Release
SANITIZE_THREAD: ON
COMPILER: clang
VERSION: 12

- name: clang 12 Release with UBSan
BUILD_TYPE: Release
SANITIZE_UB: ON
COMPILER: clang
VERSION: 12

- name: clang 12 Debug
BUILD_TYPE: Debug
COMPILER: clang
VERSION: 12

- name: clang 12 Debug with ASan
BUILD_TYPE: Debug
SANITIZE_ADDRESS: ON
COMPILER: clang
VERSION: 12

- name: clang 12 Debug with TSan
BUILD_TYPE: Debug
SANITIZE_THREAD: ON
COMPILER: clang
VERSION: 12

- name: clang 12 Debug with UBSan
BUILD_TYPE: Debug
SANITIZE_UB: ON
COMPILER: clang
VERSION: 12

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.

🧹 Nitpick (assertive)

DRY up Clang 12 matrix entries.
Similarly, the Clang 12 matrix repeats eight manual entries. Using anchors or a templated matrix will reduce duplication and minimize drift.

Comment thread .github/workflows/old-compilers.yml
Comment thread CMakeLists.txt Outdated
Comment on lines +823 to +831
# Set Sanitizer environment on a sanitizer-less build too, if using clang
# 11 and DeepState is built, because it enables sanitizers itself.
message(STATUS "add_sanitizer_test for ${AST_NAME}")
if(TARGET deepstate)
message(STATUS "TARGET deepstate is TRUE")
else()
message(STATUS "TARGET deepstate is FALSE")
endif()
message(STATUS "is_clang11: ${is_clang11}")
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.

🧹 Nitpick (assertive)

Refine debug logging for add_sanitized_test.
The added message(STATUS) calls improve visibility of why the sanitizer environment is applied, but may clutter normal output. Consider using message(VERBOSE) for these lines to reduce noise unless verbose mode is enabled.

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

♻️ Duplicate comments (3)
.github/workflows/build.yml (1)

414-415: Re-enable fail‑fast after capturing exit code.
You capture CMAKE_EXIT_CODE but never restore set -e, so if any subsequent commands in this step fail, they won’t abort. Restore set -e immediately after capturing the exit code.

CMakeLists.txt (1)

823-831: 🧹 Nitpick (assertive)

Switch sanitizer‑test debug messages to verbose mode.
The added message(STATUS) calls help diagnose add_sanitized_test, but they will clutter normal CI logs. Consider using message(VERBOSE) for these to limit noise unless verbose mode is explicitly enabled.

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

659-665: ⚠️ Potential issue

Install g++-${VERSION} alongside gcc.
Only gcc-${VERSION} is being installed, but CMake sets CXX="g++-${VERSION}", which will cause failures if g++-${VERSION} is missing. Add "g++-${VERSION}" to the install command.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec0c5a6 and 9bb3672.

📒 Files selected for processing (4)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (5 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
  • CMakeLists.txt (4 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (9)
.github/workflows/build.yml (2)

406-407: Allow capturing CMake exit code for diagnostics.
Disabling set -e before invoking CMake is correct to let the script proceed and capture a non‑zero exit code for later inspection.


416-427: Print CMake error and output logs on failure.
Grouping and printing build/CMakeFiles/CMakeError.log and CMakeOutput.log under log groups is an effective enhancement for debugging configuration failures. Paths are correct.

CMakeLists.txt (4)

31-33: Detect Clang 11 specifically.
Introducing is_clang11 via set_bool accurately captures Clang ID with version ≥ 11.0 and < 12.0 for targeted workarounds.


304-309: Apply UBSan workaround for Clang 11.
Appending :use_sigaltstack=false to UBSAN_OPTIONS under is_clang11 addresses LLVM #55785 on Ubuntu 22.04. This is correctly scoped and ensures UBSan runs smoothly on Clang 11.


312-317: Enable DeepState workaround when UBSan isn’t enabled.
Appending "UBSAN_OPTIONS=use_sigaltstack=false" to SANITIZER_ENV in the elseif(is_clang11) branch covers DeepState’s self‑enabled sanitizers. Well handled.


574-578: Workaround Clang 11 in benchmark setup.
In the benchmarks block, you correctly set ENV{SANITIZER_ENV} when any sanitizer or DeepState on Clang 11 is used. This mirrors the general UBSan fix and is spot‑on.

.github/workflows/old-compilers.yml (3)

676-676: Enable command echo for debugging.
Adding set -x will trace shell commands in the CI logs, which is helpful when diagnosing failures.


701-710: Capture and restore shell error behavior around CMake.
Disabling exit‑on‑error with set +e, running CMake, capturing CMAKE_EXIT_CODE, and then restoring with set -e is the correct pattern to both gather diagnostics and maintain fail‑fast semantics for the remainder of the step.


711-719: Surface CMake configuration failures with directory listing and logs.
Recursively listing build/ and printing build/CMakeFiles/CMakeConfigureLog.yaml under a group block greatly improves CI troubleshooting.

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: 6

♻️ Duplicate comments (4)
.github/workflows/old-compilers.yml (3)

38-83: 🧹 Nitpick (assertive)

DRY up Clang 11 matrix entries
The eight nearly identical entries for Clang 11 (Release/Debug × ASan/TSan/UBSan/OFF) bloat the workflow and risk drift. Using YAML anchors or matrix generation would simplify maintenance.


84-129: 🧹 Nitpick (assertive)

DRY up Clang 12 matrix entries
Similarly, Clang 12 entries repeat the same pattern. Consolidating with anchors or aliases will reduce duplication and improve readability.


472-517: 🧹 Nitpick (assertive)

DRY up GCC 10 matrix entries
Listing all eight GCC 10 combinations manually inflates the file. Consider templating this pattern or using anchors to collapse these entries into a concise matrix.

CMakeLists.txt (1)

823-832: 🧹 Nitpick (assertive)

Use message(VERBOSE) for sanitizer logs
Switching the diagnostic message to VERBOSE will reduce noise in normal CI runs, showing these logs only when --verbose is enabled.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9bb3672 and 727e4c3.

📒 Files selected for processing (4)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (4 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
  • CMakeLists.txt (4 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
⏰ Context from checks skipped due to timeout of 90000ms (26)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with UBSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with UBSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with UBSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with UBSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with UBSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with UBSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 11 Debug with ASan, Debug, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with UBSan, Release, ON, clang, 12)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with UBSan, Release, ON, clang, 12)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with UBSan, Release, ON, clang, 12)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with UBSan, Release, ON, clang, 12)
🔇 Additional comments (4)
.github/workflows/old-compilers.yml (1)

700-718: CMake configuration error handling looks solid
Capturing CMAKE_EXIT_CODE, grouping and printing CMakeConfigureLog.yaml, then exiting with that code improves diagnosability.

CMakeLists.txt (3)

31-33: Clang 11 detection logic looks correct
The is_clang11 variable accurately identifies Clang 11.x by checking >=11.0 and <12.0. Ensure CI compilers align with this version range.


304-309: Validate UBSan workaround application
The workaround for use_sigaltstack=false is applied both when UBSan is enabled and when DeepState auto-enables it. Please confirm this covers all relevant build and test scenarios.


312-317: Workaround on non-sanitized builds also seems correct
Appending UBSAN_OPTIONS=use_sigaltstack=false for DeepState on Clang 11 without explicit UBSan ensures the same workaround. Good.

Comment thread .github/workflows/build.yml
Comment on lines +416 to +423
if [ $CMAKE_EXIT_CODE -ne 0 ]; then
if [ -f build/CMakeFiles/CMakeConfigureLog.yaml ]; then
echo "::group::CMakeConfigureLog.yaml"
cat build/CMakeFiles/CMakeConfigureLog.yaml
echo "::endgroup::"
fi
exit 1
fi
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.

🧹 Nitpick (assertive)

Optional: List build directory on failure
Before printing logs, adding ls -alR build/ can help uncover unexpected directory structures or misplaced log files, improving diagnostics.

Comment on lines +644 to +652
- name: Setup LLVM 16+ repo
run: |
curl 'https://apt.llvm.org/llvm-snapshot.gpg.key' \
| sudo apt-key add -
sudo add-apt-repository -y \
"deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${VERSION} main"
sudo apt-get update
if: env.COMPILER == 'clang' && env.VERSION >= 16

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.

🛠️ Refactor suggestion

Replace deprecated apt-key add usage
Ubuntu 22.04 deprecates apt-key add. To future‑proof package installation, import the GPG key with gpg --dearmor into /etc/apt/trusted.gpg.d/ and reference it with a signed-by option in the source entry.

Comment thread .github/workflows/old-compilers.yml
Comment thread CMakeLists.txt Outdated
Move the tested compiler versions there to old-compilers.yml.

Add a sanitizer workaround for Ubuntu 22.04-packaged clang 11.

Fix a typo that prevented enabling -fsanitize=implicit-bitfield-conversion for
clang 19 or later.

Add extra CMake diagnostics in the case of its failure to build.yml and
old-compilers.yml scripts.
@sonarqubecloud
Copy link
Copy Markdown

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: 2

♻️ Duplicate comments (6)
.github/workflows/build.yml (1)

406-423: 🧹 Nitpick (assertive)

Enhance diagnostics by listing the build directory
Before dumping CMakeConfigureLog.yaml, include a recursive directory listing of build/ to expose misplaced or missing files during CI failures.

Apply this diff:

@@ 406,423
-          if [ $CMAKE_EXIT_CODE -ne 0 ]; then
+         echo "::group::Build directory contents"
+         ls -alR build/
+         echo "::endgroup::"
+          if [ $CMAKE_EXIT_CODE -ne 0 ]; then
.github/workflows/old-compilers.yml (5)

38-83: DRY up Clang 11 matrix entries
The eight nearly identical Clang 11 configurations bloat the matrix and risk drift. Please reuse YAML anchors/aliases or a generated strategy matrix here.


84-129: DRY up Clang 12 matrix entries
Similarly, Clang 12 repeats eight manual entries. Use anchors or templating to collapse these into a concise definition.


472-517: DRY up GCC 10 matrix entries
The GCC 10 Release/Debug × ASan/TSan/UBSan entries repeat eight times. Anchors or a parameterized matrix would greatly improve maintainability.


659-665: ⚠️ Potential issue

Install matching C++ compiler package
Only gcc-${VERSION} is installed for versions 10/12, but g++-${VERSION} is required by CMake’s CXX setting.

Apply this diff:

@@ 659,665
-      - name: Setup dependencies for GCC 10 & 12 (versioned packages)
-        run: |
-          sudo apt-get install -y "gcc-${VERSION}"
+      - name: Setup dependencies for GCC 10 & 12 (versioned packages)
+        run: |
+          sudo apt-get install -y "gcc-${VERSION}" "g++-${VERSION}"
         if: >
           env.COMPILER == 'gcc'
           && (env.VERSION == '10' || env.VERSION == '12')

644-652: 🧹 Nitpick (assertive)

Replace deprecated apt-key add usage
apt-key add is deprecated on modern Ubuntu. Switch to importing the key via gpg --dearmor into /usr/share/keyrings and reference it with signed-by in the APT source.

Example diff:

@@ 646,649
-          curl 'https://apt.llvm.org/llvm-snapshot.gpg.key' \
-            | sudo apt-key add -
+          curl 'https://apt.llvm.org/llvm-snapshot.gpg.key' \
+            | gpg --dearmor \
+            | sudo tee /usr/share/keyrings/llvm-archive-keyring.gpg >/dev/null
-          sudo add-apt-repository -y \
-            "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${VERSION} main"
+          echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] \
+            http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${VERSION} main" \
+            | sudo tee /etc/apt/sources.list.d/llvm-toolchain.list
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 77fd09b and c2d98d9.

📒 Files selected for processing (4)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/old-compilers.yml (4 hunks)
  • .github/workflows/ubuntu-20.04.yml (0 hunks)
  • CMakeLists.txt (4 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/ubuntu-20.04.yml
⏰ Context from checks skipped due to timeout of 90000ms (60)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with TSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 12 Release, Release, clang, 12)
  • GitHub Check: build (clang 11 Debug with TSan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with ASan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with TSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 12 Release, Release, clang, 12)
  • GitHub Check: build (clang 11 Debug with TSan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with ASan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with TSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 12 Release, Release, clang, 12)
  • GitHub Check: build (clang 11 Debug with TSan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with ASan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with TSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 12 Release, Release, clang, 12)
  • GitHub Check: build (clang 11 Debug with TSan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with ASan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with TSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 12 Release, Release, clang, 12)
  • GitHub Check: build (clang 11 Debug with TSan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with ASan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with TSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 12 Release, Release, clang, 12)
  • GitHub Check: build (clang 11 Debug with TSan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with ASan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with TSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 12 Release, Release, clang, 12)
  • GitHub Check: build (clang 11 Debug with TSan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with ASan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with TSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 12 Release, Release, clang, 12)
  • GitHub Check: build (clang 11 Debug with TSan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with ASan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with TSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 12 Release, Release, clang, 12)
  • GitHub Check: build (clang 11 Debug with TSan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with ASan, Release, ON, clang, 11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (clang 12 Release with TSan, Release, ON, clang, 12)
  • GitHub Check: build (clang 12 Release, Release, clang, 12)
  • GitHub Check: build (clang 11 Debug with TSan, Debug, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with UBSan, Release, ON, clang, 11)
  • GitHub Check: build (clang 11 Release with ASan, Release, ON, clang, 11)
🔇 Additional comments (4)
CMakeLists.txt (4)

31-33: Approve new is_clang11 helper
The boolean helper correctly detects Clang 11.x. Given cmake_minimum_required(VERSION 3.16), multi-argument if() expressions work as expected.


304-309: Approve UBSan workaround in main sanitizer block
Appending :use_sigaltstack=false under is_clang11 correctly addresses the LLVM #55785 issue.


312-317: Approve DeepState UBSan workaround
Ensures UBSAN_OPTIONS is set even when DeepState self‑enables Sanitizer on Clang 11. Good catch.


833-840: Approve sanitized test environment injection
The condition correctly appends SANITIZER_ENV when any sanitizer is on or when DeepState under Clang 11 needs the workaround.

Comment thread CMakeLists.txt
Comment thread CMakeLists.txt
@laurynas-biveinis laurynas-biveinis merged commit a93a184 into master Apr 21, 2025
256 of 259 checks passed
@laurynas-biveinis laurynas-biveinis deleted the rm-ubuntu-20.04 branch April 21, 2025 09:25
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