docs: Windows build intructions result in a large binary #30593

issue vostrnad openend this issue on August 6, 2024
  1. vostrnad commented at 8:07 am on August 6, 2024: none
    Following the intructions in doc/build-windows.md results in a bitcoind binary that’s almost 440 MB. For comparison, the latest release binary is around 15 MB. Are the instructions perhaps missing a flag to create a release build or something like that? I’m using WSL.
  2. fanquake commented at 8:20 am on August 6, 2024: member
    It’s the debug symbols. If you run strip src/bitcoind.exe you’ll end up with a ~15mb binary.
  3. hebasto commented at 8:20 am on August 6, 2024: member

    For comparison, the latest release binary is around 15 MB.

    The release binaries are stripped of debug info.

  4. vostrnad commented at 8:39 am on August 6, 2024: none
    Thank you, that was it. It this something worth noting in the docs?
  5. willcl-ark commented at 1:31 pm on August 6, 2024: member

    In a post-cmake world this is the type of thing I would expect developers to add to their own cmakuserpresets.json, although I don’t see any reason it couldn’t be documented too. Compiling without debug symbols is already documented in build-unix.md:

    https://github.com/bitcoin/bitcoin/blob/43740f4971f45cd5499470b6a085b3ecd8b96d28/doc/build-unix.md?plain=1#L30

    But even building with CFLAGS and CXXFLAGS leaves some info strip is able to remove to further reduce binary size.

  6. evehash commented at 1:35 pm on August 15, 2024: none

    Same issue when compiling 27.1 to build my own docker images in alpine. Same process, just switching tags.

     0 make HOST=$(gcc -dumpmachine) NO_QT=1 NO_ZMQ=1 NO_WALLET=1 NO_BDB=1 NO_SQLITE=1 \
     1  && ./autogen.sh \
     2  && ./configure \
     3    --prefix=$PWD/depends/$(gcc -dumpmachine) LDFLAGS="-static-libstdc++"  \
     4    --disable-bench \
     5    --disable-cli \
     6    --disable-debug \
     7    --disable-man \
     8    --disable-tests \
     9    --disable-upnp \
    10    --disable-wallet \
    11    --disable-zmq \
    12    --with-qrencode=no \
    13    --enable-fuzz-binary=no \
    14    --enable-strip \
    15    --without-gui \
    16    --without-bdb \
    17    --with-sqlite=no \    
    18  && make
    
    0REPOSITORY       TAG           IMAGE ID       CREATED         SIZE
    1bitcoind         27.1          7a14ec692f8c   2 days ago      149MB
    2bitcoind         26.2          6fc0c7867196   4 days ago      80.1MB
    

    Just adding the option “-s” or “–strip-all”. Example: LDFLAGS="-static-libstdc++ -s" reduces the binary in 27.1 to 79 MB.

  7. davidgumberg commented at 6:53 am on September 9, 2024: contributor
    +1 to adding a note in doc/build-windows.md
  8. fanquake added the label Docs on Mar 5, 2025
  9. fanquake added the label Build system on Mar 5, 2025
  10. hebasto closed this on Mar 8, 2025

  11. hebasto referenced this in commit 4637cb1eec 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-04-03 00:12 UTC

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