Switch the build backend from poetry-core to maturin
#19234
+84
−239
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR switches the build backend from
poetry-coretomaturin. This was prompted by the switch to poetry 2.x in #19137 being incompatible with Linux distributions that still only ship poetry 1.x.maturinshould be supported on said distributions.maturinit comes with the benefit of better PyO3 support. For instance, we can now remove the.ci/scripts/auditwheel_wrapper.pyscript which was needed to make the wheels produced bypoetry-coreincludeabi3in the tags, instead ofcpX.Importantly,
poetry install ...will still work and still build thesynapserust 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 requiringpoetry 2.2.0+(andpip 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(orcibuildwheel, as we do) to build packaged wheels undertarget/wheels/; no need forpoetrynorpoetry-core2.x to be directly involved in the build process.maturinincludes its ownauditwheelimplementation.cibuildwheelwill by default runauditwheel repairwhen 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
EventStoretoEventWorkerStore.".code blocks.