-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
synapse fails to install with poetry 1.6.0 - "No module named 'synapse.synapse_rust'" at runtime #16147
Comments
Can you try passing |
Hmm. Poetry did a release over the weekend. Do you pin the version of poetry that you use? |
Synapse uses 1.3.2, e.g. synapse/.github/workflows/tests.yml Line 43 in 561d06b
Though I would expect more recent versions to work as well. |
Thanks for the suggestions. This is reproducible locally with the same error; i can't see the generated .so file mentioned above on my desktop. We haven't pinned the version of poetry; locally i'm using poetry 1.6.0 Going to try:
|
Going to pin to latest poetry before 1.6.0 to see if that helps, but maybe something in that latest release that's causing issues then. |
Even with -vvv the only extra messages I get in GHA are as follows, and
see https://github.com/michaelkaye/setup-matrix-synapse/actions/runs/5925479981/job/16064987664 Pinning poetry to 1.5.1 has solved my personal problem here; let me know if there's anything else debugging wise i can do to test I tell a lie: The .so file exists: |
We've gotten a few other reports of this biting people now; we might need to figure this out. |
With poetry 1.6.1 I end up with a
If I move this into my Synapse directory it works fine: |
We're fairly certain a new release of poetry-core will fix this, probably due to python-poetry/poetry-core#633. diff --git a/pyproject.toml b/pyproject.toml
index 5fb64479a1..23ef74885e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -381,7 +381,7 @@ furo = ">=2022.12.7,<2024.0.0"
# system changes.
# We are happy to raise these upper bounds upon request,
# provided we check that it's safe to do so (i.e. that CI passes).
-requires = ["poetry-core>=1.1.0,<=1.7.0", "setuptools_rust>=1.3,<=1.7.0"]
+requires = ["poetry-core @ git+https://github.com/python-poetry/poetry-core.git#main", "setuptools_rust>=1.3,<=1.7.0"]
build-backend = "poetry.core.masonry.api"
|
The root of this issue, IMHO, is the build configuration of the The issue appears to crop up when doing editable installs of this repo with Manually copying the .so file from build/**/synapse_rust.abi3.so to ./synapse resolves the issue, perhaps updating the rust module build configuration to do this for editable installs is another possible solution. At the time of this writing there is no longer an issue with Poetry not properly installing editable modules with extensions, re: python-poetry/poetry-core#633 I have tested with the latest version of poetry 1.7.1 On my system this is the trick to resolve the issue:
Unfortunately many tumultuous hours were spent tracking this down. This issue is a roadblock for new contributors making contributions to Synapse. |
I'm very unconvinced that if we left the module name as just
Yes, it is very frustrating, but we do recommend using 1.5.x in the docs, I don't think there's anything else we can do, unfortunately. |
@thebalaa: thanks for taking a look at this. We know this issue causes pain for contributors---it does for us too---and we would love to understand the right way to fix this. Python packaging is not fun, and by using poetry + poetry's build script + pyO3 + setuptools_rust we have certainly managed to make life hard for ourselves. Any help you can provide would be gratefully received. To summarise my understanding of the situation (please double-check my reasoning):
I don't follow how this would help. Suppose we changed the config to produce a shared object
(I'm very happy to be proven wrong---as Patrick says in #16147 (comment), if you can reproduce the problem and test to demonstrate this fix works then we'd be very interested!!) |
If you can give me some specific instructions to follow (or a branch of synapse to try to install, etc etc) I'm happy to use the reproducible failure from the synapse GHA to prove success/failure of this using various poetry versions. I might swing by the channel tomorrow? |
I was mistaken this is a poetry issue after all: python-poetry/poetry#8539 |
you will never know whether this is fixed in recent poetry-core, if you do not use recent poetry core Line 385 in 825ac7e
|
We have been periodically trying updated poetry-core versions. We were really hoping 1.7.0 would fix it, but the issue seems to persist. |
You knew in September that this was fixed in 1.8.0, I don't know when you forgot? |
This should fix it: #16702 |
I must have misquoted a version number, IIRC installing from git didn't work though and I didn't have further time to debug it. Maybe now that there's a release things will work properly. |
So I've poked at this off and on today: Moving to poetry 1.7.1 for the We seem to need to both upgrade the poetry used to install and the one defined within synapse. So poetry 1.7.1 + the patch in #16702 seems to work for getting this going. See workflows from setup-matrix-synapse that are now completing with poetry versions > 1.5.x. So basically I'd be in favour of incorporating this dependency bump. |
Description
originally reported in: michaelkaye/setup-matrix-synapse#95
This was last known working on 18 Aug at 17:00 UTC
No error seems to occur when poetry install is run.
Steps to reproduce
Steps we do for install are written in the GHA action: https://github.com/michaelkaye/setup-matrix-synapse/blob/main/create.js#L18
See github action results for the error: https://github.com/michaelkaye/setup-matrix-synapse/actions/runs/5924305224
Homeserver
testing server in GHA
Synapse Version
main
Installation Method
Other (please mention below)
Database
n/a - can't start synapse
Workers
Single process
Platform
Installed via michaelkaye/setup-matrix-synapse in a GHA worker
Configuration
N/A - can't start synapse
Relevant log output
Anything else that would be useful to know?
Installing via
pip
works fine - see alternate test cases in the github action.The text was updated successfully, but these errors were encountered: