Skip to content
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

ffi: link to _PyPyBytes_Resize #2752

Merged
merged 1 commit into from
Nov 19, 2022
Merged

ffi: link to _PyPyBytes_Resize #2752

merged 1 commit into from
Nov 19, 2022

Conversation

birkenfeld
Copy link
Member

Fixes #2737

@birkenfeld birkenfeld added the CI-skip-changelog Skip checking changelog entry label Nov 19, 2022
@messense messense merged commit 3408cc4 into main Nov 19, 2022
@messense messense deleted the 2737-fix branch November 19, 2022 15:45
@darleybarreto
Copy link

When compiling for PyPy, _PyBytes_Resize wont be available, I think we could move the definition of this function out of cpython folder, like adding it here (or somewhere else in src/bytesobject.rs):

#[cfg_attr(windows, link(name = "pythonXY"))]
extern "C" {
    #[cfg_attr(PyPy, link_name = "PyPyBytes_Type")]
    pub static mut PyBytes_Type: PyTypeObject;
    pub static mut PyBytesIter_Type: PyTypeObject;
    #[cfg_attr(PyPy, link_name = "_PyPyBytes_Resize")]
    pub fn _PyBytes_Resize(bytes: *mut *mut PyObject, newsize: Py_ssize_t) -> c_int;
}

@birkenfeld
Copy link
Member Author

Damn, I saw there were already PyPy conditionals in bytesobject.rs, so I didn't check. Removing the conditional inmod.rs seems to be the right course of action.

@birkenfeld
Copy link
Member Author

See also #2758

@messense
Copy link
Member

The CI failure on main is caused by oli-obk/cargo_metadata#212

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-skip-changelog Skip checking changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding _PyBytes_Resize for PyPy
3 participants