doc: add note to Windows build about stripping bins #32002

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:windows_strip_note changing 1 files +12 −3
  1. fanquake commented at 4:54 pm on March 5, 2025: member

    The Windows binaries are particularly big when they contain debug info, closing in on 500mb. Add a note to the Windows build instructions about using --strip.

    I haven’t tested this (the copying out to WSL). If we don’t want to add this note, in favour of user-presents or similar, then we should just close #30593.

    Fixes #30593.

  2. DrahtBot commented at 4:54 pm on March 5, 2025: contributor

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK hodlinator, hebasto

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

  3. DrahtBot added the label Docs on Mar 5, 2025
  4. in doc/build-windows.md:76 in a4ff7ce7a5 outdated
    87 
    88-    cmake --build build --target deploy
    89+Note that due to the presence of debug information, the binaries may be very large,
    90+if you do not need the debug information, you can prune it by calling:
    91+```shell
    92+cmake --install build --target install/strip
    


    hebasto commented at 10:36 pm on March 5, 2025:

    The --target option is not available for the cmake --install command:

    0$ cmake --install build --target install/strip
    1Unknown argument --target
    2...
    
  5. hebasto commented at 10:36 pm on March 5, 2025: member

    Concept ACK on amending documentation.

    I believe, that the --strip option is what we need:

    0cmake --install build --prefix /mnt/c/workspace/bitcoin --strip
    
  6. hebasto added the label Windows on Mar 5, 2025
  7. fanquake force-pushed on Mar 6, 2025
  8. fanquake force-pushed on Mar 6, 2025
  9. in doc/build-windows.md:47 in 9d0311d5bd outdated
    43@@ -44,26 +44,34 @@ Note that for WSL the Bitcoin Core source path MUST be somewhere in the default
    44 example /usr/src/bitcoin, AND not under /mnt/d/. If this is not the case the dependency autoconf scripts will fail.
    45 This means you cannot use a directory that is located directly on the host Windows file system to perform the build.
    46 
    47-Build using:
    48-
    49-    gmake -C depends HOST=x86_64-w64-mingw32  # Use "-j N" for N parallel jobs.
    50-    cmake -B build --toolchain depends/x86_64-w64-mingw32/toolchain.cmake
    51-    cmake --build build     # Use "-j N" for N parallel jobs.
    52+After building using the Windows subsystem it can be useful to copy the compiled
    


    hebasto commented at 7:52 am on March 7, 2025:
    0After building using the Windows subsystem, it can be useful to copy the compiled
    
  10. in doc/build-windows.md:50 in 9d0311d5bd outdated
    50-    cmake -B build --toolchain depends/x86_64-w64-mingw32/toolchain.cmake
    51-    cmake --build build     # Use "-j N" for N parallel jobs.
    52+After building using the Windows subsystem it can be useful to copy the compiled
    53+executables to a directory on the Windows drive in the same directory structure
    54+as they appear in the release `.zip` archive. If you would like to do this, configure
    55+an install prefix using `DCMAKE_INSTALL_PREFIX`. For example, to install to `c:\workspace\bitcoin`,
    


    hebasto commented at 7:52 am on March 7, 2025:
    0an install prefix using `CMAKE_INSTALL_PREFIX`. For example, to install to `c:\workspace\bitcoin`,
    
  11. hebasto commented at 7:54 am on March 7, 2025: member
    Approach ACK 9d0311d5bda104afaa8a89aa6505d683610609de.
  12. fanquake force-pushed on Mar 7, 2025
  13. hebasto approved
  14. hebasto commented at 12:25 pm on March 7, 2025: member
    ACK 416aeeaae9abb322389ec55bd9b281290cb390c7.
  15. hebasto requested review from davidgumberg on Mar 7, 2025
  16. hebasto requested review from hodlinator on Mar 7, 2025
  17. doc: add note to windows build about stripping bin
    The Windows binaries are particularly big when they contain debug
    info, closing in on 500mb. Add a note to the Windows build instructions
    about using `--strip`.
    c94195c077
  18. in doc/build-windows.md:48 in 416aeeaae9 outdated
    54+as they appear in the release `.zip` archive. If you would like to do this, configure
    55+an install prefix using `CMAKE_INSTALL_PREFIX`. For example, to install to `c:\workspace\bitcoin`,
    56+pass `-DCMAKE_INSTALL_PREFIX=/mnt/c/workspace/bitcoin` to `cmake -B`.
    57 
    58-## Depends system
    59+Build using:
    


    hodlinator commented at 3:40 pm on March 7, 2025:

    Don’t understand why you switched from --prefix to CMAKE_INSTALL_PREFIX, the previous order of build instructions before install instructions felt more ordered.

    Please amend the commit message with an explanation of this.


    fanquake commented at 3:48 pm on March 7, 2025:
    Shouldn’t we be using CMake options now that we are using CMake?

    hebasto commented at 4:27 pm on March 7, 2025:
    As I mentioned above, the cmake --install command does support the --prefix option.

    fanquake commented at 5:16 pm on March 7, 2025:
    Ok, will just back this up.
  19. fanquake force-pushed on Mar 7, 2025
  20. in doc/build-windows.md:38 in c94195c077
    34@@ -35,6 +35,7 @@ If you want to build the Windows installer using the `deploy` build target, you
    35 
    36     apt install nsis
    37 
    38+
    


    hodlinator commented at 9:54 pm on March 7, 2025:
    nit: Phantom newline.
  21. hodlinator approved
  22. hodlinator commented at 9:56 pm on March 7, 2025: contributor

    ACK c94195c077ff227e5e2d80e803e1400d7f60812b

    Tested on WSL

    Without --strip:

    0 27 998 527 /mnt/c/workspace/bitcoin/bin/bitcoin-cli.exe
    1587 584 175 /mnt/c/workspace/bitcoin/bin/bitcoin-qt.exe
    2 59 799 144 /mnt/c/workspace/bitcoin/bin/bitcoin-tx.exe
    3 27 408 020 /mnt/c/workspace/bitcoin/bin/bitcoin-util.exe
    4226 141 145 /mnt/c/workspace/bitcoin/bin/bitcoin-wallet.exe
    5467 648 497 /mnt/c/workspace/bitcoin/bin/bitcoind.exe
    6642 186 589 /mnt/c/workspace/bitcoin/bin/test_bitcoin-qt.exe
    7926 915 597 /mnt/c/workspace/bitcoin/bin/test_bitcoin.exe
    

    10+x size reduction with --strip:

    0  2 240 000 /mnt/c/workspace/bitcoin/bin/bitcoin-cli.exe
    1 40 493 072 /mnt/c/workspace/bitcoin/bin/bitcoin-qt.exe
    2  4 100 608 /mnt/c/workspace/bitcoin/bin/bitcoin-tx.exe
    3  1 933 824 /mnt/c/workspace/bitcoin/bin/bitcoin-util.exe
    4  9 614 336 /mnt/c/workspace/bitcoin/bin/bitcoin-wallet.exe
    5 15 609 856 /mnt/c/workspace/bitcoin/bin/bitcoind.exe
    6 40 844 304 /mnt/c/workspace/bitcoin/bin/test_bitcoin-qt.exe
    7 27 077 120 /mnt/c/workspace/bitcoin/bin/test_bitcoin.exe
    
  23. DrahtBot requested review from hebasto on Mar 7, 2025
  24. hebasto approved
  25. hebasto commented at 11:42 am on March 8, 2025: member
    ACK c94195c077ff227e5e2d80e803e1400d7f60812b.
  26. hebasto merged this on Mar 8, 2025
  27. hebasto closed this on Mar 8, 2025

  28. fanquake deleted the branch on Mar 8, 2025

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: 2025-03-31 09:12 UTC

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