tantivy-py icon indicating copy to clipboard operation
tantivy-py copied to clipboard

Consider building abi3 wheels

Open adamreichold opened this issue 2 years ago • 6 comments

To reduce build effort and improve portability, PyO3 supports building in "abi3" mode where Python's stable ABI/API is used which makes the resulting binary wheels forward-compatible beginning at a specified Python version, e.g. wheels using the abi3-py38 feature are compatible with Python 3.8 and later.

This can cost some performance if there is a lot of back and forth between Rust and Python code, but whether that cost is significant for this extension is hard to say without measuring it.

adamreichold avatar Jun 21 '23 05:06 adamreichold

It's a good idea, we should do this.

cjrh avatar Jun 21 '23 09:06 cjrh

fyi @wallies - since we're planning on a new release soon anyway maybe now is a good time to do this.

cjrh avatar Jul 21 '23 10:07 cjrh

Had a look. Sadly, PyDateTime for now is not supported in the limited ABI and we use it in document.rs.

cjrh avatar Aug 26 '23 13:08 cjrh

@cjrh, @wallies, would you mind joining the #tantivy-py channel on the Quickwit Discord server. There have been many questions regarding tantivy-py on the server lately, and we thought you'd be interested in those conversations.

guilload avatar Aug 30 '23 13:08 guilload

Apparently there is some kind of fallback support for datetime described in this PR: https://github.com/PyO3/pyo3/issues/3633. I need to look at it but perhaps there's a path for us.

cjrh avatar Mar 19 '24 23:03 cjrh

Indeed @Tpt contributed a fully abi3-compatible variant of PyO3's chrono integration feature which means that it can be used for these builds with only a slight performance degradation using exactly the same Rust-side API.

adamreichold avatar Mar 20 '24 18:03 adamreichold