From 24e43a913f29ac3b314354e8ce5175f135bcc64f Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Fri, 7 Nov 2025 14:49:13 +0100 Subject: switch to xmake for package management (#611) This change removes our dependency on vcpkg for package management, in favour of bringing some code in-tree in the `thirdparty` folder as well as using the xmake build-in package management feature. For the latter, all the package definitions are maintained in the zen repo itself, in the `repo` folder. It should now also be easier to build the project as it will no longer depend on having the right version of vcpkg installed, which has been a common problem for new people coming in to the codebase. Now you should only need xmake to build. * Bumps xmake requirement on github runners to 2.9.9 to resolve an issue where xmake on Windows invokes cmake with `v144` toolchain which does not exist * BLAKE3 is now in-tree at `thirdparty/blake3` * cpr is now in-tree at `thirdparty/cpr` * cxxopts is now in-tree at `thirdparty/cxxopts` * fmt is now in-tree at `thirdparty/fmt` * robin-map is now in-tree at `thirdparty/robin-map` * ryml is now in-tree at `thirdparty/ryml` * sol2 is now in-tree at `thirdparty/sol2` * spdlog is now in-tree at `thirdparty/spdlog` * utfcpp is now in-tree at `thirdparty/utfcpp` * xmake package repo definitions is in `repo` * implemented support for sanitizers. ASAN is supported on windows, TSAN, UBSAN, MSAN etc are supported on Linux/MacOS though I have not yet tested it extensively on MacOS * the zencore encryption implementation also now supports using mbedTLS which is used on MacOS, though for now we still use openssl on Linux * crashpad * bumps libcurl to 8.11.0 (from 8.8.0) which should address a rare build upload bug --- scripts/bundle.lua | 57 ++++++++++++++---------------------------------------- 1 file changed, 15 insertions(+), 42 deletions(-) (limited to 'scripts/bundle.lua') diff --git a/scripts/bundle.lua b/scripts/bundle.lua index 09f097c82..6e2994742 100644 --- a/scripts/bundle.lua +++ b/scripts/bundle.lua @@ -139,22 +139,6 @@ local function _zip(store_only, zip_path, ...) raise("Unable to find a suitable zip tool") end --------------------------------------------------------------------------------- -local function _find_vcpkg_binary(triple, port, binary) - import("detect.sdks.find_vcpkgdir") - local root_dir = find_vcpkgdir() - if root_dir == nil or root_dir == "" then - raise("Unable to find vcpkg root directory") - end - - bin_path = root_dir.."/installed/"..triple.."/tools/"..port.."/"..binary - if not os.isfile(bin_path) then - raise("Unable to locate vcpkg tool "..bin_path) - end - - return bin_path -end - -------------------------------------------------------------------------------- local function main_windows(signidentity) import("core.base.option") @@ -197,18 +181,13 @@ local function main_windows(signidentity) end end - local crashpad_handler_path = _find_vcpkg_binary( - "x64-windows-static", - "sentry-native", - "crashpad_handler.exe") - _zip(false, zip_path, "build/windows/x64/release/zenserver.exe", "build/windows/x64/release/zenserver.pdb", "build/windows/x64/release/zen.exe", "build/windows/x64/release/zen.pdb", - crashpad_handler_path) + "build/windows/x64/release/crashpad_handler.exe") end -------------------------------------------------------------------------------- @@ -238,6 +217,16 @@ local function main_mac(signidentity) raise("Failed creating universal zen binary") end + ret = _exec( + "lipo", + "-create", + "-output", "build/macosx/universal/release/crashpad_handler", + "build/macosx/x86_64/release/crashpad_handler", + "build/macosx/arm64/release/crashpad_handler") + if ret > 0 then + raise("Failed creating universal crashpad_handler binary") + end + ret = _exec("codesign", "-vvv", "-strict", @@ -260,22 +249,15 @@ local function main_mac(signidentity) raise("Failed signing universal zen binary") end - -- At the time of writing vcpkg does not support sentry-native on arm64. Once - -- it does we can create a univeral binary for this. For now just bundle x64 - local crashpad_handler_path = _find_vcpkg_binary( - "x64-osx", - "sentry-native", - "crashpad_handler") - ret = _exec("codesign", "-vvv", "-strict", "-s", signidentity, "-f", - crashpad_handler_path) + "build/macosx/universal/release/crashpad_handler") if ret > 0 then - raise("Failed signing crashpad binary") + raise("Failed signing universal crashpad_handler binary") end -- Zip @@ -283,27 +265,18 @@ local function main_mac(signidentity) "build/zenserver-macos.zip", "build/macosx/universal/release/zenserver", "build/macosx/universal/release/zen", - crashpad_handler_path) + "build/macosx/universal/release/crashpad_handler") end -------------------------------------------------------------------------------- local function main_linux() _build("x86_64") - -- Crashpad handler does not exist for Linux - local crashpad_handler_path = nil - --[[ - local crashpad_handler_path = _find_vcpkg_binary( - "x64-linux", - "sentry-native", - "crashpad_handler") - --]] - _zip(false, "build/zenserver-linux.zip", "build/linux/x86_64/release/zenserver", "build/linux/x86_64/release/zen", - crashpad_handler_path) + "build/linux/x86_64/release/crashpad_handler") end -------------------------------------------------------------------------------- -- cgit v1.2.3