Skip to content

Add an API to set rpath when using macOS system Python#4833

Merged
messense merged 1 commit into
PyO3:mainfrom
messense:macos-framework-rpath
Jan 2, 2025
Merged

Add an API to set rpath when using macOS system Python#4833
messense merged 1 commit into
PyO3:mainfrom
messense:macos-framework-rpath

Conversation

@messense

@messense messense commented Jan 1, 2025

Copy link
Copy Markdown
Member

Because of rust-lang/cargo#9554 we can not do it automatically, I think adding an API is better than ask users to hardcode it in build.rs or .cargo/config.toml.

@messense messense force-pushed the macos-framework-rpath branch from 1bb8ba1 to 0492f55 Compare January 1, 2025 14:06

@davidhewitt davidhewitt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems fine to me, thanks 👍

@davidhewitt

Copy link
Copy Markdown
Member

Ah, CI failing.

@messense messense force-pushed the macos-framework-rpath branch from 0492f55 to 8545853 Compare January 2, 2025 00:17
@messense messense force-pushed the macos-framework-rpath branch from 8fc29a1 to c467d9e Compare January 2, 2025 05:48
@messense messense added this pull request to the merge queue Jan 2, 2025
Merged via the queue into PyO3:main with commit f08bc95 Jan 2, 2025
@messense messense deleted the macos-framework-rpath branch January 2, 2025 07:19
JeanArhancet pushed a commit to JeanArhancet/pyo3 that referenced this pull request Jan 17, 2025
geofft added a commit to geofft/pyo3 that referenced this pull request Feb 3, 2025
Relocatable Python installations like python-build-standalone have a
similar need for an rpath as the macOS framework builds in Xcode.
Furthermore, the platform on which you build your code is not really a
function of the code itself. This change generalizes the recent
`add_python_framework_link_args()` from PyO3#4833 to
`add_python_link_args()`, which also does the right thing on
python-build-standalone, and encourages everyone to set up a build.rs
file that invokes it, whether or not they need it on their current
machine.
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.

2 participants