Skip to content

Conversation

BrandonOdiwuor
Copy link
Contributor

Fixes #17506. Second attempt after PR: #29457 (closed)

This PR fixes the gen-manpages.py script to check the build options and exit when there are missing components. It also adds an option to --skip-build-options-check

The PR also addresses the issues raised on PR: #29457:
- #29457 (comment) - the default behaviors is fail
- #29457 (comment) - by adding --skip-build-options-check
- #29457 (review) - The PR uses builddir/src/bitcoin-build-config.h to check for HAVE_SYSTEM option and builddir/test/config.ini for the rest as they are only available there respectively

@DrahtBot DrahtBot changed the title doc: gen-manpages.py should check build options doc: gen-manpages.py should check build options Jul 29, 2025
@DrahtBot DrahtBot added the Docs label Jul 29, 2025
@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 29, 2025

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/33085.

Reviews

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

LLM Linter (✨ experimental)

Possible typos and grammar issues:

  • "Aborting generating manpages..." -> "Aborting generation of manpages..." [corrects ungrammatical gerund usage]

drahtbot_id_4_m

@BrandonOdiwuor BrandonOdiwuor force-pushed the genmanpages-build-options branch from f860622 to 70fe2a8 Compare July 29, 2025 08:03
@DrahtBot
Copy link
Contributor

🚧 At least one of the CI tasks failed.
Task lint: https://github.com/bitcoin/bitcoin/runs/46923751472
LLM reason (✨ experimental): Python linter errors due to syntax issues in lint-python-utf8-encoding.py and lint-python.py caused the CI failure.

Hints

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.

@BrandonOdiwuor BrandonOdiwuor force-pushed the genmanpages-build-options branch from 70fe2a8 to db2c589 Compare July 29, 2025 08:28
@janb84
Copy link
Contributor

janb84 commented Aug 4, 2025

Personally I like the intent to structure the code more (the introduction of functions).

Paused reviewing this PR:

  • I paused reviewing this PR because the way the code is currently structured is unfinished to me. The introduction of a function for the new functionality is great but the rest of the code needs to be restructured to better incorporate the use of functions imho (e.g. use a main function).
  • Have not looked at the intent of the code yet.

(P.S. This is not meant to be harsh but to explain why I paused reviewing the code instead of silently ignoring the PR. This is an effort to either get the PR merged or closed, not leaving PR's in limbo.)

@BrandonOdiwuor
Copy link
Contributor Author

@janb84 thanks for having a look

I think introducing a main function would require a huge refactor to the file for such small check.

I would also love to hear some advantages of adding a main function here

disabled_options = check_build_options()
if disabled_options and not args.skip_build_options_check:
error_msg = (
"Aborting generating manpages...\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Aborting generating manpages..." -> "Aborting generation of manpages..." [corrects ungrammatical gerund usage]

@@ -27,6 +29,11 @@
default=False,
help="skip generation for binaries that are not found in the build path",
)
parser.add_argument(
'--skip-build-options-check',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in theory, --skip-missing-binaries can now be removed and the list of binaries derived from the build options.

Comment on lines +63 to +64
'ENABLE_BITCOIN_CHAINSTATE': 'Build experimental bitcoin-chainstate executable',
'ENABLE_FUZZ_BINARY': 'Build fuzz binary',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the point of listing those, which are unused?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gen-manpages output depends on build options, so needs to check them
4 participants