Skip to content

C abi checker test gha#2

Open
benfred wants to merge 24 commits intomainfrom
c_abi_checker_test_gha
Open

C abi checker test gha#2
benfred wants to merge 24 commits intomainfrom
c_abi_checker_test_gha

Conversation

@benfred
Copy link
Owner

@benfred benfred commented Mar 2, 2026

No description provided.

benfred and others added 23 commits February 10, 2026 11:29
This adds a script that can check for changes that would break our
C-ABI. t works by comparing two sets of header files: the `c/include` header files for
the published ABI, as well as the `c/include` header files inside a new pull request.
Each set of header files is parsed using libclang, and the differences between the
old and new header files are examined for changes that would cause a breaking
ABI change.

Currently the following checks are made and flagged by this tool:

* Functions that have been removed from the C-ABI
* Functions that have extra parameters added
* Functions that have parameters removed
* Functions that have the type of any parameter changed
* Structs that have been removed
* Structs that have have members removed
* Structs that have the types of members changed
* Enum values that have been removed
* Enum values that have their definition changed
- Add check-c-abi.yaml workflow for PRs
- Add store-c-abi-baseline.yaml workflow for releases
- Integrate ABI check into pr.yaml pipeline

Co-authored-by: Cursor <cursoragent@cursor.com>
- Extract and store main baseline on push to main (never expires)
- PRs download and compare against main baseline
- Release workflow archives the main baseline with version tag
- Eliminates duplicate ABI extraction work

Co-authored-by: Cursor <cursoragent@cursor.com>
Enables bootstrapping the initial c-abi-baseline-main artifact

Co-authored-by: Cursor <cursoragent@cursor.com>
- Store baselines with commit SHA for precise comparisons
- Cascade: try merge-base → latest main → extract fresh
- Add concurrency control to prevent race conditions
- Report which baseline source was used for transparency

Co-authored-by: Cursor <cursoragent@cursor.com>
Move the check_c_abi.py script to a python package, and
add tests and type hints
add write contents permissions so that we can leave a comment
on the PR
@github-actions github-actions bot added the ci label Mar 2, 2026
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

⚠️ C ABI Breaking Changes Detected

This PR introduces breaking changes to the C ABI. Please review the changes carefully.

Breaking ABI changes are only allowed in major releases. If this is intentional for a major release,
the baseline ABI will need to be updated after merge.

See the job logs for details on what specific changes were detected.

### What are breaking ABI changes?

Breaking ABI changes include:
- Removing functions from the public API
- Changing function signatures (parameters or return types)
- Removing struct members or changing their types
- Removing or changing enum values

### Next steps

1. Review the changes flagged in the CI logs
2. If these changes are unintentional, update your PR to maintain ABI compatibility
3. If these changes are required, ensure:
   - This is part of a major version release
   - The changes are documented in the changelog
   - Migration guide is provided for users

For more information, see the [C ABI documentation](../docs/source/c_developer_guide.md).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants