Skip to content

Conversation

@anoadragon453
Copy link
Member

@anoadragon453 anoadragon453 commented Nov 27, 2025

This PR switches the build backend from poetry-core to maturin. This was prompted by the switch to poetry 2.x in #19137 being incompatible with Linux distributions that still only ship poetry 1.x. maturin should be supported on said distributions.

maturin it comes with the benefit of better PyO3 support. For instance, we can now remove the .ci/scripts/auditwheel_wrapper.py script which was needed to make the wheels produced by poetry-core include abi3 in the tags, instead of cpX.

Importantly, poetry install ... will still work and still build the synapse rust module. Development workflows do not need to change.

I've held off on migrating the [tool.poetry.group.dev.dependencies] section to [dependency-groups].dev (which was deliberately excluded in #19137). These dependencies are only for development of Synapse (running the release script, checking types, etc.). Switching to [dependency-groups] section would end up requiring poetry 2.2.0+ (and pip 25.1+). Despite this, as of #19137, pip install .[all] will install all other dependencies, which is enough to build packages.

You can then use maturin build (or cibuildwheel, as we do) to build packaged wheels under target/wheels/; no need for poetry nor poetry-core 2.x to be directly involved in the build process.


maturin includes its own auditwheel implementation. cibuildwheel will by default run auditwheel repair when building on Linux. In the interest of not breaking our wheels, we've opted to leave both implementations in place. We can look into disabling one of them separately.

Dev notes

Discussed in the internal backend team lobby room

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

Keeping `packages` and the rust build script allow `poetry install` to
continue to automatically build the rust modules for ease of
development.
`maturin` will build an abi3 compatible wheel by default.
@anoadragon453 anoadragon453 force-pushed the anoa/maturin_build_backend branch from 4d31c9f to 772614c Compare November 27, 2025 18:08
@anoadragon453 anoadragon453 marked this pull request as ready for review December 1, 2025 14:56
@anoadragon453 anoadragon453 requested a review from a team as a code owner December 1, 2025 14:56
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