Skip to content

Navigation Menu

Sign in
Appearance settings
Sign up
Appearance settings

Fixed CI build and added support for Civ5 build 4390913 - #98

#98
Open
VeryHarry7 wants to merge 5 commits into
Lymia:masterLymia/MPPatch:masterfrom
VeryHarry7:pr/fix-build-systemVeryHarry7/MPPatch:pr/fix-build-systemCopy head branch name to clipboard
Open

Fixed CI build and added support for Civ5 build 4390913#98
VeryHarry7 wants to merge 5 commits into
Lymia:masterLymia/MPPatch:masterfrom
VeryHarry7:pr/fix-build-systemVeryHarry7/MPPatch:pr/fix-build-systemCopy head branch name to clipboard

Conversation

@VeryHarry7

Copy link
Copy Markdown

This PR fixes several build issues and adds support for the latest Steam version of Civilization V. Have been unable to test fully in multiplayer, but the patch now shows as active in game, and the multiplayer menu appears in game as well.

Changes

  • New version support: Add hash for Civ5 build 4390913 (latest Steam release)
  • Rust compatibility: Pin to nightly-2024-11-01, fix naked_asm syntax, pin time crate
  • CI reliability: Add pacman retry logic, add sbt to native-image jobs, fix Windows tarball extraction
  • sbt task resolution: Use Def.taskDyn properly to avoid building natives when pre-built binaries exist
  • Runtime fix: Load version info from binary layer instead of include (Civ5's include path doesn't work for
    hook-injected files)

The latest Steam release of Civilization V has a new DLL hash.
This adds version detection for build 4390913.
- Pin time crate version for simplelog compatibility
- Update naked_asm syntax for newer Rust nightly
- Add retry logic for pacman package installation
- Pin Rust toolchain to nightly-2024-11-01
- Add sbt installation to native-image build jobs
- Fix Windows tarball extraction path
Use Def.taskDyn to conditionally choose between pre-built natives
and building from source. This prevents sbt from trying to build
natives when pre-built binaries exist in target/native-bin/.

The key insight is that sbt extracts ALL .value calls at compile
time regardless of if/else branches. By using Def.taskDyn with
the check outside the returned Def.task, we properly isolate the
dependency on buildDylibDir to only when actually needed.
Get version info from binary layer directly instead of using
include for mppatch_version.lua. Civ5's include path resolution
doesn't work for hook-injected files.
femtendo added a commit to femtendo/MPPatch-Fem-sFix that referenced this pull request Aug 27, 2026
Integrate functional changes from upstream PR Lymia#98 by hand (no wholesale merge):

- versions.rs: add VersionInfo entry for Civ5 DLL hash
  d9231d313fb24fe88c6020d250a44b6ad754b78922325473a03a6e6c002911c4
  (Win32 + Steam, Build 4390913) with PR98's exact SetActiveDLCAndMods
  offsets. Existing old-build (f956...) and Linux entries left untouched.
- civ5_win32_steam.json: add d9231 to supportedHashes.
- mppatch_runtime.lua: load version info from binary layer (patch.version)
  instead of the removed mppatch_version.lua include (PR98 de2279d).
- Cargo.toml: pin time crate to 0.3.35 (0.3.55 requires rustc 1.88, our
  toolchain is nightly-2025-02-01/1.86). Needed for build success on both
  native macOS and win32 cross targets.
- hook_proxy.rs/lib.rs: use #[naked] + naked_functions feature (the
  #[unsafe(naked)] syntax needs a newer nightly than 1.86).
  Removed redundant stable c_unwind feature attribute.

Verified: cargo build --release (native, exit 0); win32 cross build
i686-pc-windows-gnu with mingw linker + unwind shim + panic=unwind (exit 0)
produces a PE32 DLL.
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.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.