doc: update documentation and scripts related to build directories #30741

pull l0rinc wants to merge 2 commits into bitcoin:master from l0rinc:lorinc/build-documentation changing 10 files +74 −73
  1. l0rinc commented at 3:05 pm on August 28, 2024: contributor

    In the other readmes we’ve provided a default build directory instead, unified the developer-notes.md to specify it explicitly.

    In the next commit I’ve used this default to go over each reference to our binaries and changed their in-source references to the build directory. Some of these changes were in example outputs - I haven’t validated that the outputs are still the same. I haven’t modified the build folders in the devtools.

  2. DrahtBot commented at 3:05 pm on August 28, 2024: contributor

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

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK pablomartin4btc, maflcko, fanquake
    Concept ACK theStack, 0xB10C
    Stale ACK hebasto

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #29877 (tracing: explicitly cast block_connected duration to nanoseconds by 0xB10C)

    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.

  3. in doc/developer-notes.md:342 in 00c12c63e7 outdated
    337@@ -338,9 +338,10 @@ Recommendations:
    338 
    339 ### Generating Documentation
    340 
    341-The documentation can be generated with `cmake --build <build_dir> --target docs`.
    342-The resulting files are located in `<build_dir>/doc/doxygen/html`; open
    343-`index.html` in that directory to view the homepage.
    344+Assuming the build directory is named `build`,
    345+the documentation can be generated with `cmake --build build --target docs`.
    


    fanquake commented at 3:10 pm on August 28, 2024:
    Not sure that making this less generic is an improvement?

    l0rinc commented at 3:13 pm on August 28, 2024:

    Seems to me that was the way we’ve proceded before: https://github.com/bitcoin/bitcoin/blob/6ce50fd9d0ae6850d54bf883e7a7c1bcb6912c5c/src/test/README.md?plain=1#L19

    And since we need to update the build directories in the docs (at least that’s what I tried doing here), we need a sensible default.

    Do you have a better suggestion?


    maflcko commented at 3:28 pm on August 28, 2024:
    Seems fine to leave this section as-is, because no update is required?

    l0rinc commented at 3:42 pm on August 28, 2024:
    @maflcko, can you please expand on that?

    maflcko commented at 6:14 am on August 29, 2024:
    I mean that “The resulting files are located in <build_dir>/doc/doxygen/html; open …” is correct, thus no update is required, and the section can be left as-is. This means that the hunk can be dropped from the diff, so that the diff becomes smaller.

    l0rinc commented at 6:46 am on August 29, 2024:

    thus no update is required

    But isn’t that how we’ve done it in other cases during the cmake change, i.e. assume a default build dir? Or you mean that the changes here from /src/ to /build/src/ are all invalid?


    maflcko commented at 7:07 am on August 29, 2024:
    Either is fine, probably doesn’t matter much either way.
  4. l0rinc force-pushed on Aug 28, 2024
  5. in doc/developer-notes.md:232 in 84de9e3af0 outdated
    228@@ -229,13 +229,13 @@ The output is denoised of errors from external dependencies.
    229 To run clang-tidy on all source files:
    230 
    231 ```sh
    232-( cd ./src/ && run-clang-tidy  -j $(nproc) )
    233+( cd ./build/src/ && run-clang-tidy  -j $(nproc) )
    


    fanquake commented at 3:13 pm on August 28, 2024:
    This isn’t correct. We want ./src/.

    l0rinc commented at 3:14 pm on August 28, 2024:
    Fixed, thanks!
  6. l0rinc force-pushed on Aug 28, 2024
  7. l0rinc renamed this:
    Update documentation generation example in developer-notes.md
    cmake: update documentation generation example in developer-notes.md
    on Aug 28, 2024
  8. DrahtBot added the label Build system on Aug 28, 2024
  9. l0rinc renamed this:
    cmake: update documentation generation example in developer-notes.md
    cmake: update documentation and scripts related to build directories
    on Aug 28, 2024
  10. l0rinc renamed this:
    cmake: update documentation and scripts related to build directories
    doc: update documentation and scripts related to build directories
    on Aug 28, 2024
  11. in contrib/devtools/gen-manpages.py:11 in d21f59d6d9 outdated
    12-'src/bitcoin-cli',
    13-'src/bitcoin-tx',
    14-'src/bitcoin-wallet',
    15-'src/bitcoin-util',
    16-'src/qt/bitcoin-qt',
    17+'build/src/bitcoind',
    


    fanquake commented at 3:25 pm on August 28, 2024:

    Wont this break the usage as described in the readme:

    0BUILDDIR=$PWD/build ./contrib/devtools/gen-manpages.py 
    1/root/ci_scratch/build/build/src/bitcoind not found or not an executable
    

    l0rinc commented at 3:41 pm on August 28, 2024:

    To use this tool with out-of-tree builds set BUILDDIR.

    Does this comment still apply? Should I change it to builddir = os.getenv('BUILDDIR', topdir) to default to the build dir instead of modifying the BINARIES paths?


    maflcko commented at 6:16 am on August 29, 2024:

    l0rinc commented at 6:44 am on August 29, 2024:
    Looks like I stepped into something here - reverted gen-manpages.py changes, thanks for the comments.
  12. l0rinc force-pushed on Aug 29, 2024
  13. in doc/developer-notes.md:475 in 3a4a1434ef outdated
    473 $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \
    474-      --show-leak-kinds=all src/test/test_bitcoin --log_level=test_suite
    475-$ valgrind -v --leak-check=full src/bitcoind -printtoconsole
    476+      --show-leak-kinds=all build/src/test/test_bitcoin --log_level=test_suite
    477+$ valgrind -v --leak-check=full build/src/bitcoind -printtoconsole
    478 $ ./test/functional/test_runner.py --valgrind
    


    TheCharlatan commented at 7:33 am on August 29, 2024:
    Should use the symlinked script in build here too.

    l0rinc commented at 10:11 am on August 29, 2024:
    Thanks, fixed!
  14. hebasto commented at 9:49 am on August 29, 2024: member
    Why is this a draft?
  15. l0rinc force-pushed on Aug 29, 2024
  16. l0rinc commented at 10:12 am on August 29, 2024: contributor

    Why is this a draft?

    master wasn’t stable yet, ready for review!

  17. l0rinc marked this as ready for review on Aug 29, 2024
  18. hebasto removed the label Build system on Aug 29, 2024
  19. hebasto added the label Docs on Aug 29, 2024
  20. hebasto approved
  21. hebasto commented at 11:24 am on August 29, 2024: member

    ACK cd993bfab6c06769e756ffc1d333cd9ffa705c1e, I have reviewed changes and they look OK.

    The failure in the “test each commit” CI job is unrelated.

  22. in contrib/devtools/test_utxo_snapshots.sh:67 in cd993bfab6 outdated
    63@@ -64,10 +64,10 @@ trap finish EXIT
    64 EARLY_IBD_FLAGS="-maxtipage=9223372036854775207 -minimumchainwork=0x00"
    65 
    66 server_rpc() {
    67-  ./src/bitcoin-cli -rpcport=$SERVER_RPC_PORT -datadir="$SERVER_DATADIR" "$@"
    68+  ./build/src/bitcoin-cli -rpcport=$SERVER_RPC_PORT -datadir="$SERVER_DATADIR" "$@"
    


    fanquake commented at 11:27 am on August 29, 2024:
    It’s not clear to me that hard-coding the build dir into all of these scripts is the right thing to do? Especially if people are likely to be using multiple different dirs, or want to compare output between builds etc? It seems like a better approach would be to default to build, but still let the user specify a dir, similar to how the manpage generation currently works.

    maflcko commented at 11:39 am on August 29, 2024:
    Maybe all changes to *.sh can be split up into another pull request. See also #29553

    l0rinc commented at 1:28 pm on August 29, 2024:
    Thanks, reverted the devtools related changes.

    pablomartin4btc commented at 7:30 pm on August 29, 2024:

    Especially if people are likely to be using multiple different dirs, or want to compare output between builds etc? It seems like a better approach would be to default to build, but still let the user specify a dir

    I agree with @fanquake, but until #29553 (which will remove this script entirely) gets merged (I’m testing it) and released, the script would fail (same if it get changed and the user specify another dir ok but default is build everywhere)…

  23. in contrib/devtools/test_deterministic_coverage.sh:89 in cd993bfab6 outdated
    85@@ -86,7 +86,7 @@ if [[ ! -e ${TEST_BITCOIN_BINARY} ]]; then
    86 fi
    87 
    88 get_file_suffix_count() {
    89-    find src/ -type f -name "*.$1" | wc -l
    90+    find build/src/ -type f -name "*.$1" | wc -l
    


    maflcko commented at 11:41 am on August 29, 2024:
    This is wrong, no? Did you test this?

    l0rinc commented at 1:14 pm on August 29, 2024:
    Please see the commit message. Should I drop the commit?

    maflcko commented at 1:18 pm on August 29, 2024:
    Nvm, I think the diff is correct, but I haven’t tested it.

    l0rinc commented at 1:23 pm on August 29, 2024:
    Thanks, dropped all devtools changes. Will rebase in s separate push, if needed.
  24. fanquake commented at 1:21 pm on August 29, 2024: member

    Can you fixup all the commits to have proper prefixes, commit messages etc.

    Also, I don’t think putting changes into commits based on if you actually tested things on not, make that much sense. I guess that’s for your own convenience so it’s easier for you to can drop the changes if they happen to be broken? However it doesn’t really benefit contributors, or the changelog.

  25. l0rinc force-pushed on Aug 29, 2024
  26. doc: Update documentation generation example in developer-notes.md
    To correspond to the documentation style of e.g. src/test/README.md
    
    Co-authored-by: pablomartin4btc <pablomartin4btc@gmail.com>
    91b3bc2b9c
  27. doc: Prepend 'build/' to binary paths under 'src/' in docs 6a68343ffb
  28. l0rinc force-pushed on Aug 29, 2024
  29. l0rinc commented at 1:25 pm on August 29, 2024: contributor

    commits based on if you actually tested things or not

    That’s also why it was a draft at first, so that I can get feedback on how to proceed with the devtools files. I’ve reverted them, it’s ready for review now, thanks for the feedback.

  30. pablomartin4btc approved
  31. pablomartin4btc commented at 7:19 pm on August 29, 2024: member
    ACK 6a68343ffbf3291eb243d90c00df50e672ff3944
  32. DrahtBot requested review from hebasto on Aug 29, 2024
  33. theStack commented at 2:43 pm on September 2, 2024: contributor
    Concept ACK
  34. 0xB10C commented at 11:42 pm on September 2, 2024: contributor
    Concept ACK
  35. maflcko commented at 6:18 am on September 3, 2024: member
    review ACK 6a68343ffbf3291eb243d90c00df50e672ff3944
  36. DrahtBot requested review from 0xB10C on Sep 3, 2024
  37. DrahtBot requested review from theStack on Sep 3, 2024
  38. fanquake approved
  39. fanquake commented at 9:29 am on September 3, 2024: member
    ACK 6a68343ffbf3291eb243d90c00df50e672ff3944 - we still need to followup with other scripts/devtools, and likely unify what we are doing in some way, but this is an improvement.
  40. fanquake merged this on Sep 3, 2024
  41. fanquake closed this on Sep 3, 2024

  42. l0rinc deleted the branch on Sep 12, 2024

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: 2024-11-21 12:12 UTC

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