The Quick Start is in the top-level README. This document is the detailed build reference: the procedure annotated with what each step does, plus prereqs, dependency modes, profiles, Docker, formatting, and CI.
| Platform | Status | Notes |
|---|---|---|
| Ubuntu 22.04 (Jammy) | Tested in CI | Primary dev/CI platform |
| Debian 12 (Bookworm) | Tested (Docker build) | Docker image base |
| Ubuntu/Debian derivatives (Mint, Pop!_OS, ...) | Supported | Detected via ID_LIKE, mapped to the Ubuntu/Debian base artifacts; override with MOQX_PLATFORM if detection is wrong |
| Fedora / RHEL | TBD | install-system-deps.sh has dnf support; not yet CI-tested |
| macOS (Homebrew) | TBD | install-system-deps.sh has brew support; not yet CI-tested |
Six steps. Each links to its detail section.
- Clone and init the moxygen submodule.
git clone … && cd moqx && git submodule update --init --recursive— the submodule pins the exact moxygen commit the build will use (see Dependency Modes). - Ensure CMake 3.22+ is on
PATH. All current targets ship a new-enough version: Ubuntu 22.04+, Debian 12+, recent macOS Homebrew.build.shaborts early if cmake is missing or too old. - Install system libraries. Required in both dependency modes —
see the system-libraries bullet in Prerequisites
for why. One-liner:
sudo deps/moxygen/standalone/install-system-deps.sh. - Stage moxygen.
./scripts/build.sh setup— defaults to--from-release(downloads the prebuilt tarball, ~1 min); falls back to source build if unavailable. See Dependency Modes for--from-source,--moxygen-dir, SHA pinning, etc. - Build moqx.
./scripts/build.sh— configures and builds. See Build Profiles fordefaultvssan. - Run tests.
./scripts/build.sh test— 77 tests, sub-second.
If you'd rather build in a clean container, skip to Building from a Fresh Ubuntu Docker.
- CMake 3.22+ — required by moqx top-level
CMakeLists.txt. All current targets ship a new-enough version out of the box: Ubuntu 22.04+, Debian 12+, recent macOS Homebrew.build.shenforces this and aborts early if cmake is missing or too old (override withMOQX_SKIP_CMAKE_CHECK=1). - Ninja, C++20 compiler (GCC 11+ / Clang 14+).
curlfor downloading the moxygen release tarball (setup-deps-tarball.sh). NoghCLI is required. SetGITHUB_TOKEN/GH_TOKENonly if you hit api.github.com's unauthenticated rate limit.- System libraries — required in both dependency modes:
libssl, libfmt, libglog, libgflags, libdouble-conversion, libevent,
libsodium, libzstd, libboost, c-ares, libunwind, zlib, gperf. The
release tarball ships folly/fizz/wangle/mvfst/proxygen statically, but
moxygen's CMake config does
find_dependency(fmt, Glog, ...)and folly itself transitively wants OpenSSL/Boost. Install all with:(sudo deps/moxygen/standalone/install-system-deps.sh
build.sh setup's system-dep check only fires when falling back to a source build — it does not preempt the build-step failure if libs are missing.)
moqx requires CMake 3.22+. All current targets ship a new-enough version out of the box:
Ubuntu 22.04+ / Debian 12+:
sudo apt-get install -y cmake
cmake --version # should show 3.22+macOS (Homebrew):
brew install cmake # or `brew upgrade cmake` if already present
cmake --versionsudo deps/moxygen/standalone/install-system-deps.shThis is handy for verifying the build on a clean system or for contributors who don't want to install deps on their host:
docker run --rm -it -v "$PWD":/src -w /src ubuntu:22.04 bash
# Inside the container:
apt-get update && apt-get install -y cmake ninja-build sudo git curl ca-certificates
git submodule update --init --recursive
sudo deps/moxygen/standalone/install-system-deps.sh
./scripts/build.sh setup --from-source # build from source (no release artifacts available offline)
./scripts/build.sh
./scripts/build.sh testmoqx depends on moxygen (and its Meta deps: folly, fizz, wangle, mvfst, proxygen).
The deps/moxygen submodule pins the exact version. Two ways to get these deps:
| Mode | Command | Time | When to use |
|---|---|---|---|
| from-release | build.sh setup |
~1 min | Default -- downloads CI-built artifacts |
| from-source | build.sh setup --from-source |
15-30 min | Full control, or when artifacts unavailable |
Both accept an optional commit SHA to override the submodule pointer:
build.sh setup --from-release abc1234 # artifacts for specific moxygen commit
build.sh setup --from-source abc1234 # build specific commit from sourceTo build against a local moxygen checkout (for iterating on moxygen itself):
build.sh setup --from-source --moxygen-dir ~/src/moxygenDefault (no SHA or dir) uses the current submodule HEAD.
Falls back from release to source if artifacts aren't available.
Use --no-fallback to fail instead. Use --clean to wipe .scratch/ first.
build.sh setup [--from-release [SHA]|--from-source [SHA]] [--moxygen-dir DIR] [--no-fallback] [--clean]
build.sh [--profile default|san] [--build-dir DIR]
build.sh test [--build-dir DIR] [-- CTEST_ARGS...]
| Profile | Build dir | Description |
|---|---|---|
default |
build/ |
RelWithDebInfo |
san |
build-san/ |
Debug + ASAN/UBSAN |
CI requires clang-format-19. Check before pushing:
./scripts/format.sh --check # verify (dry-run)
./scripts/format.sh # fix in-place
./scripts/lint.sh build # clang-tidy (requires prior build)- Create a branch, push changes
- CI runs: format check + build/test (default + ASAN)
- All checks must pass before merge
- Squash-and-merge preferred for single-feature PRs
See design/ci-architecture.md for the full CI pipeline: upstream sync, submodule updates, build/publish/release, and auto-deploy.
CLion can build moqx directly via its CMake integration. You still need the
same prerequisites as the command-line build (CMake 3.22+, system libraries,
and a staged moxygen install). The steps below wire CLion to the local
dependency tree under .scratch/.
Before CLion can configure the project, moxygen must be present at
.scratch/moxygen-install. Run:
./scripts/build.sh setup --from-sourceThis installs moxygen and its Meta dependencies into .scratch/moxygen-install.
It takes 15–30 minutes on a first run.
You only need to re-run this when dependencies change — for example, after
updating the deps/moxygen submodule or when .scratch/ has been cleaned.
Day-to-day moqx source edits do not require re-running setup.
Open the moqx project root in CLion, then go to Settings → Build, Execution, Deployment → CMake and edit the Debug profile. Add these CMake options:
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_PREFIX_PATH=$CMakeProjectDir$/.scratch/moxygen-install -DGFLAGS_SHARED=ON
$CMakeProjectDir$ is a CLion macro that expands to the project root, so
CMake can find the staged moxygen package config.
If you configure before running setup, CMake will fail because
.scratch/moxygen-install does not exist yet — that is expected.
After setup completes, reload the CMake project in CLion (Tools → CMake → Reload CMake Project, or the reload button in the CMake tool window). Configuration should succeed and you can build and run targets from the IDE as usual.