Skip to content

Modernize CI: new Go versions, C23 fix, Windows testing#384

Open
b-long wants to merge 9 commits intogo-python:masterfrom
b-long:stacked/combined-all
Open

Modernize CI: new Go versions, C23 fix, Windows testing#384
b-long wants to merge 9 commits intogo-python:masterfrom
b-long:stacked/combined-all

Conversation

@b-long
Copy link
Copy Markdown
Contributor

@b-long b-long commented Apr 7, 2026

This PR consolidates 6 stacked changes that modernize the CI pipeline and fix
compatibility issues with newer compilers and Go versions.

Summary of changes

  • Modernize GitHub Actions — upgrade all actions to current versions, pin
    Python to 3.11, remove AppVeyor, skip two known-broken CGO tests
  • Enable CI on stacked/feature branchespull_request trigger now runs
    on PRs targeting any branch, not just master
  • Expand Go version matrix — add Go 1.24.x and 1.25.x to CI
  • Fix C23 compiler compatibility — guard typedef uint8_t bool; against
    C23's native bool to fix build errors with newer C compilers
  • Update golang.org/x/tools — bump from v0.16.0 → v0.29.0, required for
    Go 1.25.x compatibility
  • Resume Windows CI — re-enable Windows runner, fix LF line-ending issue
    that broke TestCheckSupportMatrix, add Windows test docs

[1/6] Update GitHub Actions and skip failing CGO tests#382

Changes:

  • Remove appveyor.yml
  • Upgrade actions/checkout v2 → v4
  • Upgrade actions/setup-go v2 → v5 (with built-in caching, removes separate cache step)
  • Add actions/setup-python@v5 pinned to Python 3.11
  • Upgrade codecov/codecov-action v1 → v4
  • Skip TestBindSimple and TestBindCgoPackage

Why Python 3.11? Pinning avoids Python 3.12 breakage while we focus on
infrastructure. The two skipped tests fail due to a known Go 1.21+ CGO
limitation when multiple C-shared libraries are loaded in the same process
(see #370).

Similar to #378 by @coffeemakingtoaster.

Co-authored-by: @coffeemakingtoaster mh340@hdm-stuttgart.de

[2/6] Enable CI for stacked PRs targeting any branchb-long#4

Updates the pull_request trigger from branches: [master] to
branches: ['**'] so GitHub Actions CI runs on stacked PRs that target
feature branches rather than only master.

[3/6] Add Go 1.24.x to CI test matrixb-long#5

Adds Go 1.24.x alongside existing 1.22.x and 1.21.x matrix entries.

Based on #378 by @coffeemakingtoaster.

Note: two tests remain skipped due to known Go 1.21+ CGO issues (expected).

Co-authored-by: Max mh340@hdm-stuttgart.de

[4/6] Add C23 compatibility for bool typedefb-long#6

Wraps typedef uint8_t bool; with #ifndef __cplusplus / #if !defined(bool)
preprocessor guards to avoid conflicts with C23's native bool type. This
fixes compilation errors with newer C compilers that default to the C23
standard.

Based on #379 by @deuill.

Co-authored-by: Marid de Uill maridlcueto@gmail.com

[5/6] Add Go 1.25.x to CI test matrix and update dependenciesb-long#8

Adds Go 1.25.x alongside 1.24.x, 1.22.x, and 1.21.x. Upgrades
golang.org/x/tools from v0.16.0 → v0.29.0 and updates the go.mod go
directive to 1.22.0 (set by go mod tidy).

Why the dependency update? Go 1.25 introduced breaking changes that make
golang.org/x/tools v0.16.0 incompatible:

golang.org/x/tools@v0.16.0/internal/tokeninternal/tokeninternal.go:78:9:
invalid array length -delta * delta (constant -256 of type int64)

Upgrading to v0.29.0 resolves this.

[6/6] Resume Windows testingb-long#10

Re-enables the Windows runner and addresses two issues that were blocking it:

  1. LF line endings — adds .gitattributes enforcing eol=lf for text
    files. TestCheckSupportMatrix does a byte-level comparison of
    SUPPORT_MATRIX.md; on Windows, Git's CRLF conversion caused spurious
    failures even though the content was correct.

  2. Test matrix — simplifies and expands the matrix configuration.

  3. Docs — adds notes to CONTRIBUTING.md / test docs on installing
    psutil before running the test suite on Windows.


Attribution

Several changes in this PR are based on or inspired by prior community
contributions:

Upstream PR Author Topic
#378 @coffeemakingtoaster Actions modernization & Go 1.24
#379 @deuill C23 bool typedef fix

b-long and others added 9 commits April 7, 2026 22:35
Changes:
- Remove appveyor.yml
- Upgrade actions/checkout from v2 to v4
- Upgrade actions/setup-go from v2 to v5 with built-in caching
- Add actions/setup-python@v5 pinned to Python 3.11
- Remove separate actions/cache step (now handled by setup-go)
- Upgrade codecov/codecov-action from v1 to v4
- Skip TestBindSimple and TestBindCgoPackage (Go 1.21+ CGO issue)

Python 3.11 pinning avoids issues with Python 3.12 changes while we
focus on infrastructure improvements. The two skipped tests fail due
to known Go 1.21+ CGO limitations when multiple C-shared libraries
are loaded in the same process (see go-python#370).

These changes provide a clean, passing CI baseline for future PRs.

Similar to upstream PR go-python#378 from @coffeemakingtoaster.

Co-authored-by: @coffeemakingtoaster <mh340@hdm-stuttgart.de>
Updates pull_request trigger to run on PRs targeting any branch
(branches: ['**']) instead of only master branch. This enables
GitHub Actions CI to run on stacked PRs that target feature
branches rather than master.
Adds Go 1.24.x to the CI test matrix alongside existing 1.22.x and 1.21.x.
This ensures gopy works with the latest Go version.

Based on go-python#378 by @coffeemakingtoaster.

Note: Two tests remain skipped due to known Go 1.21+ CGO issues
(see go-python#370). This is expected.

Co-Authored-By: Max <mh340@hdm-stuttgart.de>
Wraps 'typedef uint8_t bool;' with preprocessor guards to avoid
conflicts with C23's native bool type. This fixes compilation
errors with newer C compilers that default to C23 standard.

Based on go-python#379 by @deuill.

Co-Authored-By: Marid de Uill <maridlcueto@gmail.com>
Adds Go 1.25.x to the CI test matrix alongside existing versions
(1.25.x, 1.24.x, 1.22.x, 1.21.x). This ensures gopy works with
the latest Go version.

Updates golang.org/x/tools from v0.16.0 to v0.29.0 to support
Go 1.25.x, which has breaking changes that make older versions
of x/tools incompatible.

Note: Two tests remain skipped due to known Go 1.21+ CGO issues
(see go-python#370). This is expected.
Add .gitattributes to ensure consistent line endings across all platforms.
This fixes the TestCheckSupportMatrix failure on Windows, which was caused
by Git converting LF to CRLF on Windows, breaking the byte-level comparison
between the generated and committed SUPPORT_MATRIX.md file.

The test passes on Linux because line endings remain as LF, but fails on
Windows where Git may convert them to CRLF during checkout. By explicitly
setting eol=lf for text files, we ensure consistent behavior across all
platforms.
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