-
Notifications
You must be signed in to change notification settings - Fork 36.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: Fix gen-manpages, rewrite in Python #24263
Conversation
79da7e0
to
8b185a8
Compare
I can't reproduce it locally with mypy 0.761 and python 3.8.10. I don't think I'm passing anything weird to subprocess.run or path.join. Edit: also tried with mypy 0.931. No dice. |
Rewrite the manual page generation script in Python. This: - Solves '-' stripping issue (fixes bitcoin#22681) - Makes that copyright footer is generated again
8b185a8
to
87f5406
Compare
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
Concept ACK |
Something that is weird, but outside scope of this particular PR to fix. is that the copyright message is emitted inconsistently between binaries:
I don't have a strong opinion on whether it should be shown with |
@dongcarl Can I get a concept ACK here at least? It should exactly do what you propose in #22681 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review ACK 87f5406
Had to remind myself of the situation but everything looks good, just a few nits that are 100% ignore-able.
print(f'{abspath} not found or not an executable', file=sys.stderr) | ||
sys.exit(1) | ||
# take first line (which must contain version) | ||
verstr = r.stdout.split('\n')[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit
verstr = r.stdout.split('\n')[0] | |
verstr = r.stdout.splitlines()[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in #24409.
for relpath in BINARIES: | ||
abspath = os.path.join(builddir, relpath) | ||
try: | ||
r = subprocess.run([abspath, '--version'], stdout=subprocess.PIPE, universal_newlines=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to do check=True
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script will fail because bitcoin-wallet returns non-0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I initially did check
but as @fanquake says. I'm not sure why bitcoin-wallet does that actually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addresses in #24428.
Concept ACK |
1 similar comment
Concept ACK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 87f5406 - tested generating and opening the man pages locally, but didn't run through the release process. Will propose some changes to address consolidating the help / version output.
Co-authored-by: Carl Dong <contact@carldong.me>
Co-authored-by: Carl Dong <contact@carldong.me>
Co-authored-by: Carl Dong <contact@carldong.me>
…h `-version` 5a89bed contrib: address gen-manpages feedback from #24263 (fanquake) 2618fb8 Output license info when binaries are passed -version (fanquake) 4c3e3c5 refactor: shift CopyrightHolders() and LicenseInfo() to clientversion.cpp (fanquake) Pull request description: Addresses a review comment from #24263, and addresses the [comment](bitcoin/bitcoin#24263 (comment)) where it was pointed out that we are inconsistent with emitting our copyright. After this change, the copyright is always emitted with `-version`, rather than `-help`, i.e: ```bash bitcoind -version Bitcoin Core version v22.99.0-fc1f355913f6-dirty Copyright (C) 2009-2022 The Bitcoin Core developers Please contribute if you find Bitcoin Core useful. Visit <https://bitcoincore.org/> for further information about the software. The source code is available from <https://github.com/bitcoin/bitcoin>. This is experimental software. Distributed under the MIT software license, see the accompanying file COPYING or <https://opensource.org/licenses/MIT> ``` The info is also added to binaries other than `bitcoind`/`bitcoin-qt`. This change also prevents duplicate copyright info appearing in the `bitcoind` man page. ACKs for top commit: laanwj: Tested ACK 5a89bed Tree-SHA512: 0ac2a1adf9e9de0c3206f35837008e3f93eaf15b193736203d71609273f0887cca20b8a90972cb9f941ebd62b330d61a0cbb5fb1b7a7f2dbc715ed8a0c1569d9
Adjust the exit codes / functionality of bitcoin-wallet such that it's not returning a non-zero exit code if there isn't a problem. This is a followup from bitcoin#24263, and should allow us to add and additional check=True to our gen-manpages.py script.
Now that bitcoin-wallet no-longer returns a non-zero exit code when it shouldn't do, we can add check=True to our subprocess call. Follows up to the comments in bitcoin#24263 (comment).
Adjust the exit codes / functionality of bitcoin-wallet such that it's not returning a non-zero exit code if there isn't a problem. This is a followup from bitcoin#24263, and should allow us to add and additional check=True to our gen-manpages.py script.
Now that bitcoin-wallet no-longer returns a non-zero exit code when it shouldn't do, we can add check=True to our subprocess call. Follows up to the comments in bitcoin#24263 (comment).
fa2b8ae util: improve bitcoin-wallet exit codes (MacroFake) Pull request description: Refactors `bitcoin-wallet` so that it doesn't return a non-zero exit code by default, and makes the option handling more inline with the other binaries. i.e outputting `Error: too few parameters` if you don't pass any options. Fixing this means we can check the process output in `gen-manpages.py`; which addresses the remaining [review comment](bitcoin/bitcoin#24263 (comment)) from #24263. Top commit has no ACKs. Tree-SHA512: 80bd8098faefb4401ca1e4d49937ef6c960cf60ce0e7fb9dc38904fbc2fd92e319ec04570381da84943b7477845bf6be00e977f4c0451b247a6698662ce8f1bf
Rewrite the manual page generation script in Python.
This:
Also change the release process to swap gen-manpages and update RC steps, so that the pages will have the correct rc and/or final version.