diff options
| author | Stefan Boberg <[email protected]> | 2025-11-07 14:49:13 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-11-07 14:49:13 +0100 |
| commit | 24e43a913f29ac3b314354e8ce5175f135bcc64f (patch) | |
| tree | ca442937ceeb63461012b33a4576e9835099f106 /README.md | |
| parent | get oplog attachments (#622) (diff) | |
| download | zen-24e43a913f29ac3b314354e8ce5175f135bcc64f.tar.xz zen-24e43a913f29ac3b314354e8ce5175f135bcc64f.zip | |
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
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 99 |
1 files changed, 6 insertions, 93 deletions
@@ -20,7 +20,7 @@ frequency sampling profiler such as Superluminal Performance. ### Windows Setup -To build the code you will need Visual Studio 2022 (we use c++20 features), git and vcpkg. +To build the code you will need Visual Studio 2022 (we use c++20 features), and git. * Install Visual Studio 2022 * `winget install Microsoft.VisualStudio.2022.Professional --silent --override "--wait --quiet --add ProductLang En-us --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended"` @@ -29,21 +29,6 @@ To build the code you will need Visual Studio 2022 (we use c++20 features), git * You may want to install the github CLI to manage credentials etc - `winget install github.cli` * Install [xmake](https://xmake.io/#/getting_started) * You can also use `winget install xmake` if you have winget installed -* Install vcpkg (see below) - -#### Installing vcpkg - -Some of Zen's third party dependencies are provided by Microsoft's `vcpkg` -C++ library manager. The Zen codebase currently requires vcpkg to use the 2024.06.15 release so make sure to clone/check out that version. -After cloning the project there is an initialisation step. - -* open up a command line window - * create a `git`/`github` directory somewhere for you to clone repos into - * issue `git clone --depth 1 --branch 2024.06.15 https://github.com/microsoft/vcpkg.git` and build it using the `bootstrap-vcpkg.bat` script -* optional: add the `vcpkg` directory you cloned to your PATH to allow invoking vcpkg on the command line -* issue `vcpkg integrate install` to make sure xmake and Visual Studio can locate the vcpkg install - -Now you are ready to start building! ### Building with Visual Studio @@ -54,21 +39,8 @@ from a Command Prompt window or a Terminal instance * clone the `zen` repository if you haven't already. This requires a valid github login and you need to be part of the EpicGames organization * run `git clone https://github.com/EpicGames/zen.git` or `gh repo clone EpicGames/zen` (you may want - to use `gh` to log in to github as well) + to use `gh auth login` to log in to github as well) * run `xmake sln` or `xmake project -k vsxmake2022 -a x64 -y` to generate a Visual Studio solution file -* upgrade vcpkg and third party libraries to version `2024.06.15` if necessary due to changes in library versions - * Update vcpkg - * pushd ..\vcpkg - * git fetch - * git clean -xdff - * git checkout 2024.06.15 - * bootstrap-vcpkg.bat - * popd - * Upgrade the thirdparty libraries managed for the solution by vcpkg - * ..\vcpkg\vcpkg.exe upgrade - * ..\vcpkg\vcpkg.exe upgrade --no-dry-run - * If thirdparty libraries updated, wipe the build state and regenerate the solution - * rmdir /s .xmake build * open the `vsxmake2022\zen.sln` VS solution (`start vsxmake2022\zen.sln`) * Note: if you want full connectivity with the http.sys server implementation you currently need to run Visual Studio in ADMIN mode since http.sys requires elevation to be able to listen on a non-local network socket. @@ -76,9 +48,6 @@ from a Command Prompt window or a Terminal instance you can add an URL reservation (see below) * you can now build and run `zenserver` as usual from Visual Studio. Note that the test suite is compiled into the Debug configuration only at this time, to keep Release lean - * third-party dependencies will be built the first time via the `vcpkg` integration. This is not as - fast as it could be (it does not go wide) but should only happen on the first build and will leverage - a local build cache ### Building with xmake on the command line @@ -102,12 +71,9 @@ commit. The following instructions have been collated using Ubuntu 20.04. -Zen makes heavy use of C++20 features which at the time of writing has limited +Zen makes use of C++20 features which at the time of writing has limited toolchain and C++ library support. A minimum compiler version of GCC-11 or -Clang-12 is required, along with GNU's libstdc+++-11 or newer. Note that it is -not currently possible to use anything other than the system's default C++ -library (e.g. LLVM's libc++) due to the way that Zen's third party dependencies -are managed via `vcpkg`. +Clang-12 is required, along with GNU's libstdc+++-11 or newer. The first step is to acquire a suitable compiler and C++ library. On Ubuntu 20.04 GCC-11 is not available in the standard package repositories so Ubuntu's tool- @@ -140,29 +106,6 @@ curl -fsSL https://xmake.io/shget.text | bash xmake --version ``` -To build some of the packages from vcpkg you may need some additional tools. - -``` -sudo apt-get install build-essential zip pkg-config -``` - -Some of Zen's third party dependencies are provided by Microsoft's `vcpkg` -C++ library manager. The Zen codebase currently requires vcpkg to use the 2024.06.15 release so make sure to clone/check out that version. -After cloning the project there is an initialisation step. - -``` -git clone --depth 1 --branch 2024.06.15 https://github.com/microsoft/vcpkg.git ~/zen/vcpkg -~/zen/vcpkg/bootstrap-vcpkg.sh -~/zen/vcpkg/vcpkg --version -``` - -`xmake` uses an environment variable to find `vcpkg`. Alternatively this can be -done by including `VCPKG_ROOT=...` on the command line when invoking `xmake`. - -``` -export VCPKG_ROOT=~/zen/vcpkg -``` - Clone the Zen project and tell `xmake` to use the correct GCC version. ``` @@ -171,7 +114,7 @@ cd ~/zen/main ``` Now we are ready to build Zen. The `-y` skips `xmake` from prompting about -updating `vcpkg` packages. +building packages. ``` xmake config -y --mode=debug @@ -182,41 +125,12 @@ Note that the command above to set the build variant to debug is optional. Tests are only built in debug.The `xmake` flags `-vD` can be useful to diagnose `xmake` issues. -### Linux distribution compatibility - -Builds for Linux have a dependency on a modern version of the C++ library that -supports Zen's use of C++20 and the GCC-11 toolchain used (assuming the above -build instructions are adhered to). However there is no guarantee that the this -dependency is met when building on one Linux install and running on another. For -example, at the time of writing the LTS version of Ubuntu and Debian do not have -GCC-11's version of libstdc++.so.6 available in their package repositories. - -To solve this, `xmake bundle` will bundle the required C++ .so and zenserver -binary together using AppImage. This can briefly be summarised as create a -squashfs file system containing zenserver and any C++ shared objects list with -`lld`. This file system is then concatenated with AppImage's runtime. This is -implemented in `scripts/bundle_linux.sh`. More details can be found here; - -https://github.com/AppImage/AppImageKit - ## Building on Mac -Building on Mac is very similar to Linux; install xmake, clone vcpkg and Zen and +Building on Mac is very similar to Linux; install xmake, clone Zen and then build the project. You will also need to install Xcode or Xcode command line tools. -### vcpkg - -Some of Zen's third party dependencies are provided by Microsoft's `vcpkg` -C++ library manager. The Zen codebase currently requires vcpkg to use the 2024.06.15 release so make sure to clone/check out that version. -After cloning the project there is an initialisation step. - -``` -git clone --depth 1 --branch 2024.06.15 https://github.com/microsoft/vcpkg.git ~/zen/vcpkg -~/zen/vcpkg/bootstrap-vcpkg.sh -~/zen/vcpkg/vcpkg --version -``` - ### [xmake](https://xmake.io/#/getting_started) ``` curl -fsSL https://xmake.io/shget.text | bash @@ -231,7 +145,6 @@ cd ~/zen/main ### Build ``` -export VCPKG_ROOT=~/zen/vcpkg xmake config -y --mode=debug xmake build ``` |