Repository: bitcoin/bitcoin (language: cpp)

Issue:
docs: Windows build intructions result in a large binary
Following the intructions in [doc/build-windows.md](../blob/master/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
Following the intructions in [doc/build-windows.md](../blob/master/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.


Discussion / hints:
It's the debug symbols. If you run `strip src/bitcoind.exe` you'll end up with a ~15mb binary.
> For comparison, the latest release binary is around 15 MB. 

The release binaries are stripped of debug info.
Thank you, that was it. It this something worth noting in the docs?
In a post-cmake world this is the type of thing I would expect developers to add to their own [cmakuserpresets.json](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html), 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.
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 \    
  && make
```

```
REPOSITORY       TAG           IMAGE ID       CREATED         SIZE
bitcoind         27.1          7a14ec692f8c   2 days ago      149MB
bitcoind         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.
+1 to adding a note in `doc/build-windows.md`
It's the debug symbols. If you run `strip src/bitcoind.exe` you'll end up with a ~15mb binary.
> For comparison, the latest release binary is around 15 MB. 

The release binaries are stripped of debug info.
Thank you, that was it. It this something worth noting in the docs?
In a post-cmake world this is the type of thing I would expect developers to add to their own [cmakuserpresets.json](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html), 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.
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 \    
  && make
```

```
REPOSITORY       TAG           IMAGE ID       CREATED         SIZE
bitcoind         27.1          7a14ec692f8c   2 days ago      149MB
bitcoind         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.
+1 to adding a note in `doc/build-windows.md`

Fix patch:
diff --git a/doc/build-windows.md b/doc/build-windows.md
index 0c1418bff935b..03af0654cea28 100644
--- a/doc/build-windows.md
+++ b/doc/build-windows.md
@@ -35,6 +35,7 @@ If you want to build the Windows installer using the `deploy` build target, you
 
     apt install nsis
 
+
 Acquire the source in the usual way:
 
     git clone https://github.com/bitcoin/bitcoin.git
@@ -61,9 +62,17 @@ After building using the Windows subsystem it can be useful to copy the compiled
 executables to a directory on the Windows drive in the same directory structure
 as they appear in the release `.zip` archive. This can be done in the following
 way. This will install to `c:\workspace\bitcoin`, for example:
+```shell
+cmake --install build --prefix /mnt/c/workspace/bitcoin
+```
 
-    cmake --install build --prefix /mnt/c/workspace/bitcoin
+Note that due to the presence of debug information, the binaries may be very large,
+if you do not need the debug information, you can prune it during install by calling:
+```shell
+cmake --install build --prefix /mnt/c/workspace/bitcoin --strip
+```
 
 You can also create an installer using:
-
-    cmake --build build --target deploy
+```shell
+cmake --build build --target deploy
+```


Test patch: