From b04c8fb960d0ac9412212c890ea191a84381846a Mon Sep 17 00:00:00 2001 From: Sven Bledt Date: Fri, 7 Aug 2026 18:24:31 +0200 Subject: [PATCH 1/2] build(cmake): guard CMP0167 behind a policy existence check 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. --- dep/boost/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dep/boost/CMakeLists.txt b/dep/boost/CMakeLists.txt index 49475510..b26c7a72 100644 --- a/dep/boost/CMakeLists.txt +++ b/dep/boost/CMakeLists.txt @@ -30,7 +30,11 @@ include (CheckCXXSourceCompiles) set(BOOST_REQUIRED_VERSION 1.72) -cmake_policy(SET CMP0167 OLD) +# CMP0167 only exists from CMake 3.30 on; setting it unguarded is a hard error +# on older CMake, which breaks every distro still shipping 3.28 (Ubuntu 24.04). +if(POLICY CMP0167) + cmake_policy(SET CMP0167 OLD) +endif() find_package(Boost ${BOOST_REQUIRED_VERSION} REQUIRED system filesystem thread program_options iostreams regex) From 9d25a3cabbb1112cdef508fa24a2d44a45477c8f Mon Sep 17 00:00:00 2001 From: Sven Bledt Date: Fri, 7 Aug 2026 18:24:43 +0200 Subject: [PATCH 2/2] ci: add a Linux build workflow that configures and compiles 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. --- .github/workflows/linux-build.yml | 73 +++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/linux-build.yml diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml new file mode 100644 index 00000000..be5f1678 --- /dev/null +++ b/.github/workflows/linux-build.yml @@ -0,0 +1,73 @@ +name: Build HavenCore (Linux) + +on: + push: + branches: [ "main", "corruption-system", "feature/**", "pr/**" ] + pull_request: + branches: [ "main" ] + workflow_dispatch: + +# Supersede in-flight runs of the same ref: a full core build is expensive and +# only the tip of a branch is worth the runner time. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + build_type: [RelWithDebInfo] + + env: + # Precompiled headers are on by default (USE_COREPCH/USE_SCRIPTPCH) and + # ccache misses on PCH timestamps without this. Same set as docker/Dockerfile. + CCACHE_SLOPPINESS: pch_defines,time_macros,include_file_mtime,include_file_ctime + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Install Dependencies + # Only the six Boost components dep/boost/CMakeLists.txt asks for -- + # libboost-all-dev is roughly a gigabyte of packages we never link. + # libreadline-dev and zlib1g-dev are hard requirements: dep/readline and + # dep/zlib both abort configure without them. + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + build-essential cmake ninja-build pkg-config ccache \ + libssl-dev libmysqlclient-dev libreadline-dev zlib1g-dev \ + libboost-system-dev libboost-filesystem-dev libboost-thread-dev \ + libboost-program-options-dev libboost-iostreams-dev libboost-regex-dev + + - name: Restore ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: linux-${{ matrix.build_type }} + # One clean RelWithDebInfo build writes ~2G of objects, so anything + # smaller evicts itself before the next run can hit. + max-size: 5G + verbose: 1 + + - name: Configure CMake + # Flags mirror docker/Dockerfile, which is the known-good Linux recipe. + # TOOLS=0 because the extractors need client data no runner has, and + # enabling them drags in bzip2/CascLib for no benefit here. + run: > + cmake -S . -B build -G Ninja + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -DTOOLS=0 + -DSCRIPTS=static + -DCMAKE_C_COMPILER_LAUNCHER=ccache + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + + - name: Build HavenCore + run: cmake --build build --parallel + + - name: ccache statistics + if: always() + run: ccache --show-stats