doc: Improve test suite dependencies documentation #35395

pull hebasto wants to merge 4 commits into bitcoin:master from hebasto:260527-ft-needed changing 7 files +70 −53
  1. hebasto commented at 1:28 PM on May 27, 2026: member

    The current documentation has multiple issues:

    1. OS-specific notes are missing for the pycapnp module.
    2. python3-zmq is a package name in some Linux distros, rather than a Unix-wide convention.
    3. Installing pyzmq from PyPI works in general, not only on macOS.
    4. The new lsof dependency is undocumented.

    This PR resolves these issues. Additionally, two minor improvements have been added (see commit messages).

  2. hebasto added the label Docs on May 27, 2026
  3. hebasto added the label Tests on May 27, 2026
  4. DrahtBot commented at 1:28 PM on May 27, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35395.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK maflcko
    Concept ACK l0rinc

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35216 (qa: Improve functional test support on illumos and *BSD by hebasto)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. fanquake commented at 1:34 PM on May 27, 2026: member

    Looks like you've just removed immediately usable OS specific instructions, and replaced them with general ones, just forcing devs to go and find the same info? i.e currently a FreeBSD dev could just copy pkg install python3 databases/py-sqlite3 net/py-pyzmq, now they'd have to go and find the package names themselves?

  6. hebasto commented at 2:40 PM on May 27, 2026: member

    Looks like you've just removed immediately usable OS specific instructions, and replaced them with general ones, just forcing devs to go and find the same info? i.e currently a FreeBSD dev could just copy pkg install python3 databases/py-sqlite3 net/py-pyzmq, now they'd have to go and find the package names themselves?

    That's correct, it is a trade-off. While it does require a quick search from the developer, the alternative is duplicating every dependency instruction across all OS-specific notes, e.g., pkg install lsof or pip3 install pycapnp. As we saw with recent updates (#33201 and #34256), trying to maintain exact, OS-specific package names quickly becomes a fragile approach.

  7. fanquake commented at 9:28 AM on May 28, 2026: member

    trying to maintain exact, OS-specific package names quickly becomes a fragile approach.

    Not sure I agree. That's what we do in the rest of the build documentation, and it seems to work fine.

  8. maflcko commented at 10:37 AM on May 28, 2026: member

    I haven't looked, but are the bsd docs largely different? if not, maybe they can be merged into a single build-bsd.md in the style of build-unix.md from #35402?

    Going further, maybe we can just merge build-bsd.md and build-unix.md into a single build.md (and only keep build-osx and build-windows), or possibly merge even them into a separate section in a general build.md file?

  9. l0rinc commented at 12:28 PM on May 30, 2026: contributor

    Thanks for documenting these, concept ACK

  10. in test/README.md:43 in 807b77cc97 outdated
      42 | +##### `sqlite3`
      43 | +
      44 | +Required for wallet tests.
      45 | +
      46 | +Most Python installations include the [`sqlite3`](https://docs.python.org/3/library/sqlite3.html) optional module by default.
      47 | +If that is not the case, look for documentation from your OS package manager, as it might be vendored as a separate package.
    


    maflcko commented at 2:30 PM on June 10, 2026:

    If FreeBSD is the only one sticking out here, it would be fine to briefly mention databases/py-sqlite3 for FreeBSD, but not strong opinion.


    hebasto commented at 12:27 PM on July 6, 2026:

    Done.


    fanquake commented at 11:03 AM on July 8, 2026:

    If FreeBSD is the only one sticking out here,

    It isn't. I still don't quite understand how removing working instructions is an "improvement", especially given the rationale is that it's impossible to maintain individual package names (even though we do it everywhere else just fine).


    hebasto commented at 11:12 AM on July 8, 2026:

    I still don't quite understand how removing working instructions is an "improvement", especially given the rationale is that it's impossible to maintain individual package names (even though we do it everywhere else just fine).

    I'm open to alternative suggestions on how to fix the issues mentioned in the PR description in way that prevents documentation from rotting in the future.


    maflcko commented at 12:06 PM on July 8, 2026:

    I don't mind either way. Just listing the Pip names is fine, or listing all.

    If all should be listed, it can be done with a compact markdown table, like:

    | Dependency | Python | zmq | capnp | sqlite3 |
    | :--- | :--- | :--- | :--- | :--- |
    | **Pip** | n/a | `pyzmq` | `pycapnp` | n/a |
    | **Ubuntu/Debian** | `python3` | `python3-zmq` | n/a | n/a |
    | **FreeBSD** | `python3` | `net/py-pyzmq` | n/a | `databases/py-sqlite3` |
    | **NetBSD** | `python313` | `py313-zmq` | n/a | n/a |
    | **OpenBSD** | `python` | `py3-zmq` | n/a | n/a |
    

    Rendered:

    Test dependency Python zmq capnp sqlite3
    Pip n/a pyzmq pycapnp n/a
    Ubuntu/Debian python3 python3-zmq n/a n/a
    FreeBSD python3 net/py-pyzmq n/a databases/py-sqlite3
    NetBSD python313 py313-zmq n/a n/a
    OpenBSD python py3-zmq n/a n/a
  11. in test/README.md:36 in 807b77cc97 outdated
      35 | -- on Unix, run `sudo apt-get install python3-zmq`
      36 | -- on mac OS, run `pip3 install pyzmq`
      37 | +#### Python optional modules
      38 |  
      39 | -The IPC functional test requires a python IPC library. `pip3 install pycapnp` may work, but if not, install it from source:
      40 | +Some tests require optional modules. If a module is not installed, the tests will be skipped rather than failed.
    


    maflcko commented at 2:34 PM on June 10, 2026:

    Maybe add a sentence that the docs here only mention the pip package names, which can be installed via the system package manager (if they are offered), or via pip in a venv, or uv, or any other choice the user prefers?


    hebasto commented at 12:28 PM on July 6, 2026:

    Would you mind suggesting the exact wording?


    maflcko commented at 3:42 PM on July 6, 2026:

    Maybe this?

    The optional modules can be installed with any suitable tool, like the system package manager, `pip` in a virtual environment, or `uv`.
    
    

    hebasto commented at 4:11 PM on July 6, 2026:

    Thanks! Reworked.

  12. in test/README.md:59 in 807b77cc97 outdated
      58 | +
      59 | +Required for IPC tests.
      60 | +
      61 | +The `capnp` module is generally available as the [`pycapnp`](https://pypi.org/project/pycapnp/) Python package.
      62 | +
      63 | +If installing the package via `pip` fails, install it from source:
    


    maflcko commented at 2:37 PM on June 10, 2026:

    Do we recall why this was needed and if it is still needed? If not, it can be removed?


    hebasto commented at 12:29 PM on July 6, 2026:

    I'm going to test a few platforms.


    hebasto commented at 3:12 PM on July 7, 2026:

    The package installation via pip works flawlessly: https://github.com/hebasto/github-actions/actions/runs/28876798270.


    sedited commented at 3:16 PM on July 7, 2026:

    Should we remove the instructions then?


    maflcko commented at 4:11 PM on July 7, 2026:

    Yeah, should be fine to remove in a new commit. If it is ever needed in the future, it will be trivial to revert that commit.


    hebasto commented at 10:54 AM on July 8, 2026:

    On my local NetBSD 10.1, pip3 install pycapnp works just fine. However, on the same OS in the CI, a quirk is necessary:

    CXXFLAGS="-DKJ_NO_EXCEPTIONS=0" pip3.13 install pycapnp
    

    I'm fine with that for the following reasons:

    1. The same quirk is already used to build the capnp package.
    2. It won't be needed on NetBSD 11.0.

    maflcko commented at 11:01 AM on July 8, 2026:

    Interesting. Though, I presume a NetBSD 10.1 error wasn't the reason why the section was originally added?

    Also, I wonder if installing from source also requires enabling exceptions, or if this is just a pip package and NetBSD-package thing on NetBSD 10.1?

    Also, I wonder what the error message is in case exceptions are disabled. If the error message literally says to set CXXFLAGS="-DKJ_NO_EXCEPTIONS=0", then it seems fine to just let the error message do the heavy lifting here instead of adding it to the docs?


    hebasto commented at 11:35 AM on July 8, 2026:
  13. in test/README.md:214 in aa094f4937 outdated
     208 | @@ -209,7 +209,7 @@ pkill -9 bitcoind
     209 |  ```
     210 |  
     211 |  
     212 | -##### Data directory cache
     213 | +#### Data directory cache
     214 |  
     215 |  A pre-mined blockchain with 200 blocks is generated the first time a
    


    maflcko commented at 2:43 PM on June 10, 2026:

    Can be removed after 8bfb422de83654c18cd341de8eb8e5351959d998 ?


    maflcko commented at 3:15 PM on June 15, 2026:

    (Happy to address the nits here in a separate pull, as they are somewhat unrelated)


    hebasto commented at 3:23 PM on June 15, 2026:

    (Happy to address the nits here in a separate pull, as they are somewhat unrelated)

    Go for it :)


    maflcko commented at 8:35 AM on June 16, 2026:

    Actually, I think this refers to running tests individually, not to running the tests with the test_runner, so the docs here still apply and can be kept for now.

    Feel free to resolve this thread and push your rebase, with or without the other nits. Happy to re-ack either way.

  14. in doc/build-freebsd.md:75 in 807b77cc97 outdated
      76 | -```bash
      77 | -pkg install python3 databases/py-sqlite3 net/py-pyzmq
      78 | -```
      79 | ----
      80 | +See [`test/README.md`](/test/README.md#dependencies-and-prerequisites).
      81 |  
    


    maflcko commented at 2:44 PM on June 10, 2026:

    nit in 807b77cc978d44a4b22267473283b4de6c43b62f: When adding those to *bsd.md, why not add them to *unix.md as well?


    hebasto commented at 12:30 PM on July 6, 2026:

    Thanks! Done.

  15. maflcko commented at 2:49 PM on June 10, 2026: member

    lgtm, just some nits

    review ACK 61226c09c137cc552976cbc86fb69da3c12fc295 🐡

    <details><summary>Show signature</summary>

    Signature:

    untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
    RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
    trusted comment: review ACK 61226c09c137cc552976cbc86fb69da3c12fc295 🐡
    sGJAuu2CrT3orY5rhqcct7ih5+h56G7KQYBzbPy1/WlHTDbf5BUktHfI2CcZB/tFBpFEXYbMTBukQf2RhFZLDQ==
    

    </details>

  16. DrahtBot requested review from l0rinc on Jun 10, 2026
  17. DrahtBot added the label Needs rebase on Jun 15, 2026
  18. hebasto marked this as a draft on Jun 15, 2026
  19. maflcko commented at 9:54 AM on July 6, 2026: member

    @hebasto rebase ping :pray:

  20. hebasto force-pushed on Jul 6, 2026
  21. hebasto commented at 12:26 PM on July 6, 2026: member

    Rebased and addressed some of the feedback.

  22. DrahtBot removed the label Needs rebase on Jul 6, 2026
  23. in test/README.md:321 in 4f6aa41e4b


    maflcko commented at 3:18 PM on July 6, 2026:

    nit in 4f6aa41e4b4219b56842cad7120f5289dbbede40: Bad rebase?


    hebasto commented at 4:10 PM on July 6, 2026:

    Thanks! Fixed.

  24. maflcko commented at 3:42 PM on July 6, 2026: member

    only change is rebase.

    re-ACK 0e1e0d1d8573a581b7d0a61a5d9fef1525723425 🗨

    <details><summary>Show signature</summary>

    Signature:

    untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
    RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
    trusted comment: re-ACK 0e1e0d1d8573a581b7d0a61a5d9fef1525723425 🗨
    UhvUQl8X2jK/OK1ddcEmHhM2trWYI6rIKsc7KWTLBfbbzbC1t9KuP93GspZStR9Zhtln5586PX7w4dscaT2+Bw==
    

    </details>

  25. doc: Fix header formatting in `test/README.md` 12b010a9d4
  26. doc: Improve Python UTF-8 mode note
    Additionally, switch the example code to PowerShell to match our other
    Windows docs.
    49f3366623
  27. doc: Unify Python optional module documentation
    The current documentation has multiple issues:
    1. OS-specific notes are missing for the `pycapnp` module.
    2. `python3-zmq` is a package name in some Linux distros, rather than a
    Unix-wide convention.
    3. Installing `pyzmq` from PyPI works in general, not only on macOS.
    
    Resolve these issues by consolidating and fixing the documentation.
    e25d9c8add
  28. doc: Document `lsof` test suite dependency c14f888996
  29. hebasto force-pushed on Jul 6, 2026
  30. hebasto marked this as ready for review on Jul 6, 2026
  31. hebasto commented at 4:10 PM on July 6, 2026: member

    Thanks @maflcko for the review.

    Your recent feedback has been addressed.

  32. maflcko commented at 6:17 AM on July 7, 2026: member

    Thx. Still curious about the pip error (https://github.com/bitcoin/bitcoin/pull/35395/changes/e25d9c8addd5ff489a7dac8b767e7901a5359f49#r3389204933), but this seems pre-existing and orthogonal.

    review ACK c14f888996d45bc60af4a9e7023d836dff66bcb9 🏣

    <details><summary>Show signature</summary>

    Signature:

    untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
    RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
    trusted comment: review ACK c14f888996d45bc60af4a9e7023d836dff66bcb9 🏣
    TcQoY0WUul655XhC3MTHu6HevFIlTp+ndnyWgNaK6Mkrv6d/E+roJXDdFPCji6aVMYBoKpRYWQXTeEumDrVYCA==
    

    </details>

  33. in test/README.md:98 in c14f888996
      97 | +
      98 | +##### `lsof`
      99 | +
     100 | +Required for some network tests.
     101 | +
     102 | +The availability of the `lsof` command depends on your operating system.
    


    fanquake commented at 11:02 AM on July 8, 2026:

    What's the point of this sentence?


    hebasto commented at 11:05 AM on July 8, 2026:

    It's not available on OpenBSD.

  34. in doc/build-unix.md:52 in c14f888996
      45 | @@ -46,10 +46,10 @@ for additional features in later columns are optional.
      46 |  
      47 |  | Package manager         | Required build dependencies | SQLite (wallet) | Cap'n Proto (IPC) | ZMQ <sup><a href="#note1">[1]</a></sup> | USDT | Qt and libqrencode (GUI) |
      48 |  | ----------------------- | --------------------------- | --------------- | ----------------- | --- | ---- | ------------------------ |
      49 | -| Debian / Ubuntu (`apt`) | `build-essential cmake python3 libboost-dev` | `libsqlite3-dev` | `libcapnp-dev capnproto` | `libzmq3-dev pkgconf` | `systemtap-sdt-dev` | `qt6-base-dev qt6-tools-dev qt6-l10n-tools qt6-tools-dev-tools libgl-dev qt6-wayland libqrencode-dev` |
      50 | -| Fedora (`dnf`)          | `gcc-c++ cmake make python3 boost-devel` | `sqlite-devel` | `capnproto capnproto-devel` | `zeromq-devel pkgconf` | `systemtap-sdt-devel` | `qt6-qtbase-devel qt6-qttools-devel qt6-qtwayland qrencode-devel` |
      51 | -| Alpine (`apk`)          | `build-base cmake linux-headers python3 boost-dev` | `sqlite-dev` | `capnproto capnproto-dev` | `zeromq-dev` | Not supported | `qt6-qtbase-dev qt6-qttools-dev libqrencode-dev` |
      52 | -| Arch (`pacman`)         | `gcc make cmake python boost` | `sqlite` | `capnproto` | `zeromq` | `systemtap` | `qt6-base qt6-tools qt6-wayland qrencode` |
    


    fanquake commented at 11:06 AM on July 8, 2026:

    Now users building from source, who copy-paste the required deps from here, will get spurious warnings about a missing Python. That seems a bit worse than no warnings in the average case?


    hebasto commented at 11:15 AM on July 8, 2026:

    Fair point.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-07-09 06:47 UTC