Skip to content

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

Open
friendly-ripper wants to merge 7 commits into
stack/07-documentationfrom
stack/08-zig-build
Open

friendly-ripper wants to merge 7 commits into
stack/07-documentationfrom
stack/08-zig-build

Conversation

@friendly-ripper

@friendly-ripper friendly-ripper commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Part 8 of 9 · base stack/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.
@friendly-ripper
friendly-ripper added this pull request to stack #9 October 18, 2026 16:31
@friendly-ripper
friendly-ripper force-pushed the stack/08-zig-build branch 2 times, most recently from 1d2b421 to 79ef90f Compare October 18, 2026 23:18
@friendly-ripper
friendly-ripper force-pushed the stack/08-zig-build branch 10 times, most recently from 976252b to 6fed260 Compare October 21, 2026 03:57
@friendly-ripper friendly-ripper changed the title [8/8] Switch builds and packaging to Zig [8/9] Switch builds and packaging to Zig Oct 24, 2026
@friendly-ripper
friendly-ripper force-pushed the stack/08-zig-build branch 2 times, most recently from afabe35 to df291f9 Compare October 28, 2026 18:15
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