Menu

#638 GTK3V2MAIN: bulk AStyle reformat + CI conformance gate

Next Release
closed
None
V5.3.1GA
Windows
5
1 day ago
2026-07-11
No

Establishes a clean formatting baseline on GTK3V2MAIN and prevents future drift.

37 of 362 tracked .c/.h files (excluding unittest dirs) currently don't conform to app/lib/astylerc, verified 2026-07-11. 2 of those 37 are vendored third-party code (app/tools/halibut/charset/iso2022.c, app/wlib/gtk3lib/wrapbox/eggwrapbox.c) and are excluded from scope -- reformatting vendored upstream code creates diff-drift against the real upstream for no benefit. So 35 files get reformatted.

Single formatting-only commit, zero logic changes, followed by a new CI job that runs astyle in dry-run mode and fails if any tracked file would be reformatted.

Part of a broader GTK3V2MAIN quality-improvement pass (see internal plan) -- this branch goes first since it establishes a clean baseline that the rest of the work (warning fixes) builds on without double-touching the same lines.

Scope: GTK3V2MAIN only (this branch is expected to become the project default before end of year; GTK2/default gets an equivalent backlog item for later).

Related

Bugs: #638

Discussion

  • Anonymous

    Anonymous - 2026-07-12

    I believe astyle is generating different result for Windows verus Linux
    Consider cjoin.c line 551 indentation

     Change 6694 - 'astyled' by abyrne
                DYNARR_LAST(trkSeg_t,Dl.newLine).u.p.pts = MyMalloc(sizeof(
                                        pts_t)*Dl.params.nodes.cnt);
    
    Change 6600 - '(126e44f9c513) fix(#635): compiler warnings — fallthrough ,...' by abyrne
                DYNARR_LAST(trkSeg_t,Dl.newLine).u.p.pts = MyMalloc(sizeof(
                                pts_t)*Dl.params.nodes.cnt);
    
     Change 6421 - ' bulk AStyle reformat'  by Ken Shaffer
                DYNARR_LAST(trkSeg_t,Dl.newLine).u.p.pts = MyMalloc(sizeof(
                                pts_t)*Dl.params.nodes.cnt);
    
    Change 6332 (55489d721b01) 'Adjust PD_STRING lengths ...' by Dave Bullis
                DYNARR_LAST(trkSeg_t,Dl.newLine).u.p.pts = MyMalloc(sizeof(
                                        pts_t)*Dl.params.nodes.cnt);
    

    astyle was applied in change 6421 which exdented line 551
    and again in change 6694 which indented line 551

    I think change 6421 was applied on Wndows while change 6694 was applied on Linux
    Ken: can you confirm 6421 was run on Windows and astyle on change 6694 wil exdent line 551

     
  • Allen D Byrne

    Allen D Byrne - 6 days ago

    Another thing to check is the version that was executed.

     
  • Allen D Byrne

    Allen D Byrne - 6 days ago

    Claude investigation:
    Root cause: astyle version mismatch, not a Windows-vs-Linux platform bug.

    I pulled the actual historical revisions and reproduced this in a fresh container running astyle 3.1 (CI's exact pinned version):

    1. Ken Shaffer's r6421 astyle run used a different astyle version than ours — running today's CI-pinned astyle 3.1 fresh against his output shows it wants to change 5+ lines in cjoin.c (including line 551) right back to the wider
      indent. So his tool disagreed with 3.1 at the time, not because of OS, but because it wasn't the same astyle version/build.
    2. Our bug-638 commit (r6694) is astyle 3.1's actual canonical output: I ran 3.1 fresh in a clean container against the pre-fix state (r6600) and it reproduced our committed file byte-for-byte (full-file diff, zero differences).

    So the reviewer's fear — "will 6694's astyle re-exdent line 551 again" — doesn't hold: 3.1 does not want to touch it further; it's already a stable fixed point. This is the same category of issue already documented from Phase 0 (local
    astyle 3.6.13 vs CI's apt-installed 3.1 disagreeing) — the fix isn't "make every astyle version agree," it's "CI pins one version and gates on it," which is exactly what's now in place and already passed 17/17 (including
    astyle-check) on the bug-638 PR.

     
  • Allen D Byrne

    Allen D Byrne - 6 days ago

    Recommend standardizing on AStyle 3.1 (the version CI now pins) for any local reformatting.

     
  • Allen D Byrne

    Allen D Byrne - 6 days ago

    macOS's Homebrew astyle is 3.6.16 (not 3.1), and it disagrees with the Linux-pinned 3.1 on 20 files (cjoin.c included). This actually reinforces the diagnosis: different astyle versions really do disagree, which is why "pin one canonical version and treat it as authoritative" (already in place) is the right fix, not something you could ever make agree across every platform's default package manager.

     
  • Allen D Byrne

    Allen D Byrne - 6 days ago

    Confirmed pattern: Windows/MSYS2's astyle is 3.6.13 (the same version noted in the earlier local-dev-sandbox lesson), and it also disagrees with Linux's 3.1. So both macOS (3.6.16) and Windows (3.6.13) track a much newer astyle release than Ubuntu 24.04's apt package (3.1) — this isn't really an OS quirk, it's that different package repos simply carry different astyle release lines.

     
  • strobelight

    strobelight - 6 days ago

    I built astyle version 3.6.12 on my linux box and use it. I wasn't aware we had to use a specific version of it. Personally, I'm for keeping more up to date styling despite what's available as a package. If windows, mac, linux have a 3.6.x, we ought to use it to be consistent.

    I also came up with the .editorconfig to hopefully match what it puts out, so there's less style changes. I also use nvim, and noticed way too late that style changes were being automatically performed which is why I came up with the .editorconfig.

    A brief look at a diff shows a mixture of tabs and spaces still used for styling and the "one space off" seen from 3.1.

     
  • Allen D Byrne

    Allen D Byrne - 5 days ago

    I discovered this issue in a previous life where we were using clang format (doxygen has similar issues) where we needed to use the correct version across platforms and have an official published version. Just one of many software engineering tasks in a multi-platform, multi-compiler, multi-person project.

    Updated the branch.

    1. astyle-check : Ubuntu 24.04, g++ : 3.6.13 : "All files conform"
    2. astyle-check-macos : macOS, Apple Clang : 3.6.13 : "macOS astyle agrees with the Linux gate: all files conform"
    3. astyle-check-windows : Windows/MSYS2, MinGW g++ : 3.6.13 : "Windows/MSYS2 astyle agrees with the Linux gate: all files conform"

    This is stronger than just "same version number" — astyle's --dry-run internally reformats each file in memory and compares it byte-for-byte against what's on disk, only printing Formatted <file> when they differ. Each job checks out the exact same commit (the 38 reformatted files), and all three independently-built 3.6.13 binaries — compiled by three different compilers (GCC/Ubuntu, Apple Clang/macOS, MinGW-GCC/Windows) — report zero files need further changes, across the entire app/bin/app/wlib tree, not just the 38 we touched.</file>

    So: same version pinned everywhere, and confirmed byte-identical formatting output across all three platforms.

     
  • Allen D Byrne

    Allen D Byrne - 5 days ago
    • Description has changed:

    Diff:

    
    
    • status: --> needs-review
    • assigned_to: Allen D Byrne
    • XTrackCAD Version: --> V5.3.1GA
    • OS Level: -->
    • Operating System: --> Windows
    • Priority: --> 5
    • Milestone: --> Next Release
     
  • strobelight

    strobelight - 5 days ago

    So, no diffs then from running astyle. Branch and ticket can be closed.

    Everyone should use 3.6.13 and wiki's (if any which address this) updated.

    Ken

     
  • Allen D Byrne

    Allen D Byrne - 5 days ago

    astyle runs made real, verifiable changes, and the bug-638 branch tip is genuinely different from SF's current GTK3V2MAIN content.
    34 files are genuine astyle-driven .c/.h changes (ddrawprim.c, draw.c, dlayer.c, wpref.c, wlib.h, etc.) — real formatting deltas, confirmed by inspecting content.

    So there are changes to be made. There are no diferences in platforms using the same 3.6.13 astyle.

    OK to merge?
    Allen

     
  • strobelight

    strobelight - 4 days ago

    I believe the consensus for astyle changes is that their commit is just for style changes, not other changes. Specifically run astyle then commit. Style changes that happen to come in from editor preference when making other changes are ok.

    I mention this because I checked your commit and saw other content changes that weren't just styling.

     
    • Allen D Byrne

      Allen D Byrne - 4 days ago

      Strange, I all saw was whitespace changes and addition of some brackets -
      all due to astyle run AFIK. Was the brackets the issue?

      Allen

      On Wed, Jul 15, 2026 at 1:09 PM strobelight str0belight@users.sourceforge.net wrote:

      I believe the consensus for astyle changes is that their commit is just
      for style changes, not other changes. Specifically run astyle then commit.
      Style changes that happen to come in from editor preference when making
      other changes are ok.

      I mention this because I checked your commit and saw other content changes
      that weren't just styling.


      [bugs:#638] https://sourceforge.net/p/xtrkcad-fork/bugs/638/
      GTK3V2MAIN: bulk AStyle reformat + CI conformance gate

      Status: closed
      Milestone: Next Release
      Created: Sat Jul 11, 2026 04:31 PM UTC by Allen D Byrne
      Last Updated: Wed Jul 15, 2026 04:57 PM UTC
      Owner: Allen D Byrne

      Establishes a clean formatting baseline on GTK3V2MAIN and prevents future
      drift.

      37 of 362 tracked .c/.h files (excluding unittest dirs) currently don't
      conform to app/lib/astylerc, verified 2026-07-11. 2 of those 37 are
      vendored third-party code (app/tools/halibut/charset/iso2022.c,
      app/wlib/gtk3lib/wrapbox/eggwrapbox.c) and are excluded from scope --
      reformatting vendored upstream code creates diff-drift against the real
      upstream for no benefit. So 35 files get reformatted.

      Single formatting-only commit, zero logic changes, followed by a new CI
      job that runs astyle in dry-run mode and fails if any tracked file would be
      reformatted.

      Part of a broader GTK3V2MAIN quality-improvement pass (see internal plan)
      -- this branch goes first since it establishes a clean baseline that the
      rest of the work (warning fixes) builds on without double-touching the same
      lines.

      Scope: GTK3V2MAIN only (this branch is expected to become the project
      default before end of year; GTK2/default gets an equivalent backlog item
      for later).


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/xtrkcad-fork/bugs/638/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #638

  • strobelight

    strobelight - 4 days ago

    I went to Commit [0f2c3e] Summary and scrolled down and saw cprint.c changed.

     
    • Allen D Byrne

      Allen D Byrne - 3 days ago

      OH, I did not see that because my local diff did not show that line (see
      https://github.com/adbyrne/XTrkCAD/pull/4/changes#diff-611160645b36fc922c3c7441f0c52402142752f146ac267c7b103c60bb88d669).
      My diff only showed whitespace and brackets compared to the tip of
      GTK3V2MAIN when I ran astyle. I did not do anything else unless it was
      somehow a glitch between the original astyle based on 3.1 vs the later
      change to astyle based on 3.6, I did do some other work. But still my
      updated diff did not show it so maybe my local copy had been changed in
      between.

      Allen

      On Thu, Jul 16, 2026 at 7:21 AM strobelight str0belight@users.sourceforge.net wrote:

      I went to Commit [0f2c3e] Summary
      https://sourceforge.net/p/xtrkcad-fork/xtrkcad/ci/0f2c3e00ae98e53848dd4c07156aef52fafe28be/
      and scrolled down and saw cprint.c changed.


      [bugs:#638] https://sourceforge.net/p/xtrkcad-fork/bugs/638/
      GTK3V2MAIN: bulk AStyle reformat + CI conformance gate

      Status: closed
      Milestone: Next Release
      Created: Sat Jul 11, 2026 04:31 PM UTC by Allen D Byrne
      Last Updated: Wed Jul 15, 2026 06:09 PM UTC
      Owner: Allen D Byrne

      Establishes a clean formatting baseline on GTK3V2MAIN and prevents future
      drift.

      37 of 362 tracked .c/.h files (excluding unittest dirs) currently don't
      conform to app/lib/astylerc, verified 2026-07-11. 2 of those 37 are
      vendored third-party code (app/tools/halibut/charset/iso2022.c,
      app/wlib/gtk3lib/wrapbox/eggwrapbox.c) and are excluded from scope --
      reformatting vendored upstream code creates diff-drift against the real
      upstream for no benefit. So 35 files get reformatted.

      Single formatting-only commit, zero logic changes, followed by a new CI
      job that runs astyle in dry-run mode and fails if any tracked file would be
      reformatted.

      Part of a broader GTK3V2MAIN quality-improvement pass (see internal plan)
      -- this branch goes first since it establishes a clean baseline that the
      rest of the work (warning fixes) builds on without double-touching the same
      lines.

      Scope: GTK3V2MAIN only (this branch is expected to become the project
      default before end of year; GTK2/default gets an equivalent backlog item
      for later).


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/xtrkcad-fork/bugs/638/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #638
      Commit: [0f2c3e]

  • strobelight

    strobelight - 3 days ago

    perhaps a commit was made that you forgot about.

    you can hg out before running astyle to check.

     
  • Dave Bullis

    Dave Bullis - 1 day ago

    It appears that a 0 change astyle run is now reuired for updates.
    If so, we need to update
    https://sourceforge.net/p/xtrkcad-fork/wiki/BuildNotes/
    Also, make it clear that astyle version 3.6.13 is required, with instructions on how to get it.

    The current release of astyle is 3.6.17 which produces different results from 3.6.13.
    (40 diffs in app/bin)
    It's suprising that a minor change (..13->..17) would cause such grief
    How closely do we have to track astyle?

    Dave

     
    • Allen D Byrne

      Allen D Byrne - 1 day ago

      Yes, minor changes shouldn't do that - but that is the problem with
      external tools. So astyle 3.6.13 was proved to produce the exact same
      output across the platforms. Why 3.6.13, because at the time I did the
      tests that was the latest version on mac and windows GH images, therefore I
      focused on that. I am working on doxygen fixes and will add a version of
      tools section.

      Allen

      On Sat, Jul 18, 2026 at 12:19 PM Dave Bullis sillub@users.sourceforge.net
      wrote:

      It appears that a 0 change astyle run is now reuired for updates.
      If so, we need to update
      https://sourceforge.net/p/xtrkcad-fork/wiki/BuildNotes/
      Also, make it clear that astyle version 3.6.13 is required, with
      instructions on how to get it.

      The current release of astyle is 3.6.17 which produces different results
      from 3.6.13.
      (40 diffs in app/bin)
      It's suprising that a minor change (..13->..17) would cause such grief
      How closely do we have to track astyle?

      Dave

      [bugs:#638] https://sourceforge.net/p/xtrkcad-fork/bugs/638/
      GTK3V2MAIN: bulk AStyle reformat + CI conformance gate

      Status: closed
      Milestone: Next Release
      Created: Sat Jul 11, 2026 04:31 PM UTC by Allen D Byrne
      Last Updated: Thu Jul 16, 2026 08:49 PM UTC
      Owner: Allen D Byrne

      Establishes a clean formatting baseline on GTK3V2MAIN and prevents future
      drift.

      37 of 362 tracked .c/.h files (excluding unittest dirs) currently don't
      conform to app/lib/astylerc, verified 2026-07-11. 2 of those 37 are
      vendored third-party code (app/tools/halibut/charset/iso2022.c,
      app/wlib/gtk3lib/wrapbox/eggwrapbox.c) and are excluded from scope --
      reformatting vendored upstream code creates diff-drift against the real
      upstream for no benefit. So 35 files get reformatted.

      Single formatting-only commit, zero logic changes, followed by a new CI
      job that runs astyle in dry-run mode and fails if any tracked file would be
      reformatted.

      Part of a broader GTK3V2MAIN quality-improvement pass (see internal plan)
      -- this branch goes first since it establishes a clean baseline that the
      rest of the work (warning fixes) builds on without double-touching the same
      lines.

      Scope: GTK3V2MAIN only (this branch is expected to become the project
      default before end of year; GTK2/default gets an equivalent backlog item
      for later).


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/xtrkcad-fork/bugs/638/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #638

Anonymous
Anonymous

Add attachments
Cancel