Skip to content

ci(build): Install widl from the Ubuntu Wine packages instead of the WineHQ repository in MinGW-w64 jobs - #3675

Draft
OmarAglan wants to merge 8 commits into
TheSuperHackers:mainfrom
OmarAglan:ci/mingw-widl-from-mingw-w64-tools
Draft

OmarAglan wants to merge 8 commits into
TheSuperHackers:mainfrom
OmarAglan:ci/mingw-widl-from-mingw-w64-tools

Conversation

@OmarAglan

@OmarAglan OmarAglan commented Nov 10, 2026 •

Copy link
Copy Markdown

Depends on #3552. Only the last commit belongs to this PR.

The MinGW-w64 jobs add the WineHQ apt repository and install Wine from it only to get widl, which compiles the two browser IDL files. That repository is the reason the runner had to be pinned to Ubuntu 24.04, because apt on Ubuntu 26.04 rejects the WineHQ key file.

Ubuntu has what is needed in its own packages. wine64-tools has widl (as widl-stable) and depends on libwine-dev, which has the system IDL files. cmake/widl.cmake already looks for widl-stable and for /usr/include/wine/wine/windows, so no cmake change is needed.

This change installs wine64-tools and removes the WineHQ repository, the key download and the i386 architecture setup.

The runner stays pinned to Ubuntu 24.04 in this PR.

I first tried widl from mingw-w64-tools, but the Ubuntu mingw-w64 packages do not ship the IDL files, so it cannot compile them.

AI USE

Used AI to make the change and to check the Ubuntu package contents.

JohnsterID and others added 7 commits November 8, 2026 14:26
…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)
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.
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

The change adds MinGW-w64 compiler and link settings, a reusable workflow to build Generals or GeneralsMD and upload build artifacts, and CI jobs that invoke the workflow.

Changes

MinGW-w64 build support

Layer / File(s) Summary
Compiler and link requirements
cmake/mingw.cmake, Core/Libraries/Source/WWVegas/WWDownload/CMakeLists.txt, Generals/Code/GameEngine/CMakeLists.txt, GeneralsMD/Code/GameEngine/CMakeLists.txt
Adds -msse2 for MinGW compilation. Adds ws2_32 and the game engine device targets as interface link dependencies.
Reusable build and artifact upload
.github/workflows/reusable-build-mingw.yml
Adds MinGW setup, game-specific CMake configuration and build targets, and collection and upload of executables, DLLs, and debug symbols.
Generals and GeneralsMD CI jobs
.github/workflows/ci.yml
Adds jobs that call the reusable workflow on workflow dispatch or when the relevant game or shared files change.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant ReusableWorkflow as reusable-build-mingw.yml
  participant CMake
  participant ArtifactUpload
  GitHubActions->>ReusableWorkflow: Pass game and preset
  ReusableWorkflow->>CMake: Configure selected game
  ReusableWorkflow->>CMake: Build selected target
  ReusableWorkflow->>ArtifactUpload: Upload executables, DLLs, and debug symbols
Loading

Possibly related PRs

Suggested labels: Build, Platform, CI

Suggested reviewers: xezon

Merge Risk: Low · up to 7151f

The MinGW CI jobs still depend on Wine packages, so the change does not yet deliver its stated goal of replacing them with mingw-w64-tools. Builds are not shown to break. Finish the switch, including the widl lookup in cmake/widl.cmake, before or soon after merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title concerns the MinGW-w64 widl installation, but it names Ubuntu Wine packages instead of the mingw-w64-tools approach stated in the objectives. It is partially related to the change.
Description check Passed The description explains changes to widl installation for MinGW-w64 CI, so it is related to the pull request objectives.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional comments: 1

.github/workflows/reusable-build-mingw.yml: 1

59-59: Trivial · Maintainability & Code Quality · Low value

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Quote $(nproc).

actionlint reports SC2046 for the unquoted -j$(nproc). The value is a single integer, so there is no practical failure. Use -j"$(nproc)" to clear the warning.

Proposed fix

-          cmake --build build/${{ inputs.preset }} --target ${{ inputs.game == 'Generals' && 'g_generals' || 'z_generals' }} -j$(nproc)
+          cmake --build build/${{ inputs.preset }} --target ${{ inputs.game == 'Generals' && 'g_generals' || 'z_generals' }} -j"$(nproc)"

Source: Linters/SAST tools

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1c65bdce-7afd-4b20-96ce-d58efb9f8cb3
Commits

Reviewing files that changed from the base of the PR and between 998f337 and 521805b.

Files selected for processing: 9

  • .github/workflows/ci.yml
  • .github/workflows/reusable-build-mingw.yml
  • Core/Libraries/Source/EABrowserDispatch/CMakeLists.txt
  • Core/Libraries/Source/EABrowserEngine/CMakeLists.txt
  • Core/Libraries/Source/WWVegas/WWDownload/CMakeLists.txt
  • Generals/Code/GameEngine/CMakeLists.txt
  • GeneralsMD/Code/GameEngine/CMakeLists.txt
  • cmake/mingw.cmake
  • cmake/widl.cmake

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

@OmarAglan
OmarAglan force-pushed the ci/mingw-widl-from-mingw-w64-tools branch from 521805b to 7151ff8 Compare November 10, 2026 10:46
@OmarAglan OmarAglan changed the title ci(build): Install widl from mingw-w64-tools instead of Wine in MinGW-w64 jobs ci(build): Install widl from the Ubuntu Wine packages instead of the WineHQ repository in MinGW-w64 jobs Nov 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 03af697b-a658-4212-914d-6569d0f0b941
Commits

Reviewing files that changed from the base of the PR and between 998f337 and 7151ff8.

Files selected for processing: 6

  • .github/workflows/ci.yml
  • .github/workflows/reusable-build-mingw.yml
  • Core/Libraries/Source/WWVegas/WWDownload/CMakeLists.txt
  • Generals/Code/GameEngine/CMakeLists.txt
  • GeneralsMD/Code/GameEngine/CMakeLists.txt
  • cmake/mingw.cmake

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

- name: Install widl
run: |
# widl compiles the IDL files. wine64-tools has widl and depends on libwine-dev, which has the system IDL files.
sudo apt-get install -y --no-install-recommends wine64-tools

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Functional Correctness · Quick win

Replace the Wine-dependent widl setup.

This step still installs wine64-tools. On Ubuntu 24.04, that package pulls in libwine-dev and libwine, so both MinGW jobs remain Wine-dependent. Replace it with mingw-w64-tools and update cmake/widl.cmake to find i686-w64-mingw32-widl and the MinGW IDL headers. Changing this install command alone will not complete the switch. (packages.ubuntu.com)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants