Skip to content

debugpy: add build-debugpy.yml for riscv64 wheels - #350

Merged
luhenry merged 2 commits into
mainfrom
debugpy
Aug 25, 2026
Merged

debugpy: add build-debugpy.yml for riscv64 wheels#350
luhenry merged 2 commits into
mainfrom
debugpy

Conversation

@luhenry

@luhenry luhenry commented Aug 25, 2026

Copy link
Copy Markdown
Member

Adds a riscv64 wheel build for debugpy 1.8.21.

Why

debugpy publishes per-interpreter manylinux_2_34_x86_64 wheels that carry pydevd's two
Cython speedups — _pydevd_bundle/pydevd_cython*.so and
_pydevd_sys_monitoring/_pydevd_sys_monitoring_cython*.so — plus a py2.py3-none-any
fallback. On riscv64 today pip install debugpy lands on the pure-Python fallback, so the
debugger runs its slow tracer. This builds the compiled wheels.

Shape

Build-from-checkout via cibuildwheel, matrix cp312/cp313/cp314. pydevd ships the
pre-generated .c next to each .pyx, so nothing needs Cython at build time.

Notes:

  • REQUIRE_CYTHON_BUILD=1 is load-bearing (CLAUDE.md gotcha 20): setup.py's
    build_py.finalize_options shells out to setup_pydevd_cython.py build_ext and
    swallows the failure, and ext_modules is a truthy empty list, so without it a
    broken compile still produces a correctly-tagged cp3XX-manylinux_riscv64 wheel with no
    .so in it.
  • PYDEVD_USE_CYTHON=yes in the test phase makes pydevd_cython_wrapper raise instead of
    silently falling back to the pure-Python tracer, so the whole suite exercises the
    extension; a direct import probe runs ahead of pytest as well.
  • CIBW_TEST_SOURCES: tests pytest.initests/ is a package whose conftest.py
    registers tests.pytest_fixtures/tests.pytest_hooks, so it has to sit in the test cwd,
    and pytest.ini carries testpaths/-n8.
  • Test requirements are tests/requirements.txt minus gevent (not on our registry and no
    riscv64 wheel on PyPI; its single test is --ignored, and it self-skips on 3.13+ anyway)
    and the build-only vswhere/Cython.

Attach-by-PID and free-threading

The first CI run put both of these on the record, so they are deselections with evidence
rather than guesses.

  • attach_pid is skipped below 3.14. pydevd injects its attach shim from a per-arch
    prebuilt library, and add_code_to_python_process.py only accepts
    arm64/amd64/x86/x86_64/i386 — there is no riscv64 build of it upstream, so attach-by-PID
    cannot work. CPython 3.14 attaches through sys.remote_exec() instead
    (debugpy/server/cli.py), which needs no shim. That split is exactly what CI showed: the
    cp314 job passed all 1330 tests, while cp312 and cp313 failed 100 tests each and every
    one of them was an attach_pid parametrisation
    (Timed out waiting for debug server to connect). So -k "not attach_pid" is applied on cp312/cp313 only, and 3.14 keeps the
    full coverage.
  • No cp314t build. debugpy ships no free-threaded wheel on PyPI, its tox.ini envlist
    stops at py314, and its classifiers list no free-threading support. The cp314t job
    matched that: 40 pytest-xdist workers crashed outright, spread across every test module
    (test_threads, test_evaluate, test_args, test_exception, …), not a subset that
    points at one feature. Building it would mean shipping riscv64 a configuration upstream
    supports nowhere.

Upstream builds its released wheels in a private pipeline; the public
azure-pipelines/pipelines.yaml runs the same pytest suite through tox, which is what the
test command here mirrors.

debugpy publishes per-interpreter manylinux wheels containing pydevd's two
Cython speedups (pydevd_cython, _pydevd_sys_monitoring_cython) but no riscv64
build. Build-from-checkout via cibuildwheel; the pre-generated .c files ship in
the tree, so no Cython is needed.

REQUIRE_CYTHON_BUILD=1 is load-bearing: setup.py runs the pydevd extension
build in a subprocess and swallows failures, shipping a wheel with no .so.

Tests run upstream's own suite (tox drives the same pytest invocation) with
PYDEVD_USE_CYTHON=yes so pydevd raises rather than falling back to the
pure-Python tracer.
pydevd injects its attach shim with a per-arch prebuilt library and
add_code_to_python_process.py only accepts x86/i386/x86_64/amd64/arm64, so
attach-by-PID cannot work on riscv64. CPython 3.14 goes through
sys.remote_exec() instead (debugpy/server/cli.py), which is why the cp314 job
passed all 1330 tests while cp312/cp313 failed exactly the 100 attach_pid ones.

Drop cp314t: debugpy publishes no free-threaded wheel, its tox envlist stops at
py314, and the free-threaded job crashed 40 pytest-xdist workers spread across
every test module.
@luhenry
luhenry merged commit d941766 into main Aug 25, 2026
8 checks passed
@luhenry
luhenry deleted the debugpy branch August 25, 2026 14:56
@luhenry luhenry linked an issue Aug 25, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

debugpy riscv64 support

1 participant