Check required interfaces before generating manpages #33828

pull 151henry151 wants to merge 1 commits into bitcoin:master from 151henry151:gen-manpages-checks changing 1 files +99 −0
  1. 151henry151 commented at 8:50 pm on November 8, 2025: contributor

    Guard manpage generation by reading bitcoin-build-config.h and exiting if HAVE_SYSTEM, ENABLE_WALLET, or ENABLE_ZMQ are off, and provide a short hint so contributors rebuild with the right flags instead of committing incomplete manpages.

    Fixes #17506

    Override by using –skip-build-options-check if you really need a custom-fit manpage (see bitcoin/bitcoin#29457 (comment)).

  2. DrahtBot commented at 8:50 pm on November 8, 2025: contributor

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

    Code Coverage & Benchmarks

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

    Reviews

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

    Conflicts

    No conflicts as of last run.

  3. 151henry151 force-pushed on Nov 8, 2025
  4. 151henry151 force-pushed on Nov 8, 2025
  5. fanquake commented at 10:08 am on November 10, 2025: member
    This duplicates #33085. If the author doesn’t follow up there shortly, we could reopen here.
  6. fanquake closed this on Nov 10, 2025

  7. 151henry151 commented at 0:44 am on November 11, 2025: contributor

    Thanks for taking a look, fanquake.

    I noticed #33085 had gone quiet for a little over three weeks with the review concerns still open, so I put this together.

    In #33085 the script pulls component flags from test/config.ini (adding checks for CLI, chainstate, fuzz, USDT tracepoints, etc.), but that file only exists when tests are configured and most of those toggles don’t affect the manpages. This branch reads CMakeCache.txt, the authoritative record of the configuration, and only verifies the interfaces that actually change the generated help text.

    #33085 adds a new --skip-build-options-check flag, whereas this keeps using the existing SKIP_BUILD_OPTIONS_CHECK environment override so the command-line surface stays the same. The error messaging here points directly at the missing CMake options and explains how to bypass the guard, which lines up with the release-process docs, and the helper functions make the new logic reusable instead of nesting more ad-hoc parsing in the main flow.

    I appreciate the work Brandon already put in to #33085 and I looked his code over thoroughly before tackling this, but I thought this solution was more elegant and would be preferred. Wanting to follow proper etiquette, perhaps I should have commented my suggestions on his PR instead of opening my own?

  8. 151henry151 commented at 9:56 pm on November 29, 2025: contributor

    This duplicates #33085. If the author doesn’t follow up there shortly, we could reopen here.

    It’s been a few weeks, would it be appropriate to reopen here? I did try to reach out to @BrandonOdiwuor on the comments of #33085 and haven’t heard back from him yet.

  9. 151henry151 commented at 5:34 am on January 11, 2026: contributor
    Hi @fanquake, checking in on the status of #33085. If it’s no longer moving forward, would it be possible to reopen this PR? Happy to adjust anything if needed. Thanks!
  10. fanquake commented at 12:48 pm on January 11, 2026: member
    I’ve closed #33085 given the lack of followup.
  11. fanquake reopened this on Jan 11, 2026

  12. in contrib/devtools/gen-manpages.py:14 in a212ec69f5
    11 import argparse
    12 
    13+
    14+def _read_cmake_cache(cache_path):
    15+    options = {}
    16+    with open(cache_path, encoding="utf-8") as cache:
    


    maflcko commented at 8:18 am on January 12, 2026:
    0    with open(cache_path) as cache:
    

    They can now be dropped, after https://github.com/bitcoin/bitcoin/pull/33702


    151henry151 commented at 0:30 am on January 13, 2026:
    Fixed with 2a226ae
  13. 151henry151 force-pushed on Jan 13, 2026
  14. 151henry151 requested review from maflcko on Jan 15, 2026
  15. in contrib/devtools/gen-manpages.py:81 in 2a226ae02c
    76+cmake_cache_path = os.path.join(builddir, 'CMakeCache.txt')
    77+if not os.path.exists(cmake_cache_path):
    78+    print(f'ERROR: {cmake_cache_path} not found. Run this script against a CMake build directory.', file=sys.stderr)
    79+    sys.exit(1)
    80+
    81+if _env_truthy("SKIP_BUILD_OPTIONS_CHECK"):
    


    maflcko commented at 6:07 pm on January 19, 2026:
    not sure about having one option over argparse, and another over env. Would be good to have a single way, and possibly even a single option --ignore-warnings. Or just remove this option for now.
  16. in contrib/devtools/gen-manpages.py:49 in 2a226ae02c outdated
    25+            options[key] = value
    26+    return options
    27+
    28+
    29+def _cmake_truthy(value):
    30+    return value.upper() in {"ON", "TRUE", "YES"} or value == "1"
    


    maflcko commented at 6:11 pm on January 19, 2026:
    instead of parsing the cmake cache file with the cmake syntax, i’d presume it is easier to parse the C++ header config file, which follows a strict format: Either the line #define HAVE_SYSTEM 1 exists, or not.
  17. 151henry151 force-pushed on Jan 20, 2026
  18. 151henry151 commented at 5:44 pm on January 20, 2026: contributor

    @maflcko you said –ignore-warnings, but I used –skip-build-options-check since we’re skipping checks, not ignoring warnings. Should I change it to –ignore-warnings?

    I switched HAVE_SYSTEM and ENABLE_WALLET to read from bitcoin-build-config.h. WITH_ZMQ isn’t in the header, so I’m still parsing CMakeCache.txt for it. Is that expected?

  19. maflcko commented at 5:50 pm on January 20, 2026: member

    WITH_ZMQ isn’t in the header, so I’m still parsing CMakeCache.txt for it. Is that expected?

    It is called ENABLE_ZMQ. You can read the header, to see the contents of it.

  20. 151henry151 force-pushed on Jan 20, 2026
  21. DrahtBot added the label CI failed on Jan 20, 2026
  22. DrahtBot commented at 5:51 pm on January 20, 2026: contributor

    🚧 At least one of the CI tasks failed. Task lint: https://github.com/bitcoin/bitcoin/actions/runs/21181549467/job/60924930617 LLM reason (✨ experimental): Python linting failed (ruff) due to trailing/blank-line whitespace issues and other fixable ruff errors in the Python code.

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  23. 151henry151 force-pushed on Jan 20, 2026
  24. 151henry151 commented at 5:58 pm on January 20, 2026: contributor
    Thanks for the review and feedback @maflcko , I think I’ve implemented your suggested changes correctly.
  25. maflcko commented at 6:18 pm on January 20, 2026: member

    WITH_ZMQ isn’t in the header, so I’m still parsing CMakeCache.txt for it. Is that expected?

    It is called ENABLE_ZMQ. You can read the header, to see the contents of it.

    Sorry, i was wrong. This is actually a compile definition. So I guess either the cmake parsing is required, or it has to be made a define in the build header.

  26. 151henry151 commented at 6:31 pm on January 20, 2026: contributor

    … either the cmake parsing is required, or it has to be made a define in the build header.

    So either we need to keep parsing CMakeCache.txt for WITH_ZMQ, or ENABLE_ZMQ needs to be added to the build header. Do you have a preference between these two approaches? I would lean towards adding it to the build header, since it’s simpler and more direct than parsing the CMake cache format. I’ve implemented that in f9ad5f0

  27. 151henry151 force-pushed on Jan 20, 2026
  28. maflcko commented at 7:03 pm on January 20, 2026: member
    i am not a build system expert, but i don’t think compile definitions and build header defines should be mixed for the same symbol.
  29. maflcko commented at 7:05 pm on January 20, 2026: member

    Also, this doesn’t compile (please test locally before pushing)

    Edit: As for a preference, I’d say it is probably easiest in this context to just read the cmake cache file.

  30. 151henry151 force-pushed on Jan 20, 2026
  31. Check required interfaces before generating manpages 442346a52e
  32. 151henry151 force-pushed on Jan 20, 2026
  33. 151henry151 commented at 9:34 pm on January 20, 2026: contributor

    I believe the current commit 442346a follows your suggestions, using header checks for HAVE_SYSTEM and ENABLE_WALLET, and still checking CMakeCache.txt for WITH_ZMQ.

    Frankly, I prefer the code of 2a226ae which intentionally used the existing SKIP_BUILD_OPTIONS_CHECK env var to keep the CLI unchanged, and checked all three interfaces against CMakeCache.txt as the single source of truth. It just seems more elegant to me.

    Can you clarify the suggestion to use a single argument like –ignore-warnings? I don’t see an existing –ignore-warnings option in the script. I added the argument –skip-build-options-check, but wasn’t sure if maybe the –ignore-warnings option exists elsewhere and should also skip build options checks? Thanks again for all the feedback.

  34. DrahtBot removed the label CI failed on Jan 20, 2026

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-01-21 03:13 UTC

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