linux #5

Merged
Kebful merged 41 commits from linux into master 2026-09-13 19:36:31 +00:00
Owner
No description provided.
Advance the TrinityCore submodule to the focused CMake 4 JSON configuration fix.

Validation: complete TrinityCore build passed with Clang 22 and CMake 4.4.
Advance TrinityCore to Lua 5.4.9 and apply the same bundled-header selection to generated TrinityCore livescript builds. This prevents sol2 from picking an incompatible system lua.hpp.

Validation: full Linux build, runtime TypeScript check, and exported-header compile check asserting Lua 5.4.9 passed.
Pass the requested build type to CMake on Linux. Debug and Release previously fell back to the core default when the cache was empty; ordinary RelWithDebInfo builds retain their existing mode.

Validation: generated commands and fresh configurations checked for all three modes; full RelWithDebInfo build passed and installed debug sections verified.
Use FetchContent_MakeAvailable with a dependency-scoped legacy policy floor and preserve EXCLUDE_FROM_ALL on the StormLib directory. Keep the dependency pin and warning settings unchanged.

Validation: fresh Clang/CMake 4 build and actual TSWoW MPQBuilder build/install passed.
Define Z_HAVE_UNISTD_H for UNIX builds so bundled zlib includes declarations for read, write, close and lseek. Leave Windows and compiler warning settings unchanged.

Validation: fresh Clang 22 and GCC 16 builds, actual TSWoW build/install, and sequential PNG-to-BLP-to-PNG smoke test passed.
Approve the inspected deasync 0.1.30 lifecycle script and deny the optional core-js postinstall banner. Carry the project policy into generated release package.json without changing global npm configuration.

Validation: native deasync event-loop tests passed in source, build and release with Node 26/npm 12; full TSWoW build and compile TypeScript check passed.
Run the existing ADT Creator target on Linux, configure it using explicit source/build paths, and install its native executable. Reference the locally validated helper fix. Higher-level MapADT generation remains unchanged.

Validation: npm run build:adtcreator, compile TypeScript check, and one-tile executable smoke test passed.

LOCAL ONLY: the referenced ADT Creator commit is not published. Publish it to an appropriate fork and configure the submodule URL before pushing this parent commit.
Resolve the TrinityCore submodule reference to published merge 14797f802e, which contains both the Linux compatibility fixes and the incoming tswow core changes. Preserve the automatically merged source changes.

Validation: both conflicting core revisions are ancestors of the selected commit; the selected commit is published on origin/linux; no unmerged index entries or whitespace errors remain. Full compilation of the combined changes has not been rerun.
Same treatment the Linux TrinityCore branch just got, applied to the two
small helper builds:

- Honour TSWOW_CC / TSWOW_CXX with a gcc default.
- Run make -j $(nproc) instead of plain make.
- Pass CMAKE_POLICY_VERSION_MINIMUM=3.5 to cmake; both helpers vendor
  StormLib and a couple of other small subprojects whose top-level
  cmake_minimum_required is too old for cmake 4 to accept.

(cherry picked from commit 603c54cbbe80c70ead11ab1c12943667b582896a)
(cherry picked from commit 6deb40fe6e37098162b257fb729f3700d1109f5f)
Builds on the modern-toolchain work in this branch to close the gap between
"it compiles on Linux" and the tswow promise of "clone, run the build, walk
away, come back to a running server".

Build entry (build.js):
- Check the system packages we need before running npm i (which compiles
  native modules and needs a C toolchain + python). If something's missing we
  print the exact install line for the user's distro - pacman/apt/dnf/zypper -
  instead of dying with a node-gyp error nobody can read. An opt-in
  --install-deps runs it. Nothing is installed without the user asking.
- If the TrinityCore submodule is missing, say "git submodule update --init
  --recursive" instead of a confusing cmake failure later.
- The bootstrap failure path used to exit 0 (looked like success); it now
  exits non-zero and lists the usual causes.

Database (MySQL.ts, NodeConfig.ts):
- Manage a local MariaDB on Linux the same way Windows manages its bundled
  MySQL: init the data dir, start it on a private socket/pid, create the tswow
  user (on both localhost and 127.0.0.1). Before this, Linux just assumed an
  external server was already up and configured, which isn't the walk-away
  experience.
- Default the DB host to 127.0.0.1 so the emulator connects over TCP. With
  localhost the C++ client goes looking for a unix socket at the default path
  and can't find ours.

Client data + runtime (Dataset.ts, Client.ts, Realm.ts, luaxmlreader.cpp):
- Handle case-sensitive filesystems: find Wow.exe regardless of case, and
  temporarily symlink the uppercase .MPQ names the extraction tools want, then
  remove them so the game client doesn't choke on duplicate archives.
