Fixes #17506
gen-manapages.py should check enabled build options when generating docs
Fixes #17506
gen-manapages.py should check enabled build options when generating docs
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/29457.
See the guideline for information on the review process. A summary of reviews will appear here.
Reviewers, this pull request conflicts with the following ones:
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.
85+ config.read(conffile)
86+
87+ docs_to_exlude = []
88+ if (binary == 'bitcoind' or binary == 'bitcoin-qt') and not config['components'].getboolean('HAVE_SYSTEM'):
89+ docs_to_exlude += ['shutdownnotify', 'alertnotify', 'startupnotify', 'blocknotify']
90+ return parse_and_remove_subsections_from_doc(document, docs_to_exlude)
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the documentation.
Possibly this is 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.
Leave a comment here, if you need help tracking down a confusing failure.
76+
77+ if binary == 'bitcoin-wallet' and not config['components'].getboolean('ENABLE_WALLET'):
78+ print(error_message.format(component="Wallet functionality", file=file))
79+ sys.exit(1)
80+
81+ if (binary == 'bitcoind' or binary == 'bitcoin-qt') and not config['components'].getboolean('USE_UPNP'):
63+conffile = os.path.join(builddir, 'test/config.ini')
64+config.read(conffile)
65+
66+error_message = "Aborting generating manpages…\nError: {component} support is not enabled.\nPlease enable it and try again."
67+
68+if not config['components'].getboolean('HAVE_SYSTEM'):
This seems arbitrary and prone to breakage, giving the hardcoding of specific components.
I don’t think there is a better alternative, is there?
changes here can wait until after CMake, as this script will likely need to be (partially) rewritten after that change in any case.
Can you explain this? config ini should be unrelated to the build system and shouldn’t be affected by it.
Thanks for working on this issue, however this needs update after the cmake change.. This is the new contents of test/config.ini
:
0[components]
1# Which components are enabled. These are commented out by `configure` if they were disabled when running config.
2ENABLE_WALLET=true
3USE_SQLITE=true
4#USE_BDB=true
5ENABLE_CLI=true
6ENABLE_BITCOIN_UTIL=true
7ENABLE_WALLET_TOOL=true
8ENABLE_BITCOIND=true
9#ENABLE_FUZZ_BINARY=true
10#ENABLE_ZMQ=true
11ENABLE_EXTERNAL_SIGNER=true
12#ENABLE_USDT_TRACEPOINTS=true
i’m not sure there is a way around hardcoding component names, as they have different effects on options we can’t automatically detect here, but we may want to be more thorough: explicitly include lists of components that must be enabled, and components that we don’t care about. If any unknown components appear, also error out so that can be resolved first.
69+ 'ENABLE_CLI': 'CLI',
70+ 'ENABLE_BITCOIN_UTIL': 'Bitcoin utility',
71+ 'ENABLE_WALLET_TOOL': 'Wallet tool',
72+ 'ENABLE_BITCOIND': 'Bitcoind',
73+ 'ENABLE_EXTERNAL_SIGNER': 'External Signer',
74+}
HAVE_SYSTEM
?
76+enabled_components = {
77+ 'USE_BDB': 'Berkeley DB',
78+ 'ENABLE_FUZZ_BINARY': 'Fuzz testing binary',
79+ 'ENABLE_ZMQ': 'ZeroMQ support',
80+ 'ENABLE_USDT_TRACEPOINTS': 'USDT tracepoints',
81+}
Not sure about silently ignoring those. The goal of the script is to generate the manpages of the releases, and fail if it can’t.
Allowing third parties to generate their own manpages can be implemented behind an option, or not at all.
enabled components
are missing?
19+'build/src/bitcoind',
20+'build/src/bitcoin-cli',
21+'build/src/bitcoin-tx',
22+'build/src/bitcoin-wallet',
23+'build/src/bitcoin-util',
24+'build/src/qt/bitcoin-qt',
BUILDDIR
. Please see the conflicting pull request on how to correctly do it.
This just fails on the release binaries. Please make sure to test the code yourself before asking for review. If you run into issues, you can ask questions.
0BUILDDIR=bld ./contrib/devtools/gen-manpages.py
1Aborting generating manpages...
2Error: 'HAVE_SYSTEM' (System component) support is not enabled.
3Please enable it and try again.
You’ll probably have to use bld/src/bitcoin-build-config.h
instead of the test ini. It seems odd anyway to tie the test config to this.
🐙 This pull request conflicts with the target branch and needs rebase.