Skip to content

[8/10] Switch builds and packaging to Zig - #371

Merged
netniV merged 7 commits into
refactor/07-documentationfrom
refactor/08-zig-build
Nov 14, 2026
Merged

netniV merged 7 commits into
refactor/07-documentationfrom
refactor/08-zig-build

Conversation

@friendly-ripper

Copy link
Copy Markdown
Collaborator

Part 8 of 10 · base refactor/07-documentation · 7 commits

The xmake build carries recipes, locks, and vendored package trees that duplicate what a pinned Zig build can hold in one graph. This PR moves the mod, the platform entry points, the macOS launcher, the tests, and release packaging to Zig 0.16, then removes the xmake setup it replaces.

What changes

  • The core mod builds with Zig: dependency URLs and pins are fixed for Zig 0.16, SDK downloads are verified, and target settings are shared. The IL2CPP, Unity, SPUD, protobuf, logging, and settings sources build as C++23. macOS uses the SDK curl and Windows uses Schannel, so no OpenSSL build is added.
  • The Swift launcher, librsync bridge, and app resources build with Zig. Native archives are repacked with Apple libtool for Swift linking, ARM64 and Intel outputs merge into universal binaries, updates extract with the system tar instead of the PLzma dependency, and Windows DLL provenance is verified before packaging.
  • The TOML parser builds once as a compiled library instead of being instantiated in every consumer, and settings and shortcut headers use forward declarations so parser internals stay private. Abseil is limited to the protobuf-lite source closure.
  • Compile time is cut where the old build repeated work. Logging and HTTP sources compile together. Protobuf generation selects only the sync entry points and their transitive field types. Generated image headers use escaped string chunks instead of millions of byte initializers.
  • Swift compiles as one module independently of native archive linkage. Recursive JSON key ordering moves into one translation unit, and macOS release features compile four to a unit.
  • CI builds release artifacts and Debug fixtures in the same Zig graph. The xmake targets, recipes, locks, and formatting helpers that Zig replaced are removed, and the build docs cover platform commands, output paths, SDK provisioning, packaging, and contributor checks.

Testing

Every commit passes zig build test-il2cpp test-mod test-sync on Zig 0.16, cross-builds the Windows mods with -Dtarget=x86_64-windows-msvc, and builds the macOS mods with -Dtarget=aarch64-macos.14.6. Nothing was run in the game.

tashcan added 7 commits October 15, 2026 16:40
Dependency URLs and pins are fixed for Zig 0.16, with
verified SDK downloads and shared target settings. The xmake
build stays available while the migration is prepared.

The IL2CPP, Unity, SPUD, protobuf, logging and settings sources
build as C++23. macOS uses the SDK curl and Windows uses
Schannel, so no OpenSSL build is added.
The Swift launcher, librsync bridge and app resources build
with Zig, and native archives are repacked with Apple libtool
for Swift linking. Updates extract with the system tar instead
of the PLzma dependency.

ARM64 and Intel outputs merge into universal binaries, and
Windows DLL provenance is verified before packaging.
The TOML parser was instantiated in every consumer. It now
builds once as a compiled library, and settings and shortcut
headers use forward declarations so parser internals stay
private.

Abseil is limited to the protobuf-lite source closure. Unused
components leave the static runtime manifest, while the
synchronization, strings and hashing objects stay.
Logging and HTTP sources compile together to avoid repeated
dependency-header parsing. Platforms whose CRT headers depend
on include order keep separate translation units.

Protobuf generation selects only the sync entry points and
their transitive field types. Schemas, enum catalogs, wire
numbers and retained descriptors are preserved.
Generated image headers held millions of byte initializer
expressions. They now use escaped string chunks, preserving the
embedded bytes and sizes while cutting Clang parse time.

Independent static libraries compile before their dependents
finish, and Debug fixtures share release dependencies under a
separate test optimization option.
Swift compiles as one module independently of native archive
linkage, so native libraries no longer gate the Swift build.

Recursive JSON key ordering moves into one translation unit,
and macOS release features compile four to a unit to share
game-header parsing. Debug and Windows keep single units.
CI builds release artifacts and Debug fixtures in the same Zig
graph. The xmake targets, recipes, locks and formatting helpers
that Zig replaced are removed.

Build docs cover platform commands, output paths, SDK
provisioning, packaging and contributor checks.
@netniV
netniV added this pull request to the merge queue Nov 14, 2026
Merged via the queue into dev with commit 41e03ee Nov 14, 2026
7 checks passed
@netniV
netniV deleted the refactor/08-zig-build branch November 14, 2026 00:06
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