ci(build): Add MinGW-w64 i686 cross-compilation to CI workflow#2163
ci(build): Add MinGW-w64 i686 cross-compilation to CI workflow#2163JohnsterID wants to merge 2 commits intoTheSuperHackers:mainfrom
Conversation
|
…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. |
…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)
…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 can you Rebase this to see if it still compiles? |
…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)
7ba67b2 to
ff7557a
Compare
The Cache MinGW-w64 Dependencies step attempted to cache system paths (/usr/lib/gcc/i686-w64-mingw32, /usr/i686-w64-mingw32) which is problematic due to permission issues with actions/cache when handling root-owned paths. Additionally, the Install MinGW-w64 Toolchain step ran unconditionally without checking cache-hit status, making the cache completely redundant. Remove the cache step entirely and rely on apt-get install which is fast enough (~4s at 76MB/s) and reliable.
| - name: Cache CMake Dependencies | ||
| id: cache-cmake-deps | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: build/${{ matrix.preset }}/_deps | ||
| key: cmake-deps-mingw-${{ matrix.preset }}-${{ hashFiles('CMakePresets.json','cmake/**/*.cmake','**/CMakeLists.txt') }} |
There was a problem hiding this comment.
Cache key collision between concurrent jobs: both build-mingw-generals and build-mingw-generalsmd produce identical cache keys for matching preset values (e.g., both output cmake-deps-mingw-mingw-w64-i686-<hash>). When these jobs run in parallel, whichever finishes first wins the single cache slot; the other job's save is silently dropped.
While the CMake dependencies are likely identical today, the pattern is fragile. If Generals and GeneralsMD ever require different sub-dependencies, one job will silently restore the wrong cached tree. Add a job-specific discriminator to the cache key to eliminate ambiguity — for example, use cmake-deps-mingw-generals-${{ matrix.preset }}-... in build-mingw-generals and cmake-deps-mingw-generalsmd-${{ matrix.preset }}-... in build-mingw-generalsmd.
The same collision exists in build-mingw-generalsmd at line 313–318.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/ci.yml
Line: 225-230
Comment:
Cache key collision between concurrent jobs: both `build-mingw-generals` and `build-mingw-generalsmd` produce identical cache keys for matching preset values (e.g., both output `cmake-deps-mingw-mingw-w64-i686-<hash>`). When these jobs run in parallel, whichever finishes first wins the single cache slot; the other job's save is silently dropped.
While the CMake dependencies are likely identical today, the pattern is fragile. If Generals and GeneralsMD ever require different sub-dependencies, one job will silently restore the wrong cached tree. Add a job-specific discriminator to the cache key to eliminate ambiguity — for example, use `cmake-deps-mingw-generals-${{ matrix.preset }}-...` in `build-mingw-generals` and `cmake-deps-mingw-generalsmd-${{ matrix.preset }}-...` in `build-mingw-generalsmd`.
The same collision exists in `build-mingw-generalsmd` at line 313–318.
How can I resolve this? If you propose a fix, please make it concise.|
Ok every target is building. Are we happy to merge this now or is there still something to do? |
|
Changed title to |
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