Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. WalkthroughThe CMake targets now declare additional interface link dependencies. CI invokes a reusable MinGW-w64 workflow to build Generals and GeneralsMD and upload build artifacts. ChangesMinGW-w64 build support
Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Other Sequence Diagram(s)sequenceDiagram
participant CI as CI workflow
participant Build as Reusable MinGW workflow
participant CMake as CMake
participant Artifacts as Artifact upload
CI->>Build: Invoke with game and preset
Build->>CMake: Configure selected game
CMake->>Build: Build game target
Build->>Artifacts: Upload executables, DLLs, and debug symbols
Suggested labels: Suggested reviewers: Merge Risk:
|
[Medium impact] The PR appears safe to merge; no new actionable issue was found.
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Avoid the cross-release WineHQ fallback. · ci.yml:227
.github/workflows/ci.yml:227
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAvoid the cross-release WineHQ fallback.
The workflow uses
winehq-jammy.sourceswhenever the codename-specific download fails. On a non-Jammy runner, this can make apt use a repository for a different Ubuntu release. Fail when the source is unavailable or allow only explicitly supported codename mappings.The downloaded
.sourcesfile already supplies apt’sSigned-Bybinding for the Jammy path, so the issue is not that apt ignores the downloaded key. Do not remove Wine setup solely because the executable targets do not link Wine: MinGW useswidland Wine headers to generate the browser interfaces.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
2f90689d-1afd-4007-bc5a-603ad020fdb1
📒 Files selected for processing: 1
.github/workflows/ci.yml
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
|
|
||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
Set persist-credentials: false on the checkout steps.
These two checkout steps leave the GITHUB_TOKEN in the local git config. The jobs run build scripts and Wine packages, and none of them needs to push to git. The credential adds exposure with no benefit. This is the zizmor artipacked finding. Disable credential persistence.
🔒️ Proposed fix
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: falseApply this change at both Line 214 and Line 302.
Also applies to: 302-302
🧰 Tools
🪛 zizmor (1.30.1)
[warning] 213-214: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
Source: Linters/SAST tools
There was a problem hiding this comment.
@OmarAglan Understood. Would you like me to open a follow-up issue for the checkout credential hardening?
You are interacting with an AI system.
There was a problem hiding this comment.
Unfortunately I do not know what this means. Is this a concern for this github repository?
There was a problem hiding this comment.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
There was a problem hiding this comment.
Unfortunately I do not know what this means. Is this a concern for this github repository?
actions/checkout saves the job's GitHub token in .git/config so that later steps can run git push. persist-credentials: false stops it from saving the token. It only matters if a step uploads the .git folder or runs code that reads it. Here the token is read only (ci.yml sets permissions: contents: read), the artifacts only contain exe, dll and debug files, and no other checkout in this repo sets it. So it is not a concern here.
If we want it anyway, it should be done for all workflows in its own PR.
|
More and more builds are being added to the already strained CI workflow. CI rebuilds with every push in every PR. Two suggestions
|
good point, as in the last run the 4 MinGW jobs took 64 of 178 runner minutes, and at 16 to 19 minutes each they are the slowest jobs, so they also make the pr wait longer. i can cut this pr down to the release preset only (so it will be 2 jobs instead of 4) as far as i know the debug preset adds little for a compile and link check. A base and extended split sounds good to me, but it changes the whole workflow, so I think it is better as its own pr once you and @xezon agree on the approach. after that we can have MinGW to the extended set. what do you think? |
| ) | ||
|
|
||
| # The engine calls functions that are implemented in the engine device, such as OSDisplaySetBusyState. | ||
| # Declaring this circular dependency lets linkers that read static libraries in order resolve them. |
There was a problem hiding this comment.
Can we remove this dependency? How many are there?
There was a problem hiding this comment.
i counted at least 3 calls that go from the engine into the device library
- OSDisplaySetBusyState in GameLogic.cpp
- ReloadAllTextures in ScriptEngine.cpp
- MOTDSystem in FunctionLexicon.cpp
The msvc linker searches all libraries, so it finds them in any order
instead the gnu ld reads each static library once in order, so it needs this line
removing these calls means moving them behind interfaces in engine code
can we rather do that in a separate pr?
There was a problem hiding this comment.
Yes. Separate change.
MOTDSystem can be moved to Core.
Remove ReloadAllTextures and just call WW3DAssetManager::Get_Instance()->Release_All_Textures() I think.
And for OSDisplayWarningBox, OSDisplaySetBusyState you need to do something clever.
There was a problem hiding this comment.
opened the three changes as separate prs
- refactor(scriptengine): Remove ReloadAllTextures and call the asset manager directly #3672 removes ReloadAllTextures and calls WW3DAssetManager::Get_Instance()->Release_All_Textures() directly
- refactor(gui): Move MOTDSystem from GameEngineDevice to GameEngine #3673 moves MOTDSystem to Core/GameEngine
- refactor(gameengine): Replace OSDisplaySetBusyState with GameEngine::setBusyState #3674 replaces OSDisplaySetBusyState with a virtual GameEngine::setBusyState(). Win32GameEngine overrides it with the same code, like serviceWindowsOS()
OSDisplayWarningBox has no callers, so it does not need the device library at link time. I left it as it is. I can remove it in another PR if you want.
After these are merged I will rebase this PR and remove this line.
…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.
… and WWDownload libraries
…rtifact copy errors
… release preset only
9078bac to
79addaa
Compare
This adds the MinGW-w64 i686 jobs from #2163 to CI, rebased onto main. It builds Generals and GeneralsMD on ubuntu-latest with the
mingw-w64-i686andmingw-w64-i686-debugpresets. The profile preset is excluded because it uses MSVC inline assembly. JohnsterID's two commits are unchanged and keep him as author.On current main, both executables compiled with MinGW but failed to link:
OSDisplaySetBusyState,ReloadAllTexturesandMOTDSystemare used by the game engine library but implemented in the engine device library. CMake only knew that the device depends on the engine, so the engine came last on the link line. GNU ld reads static libraries once, in order, so it never went back to the device library for them.acceptandlistenbut never linkedws2_32. It only came in through GameSpy, which is earlier on the link line.MSVC's linker searches all libraries regardless of order, so MSVC builds were not affected.
g_gameengineandz_gameenginedeclareINTERFACE g_gameenginedeviceandINTERFACE z_gameenginedevice. CMake supports this cycle between static libraries and repeats them on the link line.corei_wwdownloadlinksws2_32.Tested locally with msys2 MinGW-w64 (GCC 16.2) and the
mingw-w64-i686preset:generalsv.exeandgeneralszh.exeboth linkAI disclosure
Used Clude Code with Opus 5.5 to make the CMake fix, i reviewed and tested the change.