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.
docs: Windows build intructions result in a large binary #30593
issue vostrnad opened this issue on August 6, 2024-
vostrnad commented at 8:07 AM on August 6, 2024: none
-
fanquake commented at 8:20 AM on August 6, 2024: member
It's the debug symbols. If you run
strip src/bitcoind.exeyou'll end up with a ~15mb binary. -
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.
-
vostrnad commented at 8:39 AM on August 6, 2024: none
Thank you, that was it. It this something worth noting in the docs?
-
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:
But even building with
CFLAGSandCXXFLAGSleaves some infostripis able to remove to further reduce binary size. -
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.
make HOST=$(gcc -dumpmachine) NO_QT=1 NO_ZMQ=1 NO_WALLET=1 NO_BDB=1 NO_SQLITE=1 \ && ./autogen.sh \ && ./configure \ --prefix=$PWD/depends/$(gcc -dumpmachine) LDFLAGS="-static-libstdc++" \ --disable-bench \ --disable-cli \ --disable-debug \ --disable-man \ --disable-tests \ --disable-upnp \ --disable-wallet \ --disable-zmq \ --with-qrencode=no \ --enable-fuzz-binary=no \ --enable-strip \ --without-gui \ --without-bdb \ --with-sqlite=no \ && makeREPOSITORY TAG IMAGE ID CREATED SIZE bitcoind 27.1 7a14ec692f8c 2 days ago 149MB bitcoind 26.2 6fc0c7867196 4 days ago 80.1MBJust adding the option "-s" or "--strip-all". Example: LDFLAGS="-static-libstdc++ -s" reduces the binary in 27.1 to 79 MB.
-
davidgumberg commented at 6:53 AM on September 9, 2024: contributor
+1 to adding a note in
doc/build-windows.md - fanquake added the label Docs on Mar 5, 2025
- fanquake added the label Build system on Mar 5, 2025
- hebasto closed this on Mar 8, 2025
- hebasto referenced this in commit 4637cb1eec on Mar 8, 2025