buildscripts/mongo_rg_builds/README.md
This directory contains scripts to produce portable, high-performance ripgrep binaries for all major platforms:
manylinux2014 glibc 2.17 baseline): x86_64, aarch64, s390x, ppc64lex86_64 + arm64)Each build uses bundled static PCRE2, LTO, and conservative CPU baselines to maximize portability.
All artifacts are placed in the dist/ directory.
| Script | Platform | Output |
|---|---|---|
build_rg_manylinux2014.sh | Linux (x86_64, aarch64, s390x, ppc64le) | dist/rg-manylinux2014-<arch> |
build_rg_macos_universal.sh | macOS (universal2) | dist/rg-macos-universal2 |
build_rg_windows_x64.ps1 | Windows (x86_64) | dist/rg-windows-x86_64.exe |
Requirements: Docker.
To cross-build using QEMU (for aarch64/s390x/ppc64le), enable binfmt once:
docker run --privileged --rm tonistiigi/binfmt --install all
./build_rg_manylinux2014.sh
ARCH=x86_64 PLATFORM=linux/amd64 ./build_rg_manylinux2014.sh
ARCH=aarch64 PLATFORM=linux/arm64 ./build_rg_manylinux2014.sh
ARCH=s390x PLATFORM=linux/s390x ./build_rg_manylinux2014.sh
ARCH=ppc64le PLATFORM=linux/ppc64le ./build_rg_manylinux2014.sh
CPU_BASELINE=x86-64-v2 ./build_rg_manylinux2014.sh
./build_rg_macos_universal.sh
lipo to merge slices.Run in Developer PowerShell for VS (so cl.exe is available):
.\build_rg_windows_x64.ps1
LTO=fat, codegen-units=1, panic=abortPCRE2_SYS_BUNDLED=1, PCRE2_SYS_STATIC=1)x86-64 (override with CPU_BASELINE)genericx86-64 / genericx86-64-C lto in RUSTFLAGS; LTO handled via Cargo profile| Variable | Purpose | Default |
|---|---|---|
RG_REPO | Git repo to clone | https://github.com/BurntSushi/ripgrep.git |
RG_REF | Branch / tag / commit | master |
OUT_DIR | Output directory | ./dist |
ARCH | Linux target arch | uname -m |
PLATFORM | Docker platform | auto |
CPU_BASELINE | CPU baseline (Linux/Windows) | x86-64 |
DEPLOY_X86 | macOS min version (x86_64 slice) | 10.13 |
DEPLOY_ARM | macOS min version (arm64 slice) | 11.0 |
CPU_BASE_X86 / CPU_BASE_ARM | macOS CPU baselines | x86-64 / generic |
These scripts build ripgrep from the official upstream repository
š https://github.com/BurntSushi/ripgrep
Ripgrep is distributed under the terms of the MIT license.
PCRE2 is statically linked under its respective license via pcre2-sys.