Skip to content

Conversation

@JohnsterID
Copy link

@JohnsterID JohnsterID commented Jan 21, 2026

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)

Runtime issues

Closes #486

@greptile-apps
Copy link

greptile-apps bot commented Jan 21, 2026

Greptile Summary

This PR adds automated MinGW-w64 (i686) cross-compilation to the CI pipeline, enabling Linux-hosted builds for both Generals and GeneralsMD. The implementation adds two new jobs (build-mingw-generals and build-mingw-generalsmd) that mirror the existing MSVC build workflow structure. Each job builds both Release and Debug variants, properly caches toolchain dependencies, and collects artifacts (stripped executables with separate debug symbols for Release builds, embedded symbols for Debug builds). The jobs correctly respect the existing detect-changes filters and exclude the profile preset due to MSVC inline assembly incompatibility with GCC. The Wine/widl installation includes robust fallback logic for different Ubuntu versions.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are purely additive CI configuration that don't modify any source code. The new build jobs follow established patterns from existing MSVC jobs, use proper dependency caching, include appropriate fallback logic for toolchain installation, and correctly filter on the same change detection paths as other build jobs. The implementation references existing CMake presets and toolchain files that were added in previous commits.
  • No files require special attention

Important Files Changed

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
Loading

…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)
@JohnsterID JohnsterID force-pushed the add-mingw-i686-build branch from c701bca to 7ba67b2 Compare January 21, 2026 21:06
@xezon
Copy link

xezon commented Jan 22, 2026

How do these sizes compare with the other builds that we do?

@jurassicLizard
Copy link

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

@JohnsterID
Copy link
Author

Yep, this is a trade-off: ease of use and portability/convenience versus size. These builds prioritize self-contained artifacts over minimizing footprint.

@xezon xezon requested a review from OmniBlade January 22, 2026 22:22
@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker Build Anything related to building, compiling Platform Work towards platform support, such as Linux, MacOS labels Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build Anything related to building, compiling Minor Severity: Minor < Major < Critical < Blocker Platform Work towards platform support, such as Linux, MacOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make project buildable using MinGW toolchain

3 participants