Skip to content

Update uncrustify version selection to support >= 0.78.1#581

Merged
clalancette merged 2 commits into
rollingfrom
fix/uncrustify-version-selection
May 7, 2026
Merged

Update uncrustify version selection to support >= 0.78.1#581
clalancette merged 2 commits into
rollingfrom
fix/uncrustify-version-selection

Conversation

@mjcarroll
Copy link
Copy Markdown
Contributor

@mjcarroll mjcarroll commented May 6, 2026

This PR updates the Uncrustify version selection logic in ament_uncrustify to support versions >= 0.78.1.

The Problem

Currently, ament_uncrustify hardcodes a check for exactly 0.78.1. If the version differs (even if it is newer), the script falls back to the obsolete 0.72 configuration (designed for RHEL 8 / Ubuntu 20.04).

  • RHEL 10 (via EPEL) provides Uncrustify 0.80.1.
  • Because 0.80.1 != 0.78.1, RHEL 10 currently falls back to the 0.72 configuration, resulting in thousands of formatting violations in CI.
  • Ubuntu 26.04 (Resolute) currently provides 0.78.1, so it passes

The Fix

Updated the logic to use the 0.78 configuration for any version >= 0.78.1. This ensures that the modern style definition is used for the 0.8x family of engines available on RHEL 10 and newer Ubuntu releases.

Assisted-by: Gemini CLI:2.0-Flash

Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
@mjcarroll
Copy link
Copy Markdown
Contributor Author

mjcarroll commented May 6, 2026

Test run against RHEL 10 Build Status

@mjcarroll mjcarroll marked this pull request as draft May 6, 2026 18:18
@mjcarroll
Copy link
Copy Markdown
Contributor Author

Keeping this as a draft, I'm kind of just hoping that newer config files will be fine then we can figure out what we actually want to do here.

@mjcarroll
Copy link
Copy Markdown
Contributor Author

Testing with this and the launch fix from here: ros2/launch#974

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@clalancette
Copy link
Copy Markdown
Contributor

Successful CI for this is in ros2/launch#974 (comment)

@clalancette clalancette marked this pull request as ready for review May 7, 2026 15:48
@clalancette clalancette merged commit b739a19 into rolling May 7, 2026
3 checks passed
@clalancette
Copy link
Copy Markdown
Contributor

@Mergifyio backport lyrical

@clalancette clalancette deleted the fix/uncrustify-version-selection branch May 7, 2026 15:49
@mergify
Copy link
Copy Markdown

mergify Bot commented May 7, 2026

backport lyrical

✅ Backports have been created

Details

@mjcarroll
Copy link
Copy Markdown
Contributor Author

Ah, @cottsay recommended

version = b'0.78.1'
version_tuple = tuple(int(x) for x in itertools.takewhile(bytes.isdigit, version.split(b'.')))

I will do that in a follow-up

clalancette pushed a commit that referenced this pull request May 8, 2026
(cherry picked from commit b739a19)

Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
Co-authored-by: Michael Carroll <mjcarroll.oss@gmail.com>
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.

2 participants