#35167 Convert check-deps.sh to python

full analysis

https://github.com/bitcoin/bitcoin/pull/35167 · ajtowns · +296/-219 in 5 files, 4 commits · labels: Needs rebase

Goal

  • Automate library dependency boundary enforcement directly from documentation diagrams
  • Eliminate manual dependency tracking and fix macOS symbol parsing false passes

Replaces contrib/devtools/check-deps.sh with a Python implementation that reads library dependencies directly from doc/design/libraries.md Mermaid diagrams. The new script resolves transitive dependencies automatically, demangles symbol names with c++filt, and handles nm output formatting differences on macOS. It also moves init/common.cpp from libbitcoin_common to libbitcoin_node in CMakeLists.txt to eliminate a suppression.

Problem: The existing shell script required manual tracking of transitive library dependencies, suffered from symbol parsing bugs on macOS that produced false positives or silent passes, and had to keep a separate dependency list in sync with the documentation.

Category: Tools and scripts (#9 of 22)

P3 · cleanup

  • P3 because it simplifies internal tool maintenance without affecting node operators
  • Resolves macOS symbol demangling bugs to make local boundary checks reliable

Converting check-deps to Python simplifies tool maintenance and fixes macOS symbol parsing. While helpful for developer workflows and library boundary enforcement, it is an internal developer tool rather than operator-facing software.

Membership: Rewrites contrib/devtools/check-deps.py, an internal development tool used to check library boundaries.

Factors: security/stability 0, bug 1, performance 0, user value 0, leverage 1

Category: Build and CI (#32 of 55)

P3 · test coverage

  • P3 because it prevents false passes in CI library dependency checks on macOS
  • Does not fix build breakages, release integrity, or core CI reliability

The PR improves CI check correctness for circular or unwanted library dependencies by fixing false passes on macOS. However, it does not fix release integrity, platform build breakage, or general CI reliability.

Membership: Changes CI dependency checking invocation in ci/test/03_test_script.sh and library target definitions in src/CMakeLists.txt.

Factors: security/stability 0, bug 1, performance 0, user value 0, leverage 1

Reviewability: Stale: Needs rebase

  • Needs rebase due to merge conflicts with master while author has been inactive

The PR has merge conflicts with master and the author has been silent for over 140 days.

Author status: silent since 2026-04-29

Open concerns:

  • ryanofsky noted that moving init/common.cpp to libbitcoin_node breaks logging in auxiliary binaries like bitcoin-wallet and bitcoin-mine (#30437, #10102).
  • ryanofsky objected to adding explicit consensus-to-util and GUI-to-node/wallet edges in libraries.md, preferring suppressions.
  • ryanofsky pointed out that check-deps.py silently ignores unbuildable targets rather than failing in CI.

Resolved concerns:

  • janb84 identified macOS nm parsing differences where defined symbols were not matched; ajtowns updated regex parsing to handle them.

Agreement: Mild

  • Broad concept support for migrating dependency checks to Python (sedited, ryanofsky)
  • Verified symbol parsing fixes on macOS (janb84)
  • Nonblocking objection: moving init code breaks logging in auxiliary binaries (ryanofsky)
  • Nonblocking objection: prefers suppressions over adding undesirable dependency edges (ryanofsky)

Mild: ryanofsky approved with nonblocking concerns on init/common.cpp relocation and design doc edges that remain unaddressed.

Reviewers broadly support migrating the script to Python and parsing the Mermaid diagram directly. However, ryanofsky raised nonblocking objections against moving init/common.cpp and introducing undesirable dependencies into libraries.md, offering an alternative branch that has not received an author response.

  • sedited concept ACKed and noted the cleaner dependency diagram.
  • janb84 confirmed the Python rewrite fixes false passes on macOS.
  • hebasto questioned whether libraries.md is an enforced reality versus a design goal.
  • ryanofsky gave code review approval but strongly suggested avoiding the init/common.cpp move and keeping consensus separate from util.

Review verdicts (DrahtBot): 1

Files

489 lines under test/bench/ci.

  • contrib/devtools/check-deps.py +290/-0
  • contrib/devtools/check-deps.sh +0/-197
  • doc/design/libraries.md +4/-20
  • ci/test/03_test_script.sh +1/-1
  • src/CMakeLists.txt +1/-1

Card

Converts check-deps.sh to a Python script that parses the Mermaid dependency graph directly from doc/design/libraries.md. This automates transitive dependency resolution, demangles C++ symbols, and resolves macOS-specific false positives in nm output. Reviewers broadly favor the Python rewrite, but ryanofsky identified concerns about moving init/common.cpp to libbitcoin_node and adding unnecessary dependency edges to the design document. The PR currently needs a rebase and the author has been silent for several months.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T15:51, confidence high, input hash 3ce407073cd0af62