Skip to content

Export the stable ABI PyCFunction_Call shim - #9055

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-pycfunction-call-stable-abi
Oct 10, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-pycfunction-call-stable-abi

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Summary

Extract the independent PyCFunction_Call stable-ABI shim from #8954 (43065e79ddc46eafeca58cb39398ac007b5d25f7). This is already part of the Python 3.14 contract: although its public declaration was removed in 3.13, the binary symbol remains available and delegates directly to PyObject_Call.

The production change is ten lines in crates/capi/src/methodobject.rs. It preserves main's existing argument-validation tests, including #8957, and makes no loader, lifecycle, error-storage, or test-framework changes. #8435 touches the same file but does not supply this symbol; the separate C-API work in #8951 is excluded.

References: CPython 3.14.7 call implementation, stable ABI manifest, and existing Python test.

Validation

  • Normal repository pre-commit hooks passed.
  • cargo build --locked --offline --features capi -j1 --bin rustpython passed.
  • From crates/capi: cargo clippy --offline --tests -j1 -- -D warnings passed.
  • A local-only C extension, compiled with -Wall -Wextra -Werror, calls the exported symbol through the existing native loader. All eleven required dynamic symbols were verified before loading.
  • The native fixture passed the unchanged TestCAPI.test_cfunction_call assertion body and six supplemental Python checks: empty keywords, a builtin callable, return identity, exception identity, non-callable rejection, and a subsequent successful call. All behavior assertions are in Python; no new Rust behavior tests or Rust-embedded Python tests were added.

Coverage boundary: this was direct invocation of the existing canonical method body, not a claim that the skipped canonical unittest class ran through the suite. The installed CPython 3.14.7 distribution lacks _testcapi, so reference runtime execution was unavailable; the exact tagged implementation and canonical assertions were audited. Full workspace tests, cross-platform ABI checks, and the hosted CI matrix are not claimed as local passes. The temporary native fixture is not committed, and existing canonical skips/assertions remain unchanged.

Assisted-by: OpenAI Codex:model identifier unavailable
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: RustPython/RustPython/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b9d7a09e-2424-4e4e-96dd-64ade688574c

📥 Commits

Reviewing files that changed from the base of the PR and between 1c7c801 and 91d3fa4.


📒 Files selected for processing (1)
  • crates/capi/src/methodobject.rs

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bschoenmaeckers bschoenmaeckers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not have to export this function. This function is only available on abi3, but not abi3t. So this function can never be used.

@youknowone
youknowone marked this pull request as ready for review October 10, 2026 11:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T11:10:55.134374Z 91d3fa4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@youknowone
youknowone merged commit bc5b9ab into RustPython:main Oct 10, 2026
8 of 9 checks passed
@youknowone

Copy link
Copy Markdown
Member

We do not have to export this function. This function is only available on abi3, but not abi3t. So this function can never be used.

oh.. sorry I missed this. Thank you for pointing it out

@youknowdot

Copy link
Copy Markdown
Contributor Author

@bschoenmaeckers Agreed. I checked call behavior but missed whether this legacy ABI-only export belongs to RustPython’s abi3t target. Follow-up draft #9059 removes exactly the ten lines introduced here, without adding or changing other exports. The CAPI-enabled build and Clippy pass; export inspection confirms PyCFunction_Call is absent while PyObject_Call and PyCFunction_New remain.

youknowone pushed a commit that referenced this pull request Oct 10, 2026
Follow up on #9055: RustPython targets abi3t, which does not require this legacy binary-compatibility entry point.

Assisted-by: OpenAI Codex:model identifier unavailable
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.

3 participants