Skip to content

Conversation

@davidhewitt
Copy link
Member

Possible replacement for #5622

This PR adds pyo3_build_config::add_libpython_rpath_link_args(), to set rpath to libpython from crate build scripts.

The idea here is that using rpath should make it trivial to link to the correct libpython; we already have add_python_framework_link_args which is doing the same thing (and should probably merge with this proposed function).

I remove pyo3-ffi-check's use of the extension-module feature and use this API instead, which should demonstrate if it works...

@davidhewitt davidhewitt marked this pull request as ready for review November 18, 2025 12:04
@davidhewitt
Copy link
Member Author

Anyone got concerns with this? Otherwise I'll merge to unblock #5588

Copy link
Contributor

@Icxolu Icxolu left a comment

Choose a reason for hiding this comment

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

Sounds reasonable to me. I assume this flag is simply ignored on windows, as I don't think there is an equivalent to rpath there. Or should we gate it behind an not(windows) anyway?

@davidhewitt
Copy link
Member Author

It seems like it just works: https://github.com/PyO3/pyo3/actions/runs/19465508572/job/55701947465 - built and ran ffi check fine on Windows.

If it turns out to be a problem later, we can internally make it a noop on windows, which will be easier for users to consume anyway.

@davidhewitt davidhewitt added this pull request to the merge queue Nov 29, 2025
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