Skip to content

Conversation

BrandonOdiwuor
Copy link
Contributor

@BrandonOdiwuor BrandonOdiwuor commented Feb 20, 2024

Fixes #17506

gen-manapages.py should check enabled build options when generating docs

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 20, 2024

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

Reviews

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #31161 (cmake: Set top-level target output locations by hebasto)
  • #30986 (contrib: skip missing binaries in gen-manpages by andremralves)
  • #30437 (multiprocess: add bitcoin-mine test program by ryanofsky)

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.

@DrahtBot DrahtBot added the Docs label Feb 20, 2024
docs_to_exlude = []
if (binary == 'bitcoind' or binary == 'bitcoin-qt') and not config['components'].getboolean('HAVE_SYSTEM'):
docs_to_exlude += ['shutdownnotify', 'alertnotify', 'startupnotify', 'blocknotify']
return parse_and_remove_subsections_from_doc(document, docs_to_exlude)
Copy link
Member

Choose a reason for hiding this comment

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

My understanding would be that the check returns an error to recommend to build with the component, when a component is missing, no?

@DrahtBot
Copy link
Contributor

🚧 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.

Debug: https://github.com/bitcoin/bitcoin/runs/21766942690

@luke-jr
Copy link
Member

luke-jr commented Feb 20, 2024

Probably should be a way to override this, in case someone actually wants a custom-fit manpage?

@BrandonOdiwuor BrandonOdiwuor force-pushed the gen-manpages-build-options branch from 4c3062a to 1e1ab90 Compare February 21, 2024 11:16
@BrandonOdiwuor BrandonOdiwuor force-pushed the gen-manpages-build-options branch 5 times, most recently from efb45f0 to 428b921 Compare February 21, 2024 12:02
@BrandonOdiwuor BrandonOdiwuor marked this pull request as ready for review February 21, 2024 12:04
@BrandonOdiwuor
Copy link
Contributor Author

@luke-jr you mean away to override the changes or the help2man generation?


error_message = "Aborting generating manpages…\nError: {component} support is not enabled.\nPlease enable it and try again."

if not config['components'].getboolean('HAVE_SYSTEM'):
Copy link
Member

Choose a reason for hiding this comment

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

This seems arbitrary and prone to breakage, giving the hardcoding of specific components. It also doesn't cover all of the relevant components in any case, i.e at least decl_fork and natpmp (which both effect manpage output) are missing any sort of check.

Copy link
Member

Choose a reason for hiding this comment

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

This seems arbitrary and prone to breakage, giving the hardcoding of specific components.

I don't think there is a better alternative, is there?

Copy link
Member

Choose a reason for hiding this comment

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

Not sure. Although I think any changes here can wait until after CMake, as this script will likely need to be (partially) rewritten after that change in any case.

Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Member

Choose a reason for hiding this comment

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

This is hardcoding component names / variables, and they are likely to change during the switchover.

@achow101
Copy link
Member

Are you still working on this?

@laanwj
Copy link
Member

laanwj commented Oct 15, 2024

Thanks for working on this issue, however this needs update after the cmake change.. This is the new contents of test/config.ini:

[components]
# Which components are enabled. These are commented out by `configure` if they were disabled when running config.
ENABLE_WALLET=true
USE_SQLITE=true
#USE_BDB=true
ENABLE_CLI=true
ENABLE_BITCOIN_UTIL=true
ENABLE_WALLET_TOOL=true
ENABLE_BITCOIND=true
#ENABLE_FUZZ_BINARY=true
#ENABLE_ZMQ=true
ENABLE_EXTERNAL_SIGNER=true
#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.

@BrandonOdiwuor
Copy link
Contributor Author

@laanwj I updated the PR to include the suggestions

'ENABLE_FUZZ_BINARY': 'Fuzz testing binary',
'ENABLE_ZMQ': 'ZeroMQ support',
'ENABLE_USDT_TRACEPOINTS': 'USDT tracepoints',
}
Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@maflcko, are you suggesting the default behaviour should be to also fail if the enabled components are missing?

@BrandonOdiwuor BrandonOdiwuor force-pushed the gen-manpages-build-options branch from 7651dc3 to 59cee70 Compare November 12, 2024 07:47
Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

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.

BUILDDIR=bld ./contrib/devtools/gen-manpages.py 
Aborting generating manpages...
Error: 'HAVE_SYSTEM' (System component) support is not enabled.
Please 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.

'build/src/bitcoin-tx',
'build/src/bitcoin-wallet',
'build/src/bitcoin-util',
'build/src/qt/bitcoin-qt',
Copy link
Member

Choose a reason for hiding this comment

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

You can't just change the relative path to include an unrelated prefix. This breaks when using BUILDDIR. Please see the conflicting pull request on how to correctly do it.

@DrahtBot
Copy link
Contributor

🐙 This pull request conflicts with the target branch and needs rebase.

@DrahtBot
Copy link
Contributor

⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?

  • Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
  • Is it no longer relevant? ➡️ Please close.
  • Did the author lose interest or time to work on this? ➡️ Please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.

@fanquake fanquake marked this pull request as draft February 20, 2025 17:26
@fanquake
Copy link
Member

Drafted for now. @BrandonOdiwuor are you still working on this?

@DrahtBot
Copy link
Contributor

⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?

  • Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
  • Is it no longer relevant? ➡️ Please close.
  • Did the author lose interest or time to work on this? ➡️ Please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.

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.

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