← Back to Pull requests

ci(workflow): Fix clang-format and Make 3.81 jobs on new ubuntu-latest #1650

Closed
unknown closed this pull request without merging on Nov 20, 2026 08:25 UTC
View on GitHub
unknown unknown commented on Nov 19, 2026 13:11 UTC
Author

Description

The ubuntu-latest runner image was upgraded to Ubuntu 26.04, which broke two CI jobs.

1. clang-format: version 14 is no longer available

clang-format-14 is not packaged for Ubuntu 26.04.

  • Bump CLANG_VERSION from 14 to 21 in clang-format-check.yml, clang-format-run-pr.yml, and the default in clang-format-run.sh.

  • Run apt-get update before installing and install with -y.

  • Update the clang-format version and commands in Documentation/CONTRIBUTING.md.
  • Formatting differences between clang-format 14 and 21

    The .clang-format config is unchanged and loads fine with version 21, but version 21 formats some code differently. I scanned every file the format check covers, using the same exclusions as the workflow:

    | Directory | Files flagged by 14 | Files flagged by 21 |
    |---|---|---|
    | Libraries/PeriphDrivers | 0 | 19 / 927 |
    | Libraries/CMSIS/Device | 0 | 21 / 101 |
    | Libraries/MiscDrivers | 0 | 7 / 79 |
    | Libraries/Boards | 0 | 0 / 152 |
    | Examples | 0 | 58 / 1941 |
    | Total | 0 | 105 |

    Most of the differences come from clang-format 14 bugs that later versions fixed, so no .clang-format option restores the old output. Examples:

  • Spacing around binary operators after a parenthesized macro argument:

  •   -#define LSB(val) ((val)&0xFF)
      +#define LSB(val) ((val) & 0xFF)
      

    The same fix applies to w h → w h inside macro bodies.
  • Line breaking after __attribute__(...):

  •   -__attribute__((aligned(4)))
      -uint8_t marray[BLOCK_SIZE * MULTI_BLOCK_COUNT];
      +__attribute__((aligned(4))) uint8_t
      +    marray[BLOCK_SIZE * MULTI_BLOCK_COUNT];
      

  • Indentation of ///< trailing comment continuation lines in struct members.

  • Line-continuation (\) alignment in large multi-line #defines.
  • Impact: The format check runs on whole changed files, so any PR that modifies one of these 105 files fails the check even if the PR's own changes are clean. The fix is to reformat those files once with clang-format 21. That reformat is not part of this PR; it will be done separately.

    2. Regression_Test_Make_3_81: Make 3.81 fails to build with GCC 15

    make.h:492:14: error: conflicting types for 'getcwd'; have 'char *(void)'
    ar.c:110:26: error: passing argument 2 of 'ar_scan' from incompatible pointer type [-Wincompatible-pointer-types]
    

    GCC 15 defaults to C23, where K&R-style declarations such as extern char *getcwd (); mean (void) and conflict with glibc's prototypes. GCC 14 also made -Wincompatible-pointer-types and similar warnings errors by default. Make 3.81 is now configured with CFLAGS="-std=gnu89 -fpermissive -g -O2".

    Checklist Before Requesting Review

  • PR Title follows correct guidelines.

  • Description of changes and all other relevant information.

  • (Optional) Provide info on any relevant functional testing/validation.
  • Validation (Docker, ubuntu:26.04, GCC 15.2.0):

  • Make 3.81 with the old configure flags reproduces the exact CI errors.

  • Make 3.81 with the new flags builds and installs, make --version reports GNU Make 3.81, and the "Check Make Version" step passes.

  • Make 3.81 dry-run (make -n) of Examples/MAX78000/Hello_World completes.

  • apt-get install clang-format-21 installs 21.1.8 from the stock Ubuntu 26.04 repositories.

  • clang-format-run.sh with CLANG_VERSION=21 passes on sample files.

  • The 14 vs 21 comparison above was run with clang-format-14 on ubuntu:22.04 and clang-format-21 on ubuntu:26.04.
  • Diff: 441 lines (+330 / -111) across 5 files Reviewer: ttmut Review duration: 1153m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 441 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.364
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1650"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.3% (MEDIUM) · Higher = larger blast radius
    45.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.9% · Safe to merge
    17.9%