websocketprocessbridge not launching properly on recent local builds
Categories
(Core :: WebRTC: Networking, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox111 | --- | fixed |
People
(Reporter: bwc, Assigned: bwc)
Details
Attachments
(1 file)
Seems that recent installations of python on linux and OS X are running into problems with the version of attrs (19.1.0) we have vendored in third_party/python. I've verified by hand that updating this vendored copy to 19.2.0 solves the problem locally, but of course this will effect lots of stuff besides our tests.
| Assignee | ||
Comment 1•3 years ago
•
|
||
Ok, now I'm seeing different behavior. We have a more recent version of attrs in third_party, and if I add attrs to websocketprocessbridge_requirements_3.txt, it finds it:
Requirement already satisfied: attrs>=19.2.0 in ./third_party/python/attrs (from -r /Users/bcampen/checkouts/mozilla-central/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements_3.txt (line 15)) (19.2.0)
But when it comes time to run, we fail to import:
Traceback (most recent call last):
File "/Users/bcampen/checkouts/mozilla-central/obj-aarch64-apple-darwin22.3.0/_tests/testing/mochitest/websocketprocessbridge/websocketprocessbridge.py", line 8, in <module>
from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory
File "/Users/bcampen/checkouts/mozilla-central/obj-aarch64-apple-darwin22.3.0/_virtualenvs/common/lib/python3.9/site-packages/autobahn/twisted/__init__.py", line 40, in <module>
from autobahn.twisted.websocket import \
File "/Users/bcampen/checkouts/mozilla-central/obj-aarch64-apple-darwin22.3.0/_virtualenvs/common/lib/python3.9/site-packages/autobahn/twisted/websocket.py", line 35, in <module>
from twisted.internet import endpoints
File "/Users/bcampen/checkouts/mozilla-central/obj-aarch64-apple-darwin22.3.0/_virtualenvs/common/lib/python3.9/site-packages/twisted/internet/endpoints.py", line 63, in <module>
from twisted.python.systemd import ListenFDs
File "/Users/bcampen/checkouts/mozilla-central/obj-aarch64-apple-darwin22.3.0/_virtualenvs/common/lib/python3.9/site-packages/twisted/python/systemd.py", line 18, in <module>
from attrs import Factory, define
ModuleNotFoundError: No module named 'attrs'
0:03.17 ERROR runtests.py | websocket/process bridge failed to launch. Are all the dependencies installed?
Additionally, I do not see anything in-tree that tries to import anything from attrs (besides tests within attrs itself), which makes me wonder why we vendor it in the first place...
Comment 2•3 years ago
|
||
I think the answer to both questions is that while the package is called attrs, the module is actually attr:
https://searchfox.org/mozilla-central/search?q=import+attr&path=.py%24&case=true®exp=false
Looks like attrs changed their API a couple years back and switched from import attr to import attrs:
https://www.attrs.org/en/stable/changelog.html#id7
So I guess that version of twisted will require at least version 21.3.0. Maybe they don't have their dependency constrained correctly? If it's too hard to update attrs in the vendored dir, adding it directly to websocketprocessbridge_requirements.txt might work. Either that or downgrade twisted to a version that is compatible with our vendored attrs.
| Assignee | ||
Comment 3•3 years ago
|
||
So adding a more recent version of attrs to the requirements file helps a little, but still breaks because the new attrs in the virtualenv eventually tries to import stuff from our vendored attrs.
Traceback (most recent call last):
File "/Users/bcampen/checkouts/mozilla-central/obj-aarch64-apple-darwin22.3.0/_tests/testing/mochitest/websocketprocessbridge/websocketprocessbridge.py", line 8, in <module>
from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory
File "/Users/bcampen/checkouts/mozilla-central/obj-aarch64-apple-darwin22.3.0/_virtualenvs/common/lib/python3.9/site-packages/autobahn/twisted/__init__.py", line 40, in <module>
from autobahn.twisted.websocket import \
File "/Users/bcampen/checkouts/mozilla-central/obj-aarch64-apple-darwin22.3.0/_virtualenvs/common/lib/python3.9/site-packages/autobahn/twisted/websocket.py", line 35, in <module>
from twisted.internet import endpoints
File "/Users/bcampen/checkouts/mozilla-central/obj-aarch64-apple-darwin22.3.0/_virtualenvs/common/lib/python3.9/site-packages/twisted/internet/endpoints.py", line 63, in <module>
from twisted.python.systemd import ListenFDs
File "/Users/bcampen/checkouts/mozilla-central/obj-aarch64-apple-darwin22.3.0/_virtualenvs/common/lib/python3.9/site-packages/twisted/python/systemd.py", line 18, in <module>
from attrs import Factory, define
File "/Users/bcampen/checkouts/mozilla-central/obj-aarch64-apple-darwin22.3.0/_virtualenvs/common/lib/python3.9/site-packages/attrs/__init__.py", line 3, in <module>
from attr import (
ImportError: cannot import name 'AttrsInstance' from 'attr' (/Users/bcampen/checkouts/mozilla-central/third_party/python/attrs/attr/__init__.py)
| Assignee | ||
Comment 4•3 years ago
|
||
I figured out the workaround. This needs to restrict twisted to exactly version 18.7.0:
On local builds, we were getting newer versions than our vendored attrs could deal with, and twisted's dependencies must have been wrong to boot.
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Comment 5•3 years ago
|
||
Seems to work locally, let's see if it breaks CI though...
https://treeherder.mozilla.org/jobs?repo=try&revision=90b3a8541aa75635de0cb52d5312ed02be4195ac
| Assignee | ||
Comment 6•3 years ago
|
||
Huh. We don't have that version in our pypi. Trying another...
| Assignee | ||
Comment 7•3 years ago
|
||
It seems that we do not have a copy of twisted 20.3.0 on our pypi that works with windows?
https://treeherder.mozilla.org/jobs?repo=try&revision=ba4f13cb1fabac1c3090b054ecb0ac8e2c8a8a5c
| Assignee | ||
Comment 8•3 years ago
|
||
Maybe 21.2.0 will work?
https://treeherder.mozilla.org/jobs?repo=try&revision=d2436392efc61c3f655ae8f6d87485d6132ea998
| Assignee | ||
Comment 9•3 years ago
|
||
21.2.0 works!
| Assignee | ||
Comment 10•3 years ago
|
||
| Assignee | ||
Comment 11•3 years ago
|
||
| Assignee | ||
Comment 12•3 years ago
|
||
Try looks fine.
Comment 13•3 years ago
|
||
Comment 14•3 years ago
|
||
| bugherder | ||
Updated•3 years ago
|
Description
•