Skip to content

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

Open
jeanpablojp wants to merge 4 commits into
bitcoin:masterfrom
jeanpablojp:check-deps-python
Open

jeanpablojp wants to merge 4 commits into
bitcoin:masterfrom
jeanpablojp:check-deps-python

Conversation

@jeanpablojp

Copy link
Copy Markdown
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 Convert check-deps.sh to python #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 ipc: add bitcoin-mine test program #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 (#35167 (comment)), 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.

ajtowns and others added 4 commits November 26, 2026 20:03
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 <[email protected]>
Allows InitError and InitWarning to be used by other executables beside
bitcoind and bitcoin-node.

Co-authored-by: jeanpablojp <[email protected]>
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 <[email protected]>
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.
@DrahtBot

DrahtBot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

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

External sites

Reviews

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #37094 (validation: validate assumeutxo snapshots with a single chainstate by fjahr)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants