-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix check for outdated Rust library #17861
Conversation
This failed when install with poetry, so let's properly try and detect what's going on.
@@ -0,0 +1 @@ | |||
Fix detection when the built Rust library was outdated when using source installations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This failed when install with poetry, so let's properly try and detect what's going on.
What's the testing strategy for this?
- Create a new directory
poetry new synapse-pr-17861-test
cd synapse-pr-17861-test
poetry add synapse
(but install from this branch)- ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for source check outs, so run poetry install -E "all test"
in a checkout of this branch. Then python -c "import synapse"
should work, while if you edit a rust source file it should then fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good ✅
Test what happens before this change:
git clone [email protected]:element-hq/synapse.git synapse-pr-17861-test
cd synapse-pr-17861-test
poetry install --extras all
poetry run python -c "import synapse"
(works as expected)- Make an edit to one of the rust files like
rust/src/http.rs
poetry run python -c "import synapse"
(works when it shouldn't ❌)
Test how this PR fixes things:
git checkout erikj/fix_outdated_rust_detection
- Actually complains about dirty Rust source files (worked as expected)
$ poetry run python -c "import synapse" Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/eric/Downloads/synapse-pr-17861-test2/synapse/__init__.py", line 107, in <module> check_rust_lib_up_to_date() File "/home/eric/Downloads/synapse-pr-17861-test2/synapse/util/rust.py", line 51, in check_rust_lib_up_to_date raise Exception("Rust module outdated. Please rebuild using `poetry install`") Exception: Rust module outdated. Please rebuild using `poetry install`
- Re-install as instructed to rebuild rust:
poetry install --extras all
poetry run python -c "import synapse"
(works as expected ✅)
Thank you! |
This failed when install with poetry, so let's properly try and detect what's going on.