-
-
Notifications
You must be signed in to change notification settings - Fork 640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[internal] Upgrade PyO3 to 14.1 #12405
Conversation
# Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
# Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tuple structs are also now legal with #[pyclass], so we can use the newytpe pattern via tuple structs.
I personally like this change a lot. I think it makes more clear when the PyFoo types are nothing more than newtypes w/ FFI support. Note that we still use a normal struct for PyNailgunClient
, which is not a newtype.
# Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally like this change a lot.
👍 really nice to see positive feedback! Also saw in #12225 you posted the perf gap is closed with 0.14, which is cool. We put a fair bit of work into optimising since 0.13.
if cfg!(target_os = "macos") { | ||
// N.B. On OSX, we force weak linking by passing the param `-undefined dynamic_lookup` to | ||
// the underlying linker. This avoids "missing symbol" errors for Python symbols | ||
// (e.g. `_PyImport_ImportModule`) at build time when bundling the PyO3 sources. | ||
// The missing symbols will instead by dynamically resolved in the address space of the parent | ||
// binary (e.g. `python`) at runtime. We do this to avoid needing to link to libpython | ||
// (which would constrain us to specific versions of Python). | ||
println!("cargo:rustc-cdylib-link-arg=-undefined"); | ||
println!("cargo:rustc-cdylib-link-arg=dynamic_lookup"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to keep this bit around - unfortunately it looks like I'll have to revert this for PyO3 0.14.2: PyO3/pyo3#1719
(I'll probably add something to the pyo3-build-config
crate to do essentially what you've written here.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, thanks! I'll pin to 14.1 for now. FYI I have an M1 machine also and I'm happy to help test things with that issue.
Great work with the release! I've been watching the repo via GitHub notifications and it's super exciting to see all the momentum 🥳 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
# Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
This allows us to simplify setup of the dependency.
Tuple structs are also now legal with
#[pyclass]
, so we can use the newytpe pattern via tuple structs.See https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md for the changelog.