Skip to content

fix raw-dylib opt-out on windows x86 - #6410

Merged
davidhewitt merged 7 commits into
PyO3:mainfrom
davidhewitt:x86-raw-dylib
Sep 16, 2026
Merged

davidhewitt merged 7 commits into
PyO3:mainfrom
davidhewitt:x86-raw-dylib

Conversation

@davidhewitt

Copy link
Copy Markdown
Member

Split from #6389 - this PR applies the changes to pyo3-ffi-check (with a FIXME for PyPy which that PR will resolve), CI and noxfile.py, while leaving the pyo3-ffi fixes for PyPy for the followup.

The discovery in #6389 was that 32-bit windows' opt-out for raw-dylib merged in #6185 is slightly broken because the workaround for _ link names is still applied. This PR fixes that.

I think this'll also fix the 32-bit windows failure seen in PyO3/setuptools-rust#615

@ngoldbaum ngoldbaum 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.

I had an AI model look over this an it spotted some issues.

Comment thread pyo3-ffi/src/abstract_.rs
Comment thread pyo3-ffi/build.rs
// for `raw-dylib` in general, rather than as a patch here.
//
// Assert expected raw pypy dll name as a sanity check for now
assert_eq!(

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.

I think this would make a config file with implementation=PyPy, version=3.11, and lib_name=python311 fail when PYO3_USE_RAW_DYLIB=0. I think you need to preserve explicitly-configured DLL names.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Would you be amenable to this being dealt with in a follow-up? I think probably the raw-dylib stuff all needs to be refactored to move to pyo3-build-config properly rather than dealt with in pyo3-ffi.

(I don't think any such hypothetical pypy build with python311.dll is likely to be a real-world case, though the AI model is right that this patch here is a hack.)

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.

fine with me!

@davidhewitt
davidhewitt added this pull request to the merge queue Sep 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 15, 2026
@davidhewitt
davidhewitt added this pull request to the merge queue Sep 16, 2026
Merged via the queue into PyO3:main with commit 276ffd2 Sep 16, 2026
91 of 92 checks passed
@davidhewitt
davidhewitt deleted the x86-raw-dylib branch September 16, 2026 04:02
davidhewitt added a commit that referenced this pull request Sep 17, 2026
* fix raw-dylib opt-out on windows x86

* newsfragment

* correct PyPy build failures

* `PyVectorcall_Call` is 3.12+

* workaround incorrect lib name for PyPy with raw-dylib opt out

* fix `PyVectorcall_Call` cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants