web-platform-tests / wpt

Test suites for Web platform specs — including WHATWG, W3C, and others
https://web-platform-tests.org/
Other
5.02k stars 3.12k forks source link

`wpt run chrome` fails with python import error from webtransport, on Python 3.11 on Windows #43628

Open saschanaz opened 11 months ago

saschanaz commented 11 months ago
> python wpt run chrome /push-api/subscribe-without-active-sw.https.window.html

[notice] A new release of pip is available: 23.1.2 -> 23.3.1
[notice] To update, run: D:\gecko\testing\web-platform\tests\_venv3\Scripts\python.exe -m pip install --upgrade pip

[notice] A new release of pip is available: 23.1.2 -> 23.3.1
[notice] To update, run: D:\gecko\testing\web-platform\tests\_venv3\Scripts\python.exe -m pip install --upgrade pip

[notice] A new release of pip is available: 23.1.2 -> 23.3.1
[notice] To update, run: D:\gecko\testing\web-platform\tests\_venv3\Scripts\python.exe -m pip install --upgrade pip
ERROR A valid MojoJS version cannot be found for browser binary version 122.0.6180.0.
Download and install chromedriver [Y/n]? y
wptserve CRITICAL Failed to start WebTransport over HTTP/3 server: cannot import name 'x509' from 'cryptography.hazmat.bindings._rust' (unknown location)
Traceback (most recent call last):
  File "D:\gecko\testing\web-platform\tests\wpt", line 10, in <module>
    wpt.main()
  File "D:\gecko\testing\web-platform\tests\tools\wpt\wpt.py", line 233, in main
    rv = script(*args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\gecko\testing\web-platform\tests\tools\wpt\run.py", line 1019, in run
    rv = run_single(venv, **wptrunner_kwargs) > 0
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\gecko\testing\web-platform\tests\tools\wpt\run.py", line 1028, in run_single
    return wptrunner.start(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\gecko\testing\web-platform\tests\tools\wptrunner\wptrunner\wptrunner.py", line 556, in start
    rv = not run_tests(**kwargs)[0] or logged_critical.has_log
             ^^^^^^^^^^^^^^^^^^^
  File "D:\gecko\testing\web-platform\tests\tools\wptrunner\wptrunner\wptrunner.py", line 453, in run_tests
    test_environment.ensure_started()
  File "D:\gecko\testing\web-platform\tests\tools\wptrunner\wptrunner\environment.py", line 271, in ensure_started
    failed, pending = self.test_servers()
                      ^^^^^^^^^^^^^^^^^^^
  File "D:\gecko\testing\web-platform\tests\tools\wptrunner\wptrunner\environment.py", line 298, in test_servers
    if not webtranport_h3_server_is_running(host, port, timeout=5.0):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\gecko\testing\web-platform\tests\tools\wptrunner\wptrunner\environment.py", line 54, in webtranport_h3_server_is_running
    from webtransport.h3.webtransport_h3_server import server_is_running  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\gecko\testing\web-platform\tests\tools\webtransport\h3\webtransport_h3_server.py", line 16, in <module>
    from aioquic.asyncio import QuicConnectionProtocol, serve  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\gecko\testing\web-platform\tests\_venv3\lib\site-packages\aioquic\asyncio\__init__.py", line 1, in <module>
    from .client import connect  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\gecko\testing\web-platform\tests\_venv3\lib\site-packages\aioquic\asyncio\client.py", line 8, in <module>
    from ..quic.configuration import QuicConfiguration
  File "d:\gecko\testing\web-platform\tests\_venv3\lib\site-packages\aioquic\quic\configuration.py", line 6, in <module>
    from ..tls import (
  File "d:\gecko\testing\web-platform\tests\_venv3\lib\site-packages\aioquic\tls.py", line 24, in <module>
    from cryptography import x509
  File "d:\gecko\testing\web-platform\tests\_venv3\lib\site-packages\cryptography\x509\__init__.py", line 7, in <module>
    from cryptography.x509 import certificate_transparency
  File "d:\gecko\testing\web-platform\tests\_venv3\lib\site-packages\cryptography\x509\certificate_transparency.py", line 11, in <module>       
    from cryptography.hazmat.bindings._rust import x509 as rust_x509
ImportError: cannot import name 'x509' from 'cryptography.hazmat.bindings._rust' (unknown location)

Passing --no-enable-webtransport-h3 works around the issue for now.

gsnedders commented 11 months ago

What version of cryptography do you have installed? (I presume this just exists only as a dependency that we don't pin, which seems bad?)

Like, what's d:\gecko\testing\web-platform\tests\_venv3\bin\pip3.exe freeze give?

saschanaz commented 11 months ago

41.0.5, it seems.