Building a wheel on macOS when using a `PyClass` from different crate does not work
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.2k
- Forks
- 1k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 66
Description
I have a crate in which I define a PyClass. This PyClass I want to use in a different crate from which I want to build a wheel using maturin. This works perfectly fine on linux. On macOS and Windows, however, it does not.
I've built a minimum "failing" version of my example here inluding the error log. What I found is that I can get it to work on macOS as long as
- the crate that defines the
PyClassdoes not have a#[pymodule]function, and - that the
PyClassdoes not have a method attached (#[new]works).
I asked this here on the gitter and @mejrs mentioned that it works on Windows if ABI features are disabled.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked minimal failing repository and its error log, reproducing the wheel build on macOS and Windows and comparing it with Linux. Investigate the reported effects of a #[pymodule] function, methods on the PyClass, and disabled ABI features; done means the cross-crate PyClass wheel builds successfully on the affected platforms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100