-
Notifications
You must be signed in to change notification settings - Fork 149
build(ci): Add MinGW-w64 i686 cross-compilation to CI workflow #2163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
| Filename | Overview |
|---|---|
| .github/workflows/ci.yml | Adds two new MinGW-w64 i686 build jobs (Generals and GeneralsMD) with proper toolchain setup, caching, and artifact collection matching the existing MSVC workflow pattern |
Sequence Diagram
sequenceDiagram
participant GH as GitHub Event
participant DC as detect-changes
participant BG as build-mingw-generals
participant BM as build-mingw-generalsmd
participant Cache as Actions Cache
participant Apt as Ubuntu APT
participant CMake as CMake Build
participant Artifacts as GitHub Artifacts
GH->>DC: Trigger on push/PR/manual
DC->>DC: Filter changed paths
DC-->>BG: generals=true OR shared=true
DC-->>BM: generalsmd=true OR shared=true
par Generals Build
BG->>Cache: Check MinGW-w64 deps cache
Cache-->>BG: Cache hit/miss
BG->>Apt: Install mingw-w64, cmake
BG->>Apt: Install wine-stable + widl
BG->>Cache: Check CMake deps cache
Cache-->>BG: Cache hit/miss
BG->>CMake: Configure with preset
CMake->>CMake: Set toolchain (i686-w64-mingw32)
CMake->>CMake: Disable tools/extras
BG->>CMake: Build g_generals target
CMake->>CMake: Compile with GCC
CMake->>CMake: Strip symbols (Release only)
BG->>BG: Collect .exe + .exe.debug
BG->>Artifacts: Upload Generals-{preset}
and GeneralsMD Build
BM->>Cache: Check MinGW-w64 deps cache
Cache-->>BM: Cache hit/miss
BM->>Apt: Install mingw-w64, cmake
BM->>Apt: Install wine-stable + widl
BM->>Cache: Check CMake deps cache
Cache-->>BM: Cache hit/miss
BM->>CMake: Configure with preset
CMake->>CMake: Set toolchain (i686-w64-mingw32)
CMake->>CMake: Disable tools/extras
BM->>CMake: Build z_generals target
CMake->>CMake: Compile with GCC
CMake->>CMake: Strip symbols (Release only)
BM->>BM: Collect .exe + .exe.debug
BM->>Artifacts: Upload GeneralsMD-{preset}
end
…perHackers#2163) Add automated MinGW-w64 (i686) build jobs for both Generals and GeneralsMD to the CI pipeline, enabling Linux-hosted cross-compilation with artifact collection matching the MSVC PDB workflow. Changes: - .github/workflows/ci.yml: Add two new matrix build jobs - build-mingw-generals: Builds Generals with mingw-w64-i686 toolchain - build-mingw-generalsmd: Builds GeneralsMD with mingw-w64-i686 toolchain - Matrix: mingw-w64-i686 (Release), mingw-w64-i686-debug (Debug) - Profile preset excluded (uses MSVC inline ASM with no GCC equivalent) Toolchain setup (ubuntu-latest): - MinGW-w64 cross-compiler (i686-w64-mingw32-gcc) - Wine stable + widl for COM interface compilation - CMake with Unix Makefiles generator - Cached toolchain and dependencies Artifact collection: - Stripped executable (.exe) + separate debug symbols (.exe.debug) for Release - Single executable with embedded symbols for Debug - Matches MSVC .exe + .pdb workflow - Static linked (no DLL dependencies) - 30-day retention period Jobs respect detect-changes filter (Generals/**, GeneralsMD/**, Core/**, .github/workflows/**, etc.) for conditional execution, identical to existing VC6 and win32 build triggers. Result: 4 new artifact combinations - Generals-mingw-w64-i686 (76 MB: 12 MB exe + 229 MB debug) - Generals-mingw-w64-i686-debug (56.6 MB: 200 MB exe) - GeneralsMD-mingw-w64-i686 (82.2 MB: 13 MB exe + 248 MB debug) - GeneralsMD-mingw-w64-i686-debug (61.4 MB: 215 MB exe)
c701bca to
7ba67b2
Compare
|
How do these sizes compare with the other builds that we do? |
mingw binaries are almost always larger as these builds have a lot of statically linked libraries most notably libgcc and libstdc++ which could be dynamically linked dlls and shipped seperately to reduce size if it is a concern |
|
Yep, this is a trade-off: ease of use and portability/convenience versus size. These builds prioritize self-contained artifacts over minimizing footprint. |
Add automated MinGW-w64 (i686) build jobs for both Generals and GeneralsMD to the CI pipeline, enabling Linux-hosted cross-compilation with artifact collection matching the MSVC PDB workflow.
Changes:
Toolchain setup (ubuntu-latest):
Artifact collection:
Jobs respect detect-changes filter (Generals/, GeneralsMD/, Core/, .github/workflows/, etc.) for conditional execution, identical to existing VC6 and win32 build triggers.
Result: 4 new artifact combinations
Runtime issues
- Also note TheSuperHackers/bink-sdk-stub@3241ee1 breaks VS building, see INSTALL target is broken by Bink Update #2166 so bink cmake needs reviewFixed by Prevent install target generation if not top level. bink-sdk-stub#8Closes #486