build(cmake): unbreak Linux configure and add a working Linux build workflow - #113
Open
svenbledt wants to merge 2 commits into
Open
build(cmake): unbreak Linux configure and add a working Linux build workflow#113svenbledt wants to merge 2 commits into
svenbledt wants to merge 2 commits into
Conversation
CMP0167 was introduced in CMake 3.30. Setting it unconditionally is a hard error -- "Policy CMP0167 is not known to this version of CMake" -- on anything older, including the 3.28.3 that Ubuntu 24.04 ships. That breaks configure outright on Linux. docker/Dockerfile installs the same apt cmake on ubuntu:24.04, so the documented Docker build is affected by the same mechanism. Wrapping the call in if(POLICY CMP0167) keeps the original behaviour on CMake 3.30+, where the policy exists and OLD is what selects the legacy FindBoost module, and makes it a no-op below that. Boost 1.83 on Ubuntu 24.04 resolves through BoostConfig.cmake either way. Verified: configure succeeds and the full core builds on Ubuntu 24.04 / GCC 13.3 / CMake 3.28.3. Not re-tested on Windows/MSVC, where the guarded path is identical to the previous behaviour.
The workflow could not get past configure. TOOLS defaults to ON, which pulls in dep/bzip2 and dep/CascLib, and libreadline-dev was missing -- dep/readline aborts with an explicit FATAL_ERROR without it. zlib1g-dev was resolving only by accident off the hosted runner image, and would break on any leaner one. Mirror the flags docker/Dockerfile already uses as the known-good Linux recipe (TOOLS=0, SCRIPTS=static, RelWithDebInfo) rather than a separate Release configuration, so CI validates what actually ships. Install the six Boost components dep/boost asks for instead of libboost-all-dev, which is about a gigabyte of packages the core never links. Add ccache, with the same sloppiness set docker/Dockerfile uses, because both PCH options are on by default. Drop the ctest step: this repository has no test framework, so it only ever reported that no tests were found, hidden behind continue-on-error. Drop submodules: recursive as well -- dependencies are vendored under dep/ and there is no .gitmodules. Verified: full green run under nektos/act on catthehacker/ubuntu:act-latest. Configure 2.1s, build 8m59s, 1976 objects compiled, no errors.
Hextv
marked this pull request as ready for review
August 7, 2026 18:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes Proposed:
This PR proposes changes to:
Two related build fixes. The second one is the reason the first is visible.
1.
dep/boost/CMakeLists.txt— guardCMP0167cmake_policy(SET CMP0167 OLD)is currently called unconditionally. That policy was introduced in CMake 3.30, and setting an unknown policy is a hard error on anything older:Ubuntu 24.04 ships CMake 3.28.3, so configure fails outright there.
docker/Dockerfileinstalls the same aptcmakeonubuntu:24.04, so the documented Docker build is affected by the same mechanism — I have not rundocker compose buildto confirm, but the version is identical.Wrapping the call in
if(POLICY CMP0167)preserves the original behaviour on CMake 3.30+, where the policy exists andOLDis what selects the legacyFindBoostmodule. Below 3.30 it becomes a no-op, and Boost 1.83 resolves throughBoostConfig.cmakeregardless — the configure log shows all six components found by config mode.2.
.github/workflows/linux-build.yml— a Linux build workflow that actually completesBeyond the policy error, the workflow could not have configured anyway:
libreadline-devdep/readline/CMakeLists.txtraises an explicitFATAL_ERRORwithout itTOOLSdefaults to ONdep/bzip2+dep/CascLib;libbz2-devwas not installed, and the extractors need client data no runner haszlib1g-devimplicitdep/zlibisfind_package(ZLIB REQUIRED); it resolved only by accident off the hosted runner imageOther changes:
docker/Dockerfile, the known-good Linux recipe:TOOLS=0,SCRIPTS=static,RelWithDebInfoinstead of a separateReleaseconfiguration, so CI validates what ships.libboost-all-dev(~1GB of packages the core never links).CCACHE_SLOPPINESSsetdocker/Dockerfileuses, since both PCH options are on by default.cteststep is removed. There is no test framework in this repository, so it only ever reported that no tests were found, hidden behindcontinue-on-error. Its--build-configflag was also inert under single-config Ninja.submodules: recursiveremoved — dependencies are vendored underdep/and there is no.gitmodules.mainandconcurrencyadded so superseded runs are cancelled.AI-assisted Pull Requests
Claude Code, model Claude Opus 5. Used for diagnosis, the workflow rewrite, and running the verification below. Both changes are small and I can justify each line; the
CMP0167fix is the standard guarded idiom from the CMake docs.Issues Addressed:
None — found while trying to get the Linux workflow to run.
SOURCE:
The changes have been validated through:
None of these apply. There is no gameplay behaviour here, so there is nothing to source against retail. The authority for the
CMP0167change is the CMake policy documentation (introduced in 3.30) and the configure error above.Tests Performed:
This PR has been:
What I actually ran: the full workflow locally under
nektos/actoncatthehacker/ubuntu:act-latest, end to end:1976 objects compiled on GCC 13.3 / Ubuntu 24.04 / CMake 3.28.3, no errors. This is the first evidence I am aware of that the experimental Linux port builds clean end to end.
What I did not run, stated plainly:
docker compose buildrun, so the claim that Docker is affected by the same mechanism is inference from the CMake version, not an observation.act. Hosted runners can carry a newer CMake than apt's onPATH; the guard makes the workflow correct in either direction, but the first real run is the proof.How to Test the Changes:
mainand runcmake -S . -B build -G Ninja -DTOOLS=0— configure fails withPolicy "CMP0167" is not known to this version of CMake.cmake --build build --parallelbuilds the core to completion.act -j build -P ubuntu-latest=catthehacker/ubuntu:act-latest.Known Issues and TODO List:
max-size: 5Gfor the ccache is a starting estimate. One cleanRelWithDebInfobuild writes ~2G of objects, so the original 2G filled to 99.97% and would evict itself before the next run could hit. 5G leaves headroom, but GitHub caps total cache at 10GB per repository and evicts LRU across it, so maintainers may want to tune this once several branches are running CI.-Wdeprecated-declarations(302), but also 24-Wenum-compareand 3-Wreturn-type. The latter two are worth a separate look — for examplesrc/server/scripts/Zandalar/Uldir/boss_zulreborn.cpp:491comparesEncounterDataagainstEncounterState. Out of scope here; happy to open an issue.