contrib: Convert check-deps.sh to Python #37023

pull jeanpablojp wants to merge 4 commits into bitcoin:master from jeanpablojp:check-deps-python changing 5 files +323 −215
  1. jeanpablojp commented at 10:55 PM on November 30, 2026: contributor

    This picks up #35167.

    check-deps.py reads the allowed library dependencies from the mermaid graph in doc/design/libraries.md and follows them transitively, so the graph can drop its transitive edges and the script no longer keeps its own copy of the list. Compared to check-deps.sh, it also checks data symbols, and it runs on macOS, where the shell script needs bash 4.

    Changes compared to #35167, most of them from ryanofsky's review and the branch he shared there.

    • The edges #35167 added to the graph, from consensus to util and from qt to cli, node and wallet, are gone.
    • init/common.cpp stays in common, and interface_ui moves there from node. It's the same move as in #30437.
    • Build output is shown, and a target that fails to build or a library archive that is missing is an error instead of a warning.
    • The script fails when it reads no symbols from a library or can't parse a line of the graph, instead of reporting success.
    • On macOS, the script reads the symbols nm reports as type S and drops the extra leading underscore of Mach-O names before matching suppressions.

    On whether libraries.md can be the source of truth (https://github.com/bitcoin/bitcoin/pull/35167#issuecomment-4337200918), check-deps.sh already took its list from that file. Where the build doesn't match the graph yet, check-deps.py skips the library or suppresses the symbols, and says why in a comment.

  2. contrib: Convert check-deps.sh to Python
    Read the allowed library dependencies from the mermaid graph in
    doc/design/libraries.md instead of a hand-copied list, and allow the
    dependencies that follow from the graph transitively.
    
    Compared to the shell script, it also checks data symbols and not only
    functions, ignores symbols that the consuming library or an allowed one
    also defines, and runs on macOS, where the shell script needs bash 4.
    
    bitcoin_kernel is skipped because it does not exist as a library yet,
    and bitcoinqt because the shell script never checked it. The script
    fails, rather than reporting success, when a target does not build or
    an archive is missing.
    
    Co-authored-by: jeanpablojp <me@jeanpablo.jp>
    872209b6e2
  3. interface_ui: move from node to common library
    Allows InitError and InitWarning to be used by other executables beside
    bitcoind and bitcoin-node.
    
    Co-authored-by: jeanpablojp <me@jeanpablo.jp>
    4c33466eea
  4. doc: Drop redundant and stale library deps
    check-deps.py follows the dependency graph transitively, so remove
    edges that other edges already imply, and say so in the caption.
    
    Also remove libbitcoin_wallet_tool, which has not existed since the
    CMake migration (wallettool.cpp is built into bitcoin-wallet), and
    drop it from the libraries check-deps.py skips.
    
    Co-authored-by: jeanpablojp <me@jeanpablo.jp>
    e615e3988c
  5. contrib: Don't let check-deps pass silently
    check-deps.py reported success without checking anything when it read
    no symbols from a library, as happens when nm prints a format that
    NM_LINE_RE does not match. It also left a library out of the check
    when its graph line did not match the edge regex, for example an edge
    without the trailing semicolon, which mermaid accepts.
    
    Exit with an error in both cases.
    f86744cdd7
  6. DrahtBot added the label Scripts and tools on Nov 30, 2026
  7. DrahtBot commented at 10:55 PM on November 30, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->


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-12-01 02:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me