feat(docker): add Windows cross-compilation support via Docker

Add Dockerfile.windows and build-windows.sh for cross-compiling Windows executables
in a containerized environment. Includes documentation updates in README.md with
build instructions and troubleshooting tips for Windows builds.
This commit is contained in:
2025-10-29 14:56:13 +01:00
parent 9fc1062b9a
commit 6e29c7cd9d
3 changed files with 145 additions and 1 deletions

View File

@@ -62,4 +62,67 @@ docker run --rm -it -v "$(pwd)/../build/linux-x86_64":/out palladium-builder:lin
**Docker build issues:** Ensure Docker has sufficient resources and the daemon is running
**Missing dependencies:** The Dockerfile installs all required build dependencies automatically
**Missing dependencies:** The Dockerfile installs all required build dependencies automatically
## Windows x86_64 Build
### Overview
This build creates Windows x86_64 executables using cross-compilation in a Docker container based on Ubuntu 20.04. The build process:
1. **Builds a Docker image** (`palladium-builder:windows-ubuntu20.04`) containing MinGW-w64 cross-compilation toolchain
2. **Copies the entire repository** into the container during image build
3. **Cross-compiles for Windows** using the `depends` system with `x86_64-w64-mingw32` target
4. **Outputs .exe files** to a mounted volume for host access
### Quick Start
```bash
cd docker-build
chmod +x build-windows.sh
./build-windows.sh
```
Windows executables will be available in `../build/windows/` directory.
### Prerequisites
- Docker installed and running ([installation guide](https://docs.docker.com/get-docker/))
- Sufficient disk space for the build process (at least 12 GB free)
- Internet connection for downloading dependencies and MinGW-w64 toolchain
### Produced Executables
The following Windows executables are built and copied to the output directory:
- `palladiumd.exe`: Main daemon
- `palladium-cli.exe`: Command-line client
- `palladium-tx.exe`: Transaction utility
- `palladium-wallet.exe`: Wallet utility
- `palladium-qt.exe`: GUI application (if Qt dependencies are available)
### Output Directory
Executables are placed in: `../build/windows/` (relative to the docker-build directory)
### Cross-Compilation Details
- **Target Triple**: `x86_64-w64-mingw32`
- **Toolchain**: MinGW-w64 cross-compiler
- **Dependencies**: Built using the `depends` system for Windows target
- **Configuration**: Uses `CONFIG_SITE` for proper cross-compilation setup
### Troubleshooting
**Permission errors:** The build script automatically handles file permissions using host UID/GID
**Build failed:** Run interactive container for debugging:
```bash
docker run --rm -it -v "$(pwd)/../build/windows":/out palladium-builder:windows-ubuntu20.04 bash
```
**Cross-compilation issues:** Ensure the MinGW-w64 toolchain is properly installed in the container
**Missing .exe files:** Check that the configure script detected the Windows target correctly
**Docker build issues:** Ensure Docker has sufficient resources and the daemon is running