- Keep the more thorough hasContent() checks for what's already extracted, but
  wrap the extraction so a client problem logs and continues instead of taking
  down the database and hanging the whole process.
- luaxmlreader skips a missing optional patch archive instead of aborting.

Misc:
- Use the system 7-Zip to unpack the world database (the bundled 7za is
  Windows-only; the old Linux path called p7zip which isn't a package on Arch).
- Replace fs.rmdir({recursive}) with fs.rm - Node 26 removed the old form and
  it was silently hanging the build.
- Don't crash the build when there's no .git (zip/tarball downloads).
- Small dedup: wsys.hasCommand/resolveExe helpers shared by the MySQL and
  7-Zip code.

Tested from a clean Arch VM (nothing but node/npm/git): npm run build
--install-deps installs the rest, compiles TrinityCore, pulls and unpacks the
TDB, and finishes with "Installation successful". Then the runtime brings up
MariaDB on its own, extracts dbc/maps/vmaps from a real client (135 maps
loaded), and both authserver and worldserver come up. Also verified on the
host that a client connects and a character logs into the world.

(cherry picked from commit 561d7308ee66f9d800b675ca384685ef4c244ed1)

Duskhaven integration: preserve ../build and ../release, Clang/build-type settings, the published core, locale-aware client patches, and existing database ownership/update behavior. Use a separate Wine prefix per dataset, inherit DLL overrides, and preserve archive directory structure. Database self-healing and extraction-error suppression are not adopted.

Validation so far: runtime and compile TypeScript checks passed. Windows command-path regression checks and Wine launch validation follow; upstream runtime success claims above describe the original author's environment.
PR 938's root-only asset allocator could select the development patch path before it existed. Preserve the same exclusion as the locale-aware allocator so asset symlinks cannot occupy the development output. Validated both Windows patch modes and the Linux root allocator.
Launch through a preserved per-dataset drive mapping so Btrfs mount ancestors do not trip streaming storage validation. Keep Windows launch behavior and internal update-path checks unchanged. Document manifest-free development clients and Windows runtime builds under Wine.
Reuse existing patch filename casing when locating development patches and allocating module slots. Report ambiguous duplicate names instead of silently selecting one.
Choose an explicit unsigned type for 32-bit flag enums that exceed signed int range. Use a wider signed type for mixed ranges, and keep ordinary enums unchanged. Apply the same type to forward declarations and definitions.
Exclude CMake and generated C++ folders while retaining inline TypeScript. Stop after configure or compile failures instead of attempting to copy a missing or stale library.
Allow Ninja cross builds, use embedded debug information, and run the Lua generator through CMake's configured emulator. Preserve native Visual Studio behavior.
Replace the old DLL download with a local MSVC/Wine build. Set up the compiler on first use and build both architectures before validating and installing the five-file runtime bundle. Support build client-extensions in the interactive console and document Linux setup.

Verified the interactive command, both native project builds, Windows command regression checks, and a Wine client launch past the custom DBC loading error.
Match new char[] with delete[] when growing packet chunks. Scalar deletion can pass a size of one to jemalloc and corrupt subsequent allocations. The allocation mismatch is reproduced with AddressSanitizer; the corrected growth test passes.
Transfer chunk allocations during vector growth and release every owned receive fragment. Count the packet header once to prevent reading beyond incoming buffers and corrupting fragment boundaries.

Add regression coverage for fragment boundaries, 64 KiB payloads, delayed callbacks, malformed fragments, and repeated cleanup. Validated with native Linux tests, AddressSanitizer and LeakSanitizer, and 32-bit MSVC tests under Wine. Native Windows gameplay testing remains outstanding.
Reset the read position without clearing the packet size. Clear and Destroy still empty the packet. Reset after generic C++ callbacks as well as Lua and opcode callbacks, while preserving the read position on entry to dispatch.

Add regression tests using the production server dispatcher for in-world and not-in-world callbacks, fragmented packets, and reads before deferred dispatch. Linux AddressSanitizer/UndefinedBehaviorSanitizer tests and 32-bit MSVC tests under Wine pass. Native Windows gameplay has not been tested.
fix(client): allow streaming updates to recover incompatible CDBC tables
Some checks failed
Sync to GitHub / sync-to-github (push) Failing after 53s
98a4f9d994
Defer loading outdated table layouts instead of crashing before updates
can finish.
Kebful merged commit 98a4f9d994 into master 2026-09-13 19:36:31 +00:00
Kebful deleted branch linux 2026-09-13 19:36:32 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Duskhaven/dusk-tswow!5
No description provided.