This repository automates building and packaging static RocksDB distributions with their compression codecs for every platform consumed by marykdb's rocksdb-multiplatform. The build.sh orchestrator drives platform-specific scripts to produce archives for Linux, Windows (MinGW), macOS, iOS, watchOS, tvOS, and Android from a single checkout.
build.shresolves the active host platform, accepts an optional Kotlin/Native version, and selects the configurations to compile (defaults are picked per host when no explicit list is provided).- Kotlin/Native toolchains are installed on demand for cross-compilation targets before each build step runs.
- The RocksDB headers from the
rocksdbsubmodule are copied intobuild/includeso that every archive ships a consistent header set. buildDependencies.shfetches, verifies, and builds staticzlib,bzip2,zstd,snappy, andlz4libraries for the requested target intobuild/lib/<target>/.- The relevant platform script (
buildRocksdbLinux.sh,buildRocksdbMinGW.sh,buildRocksdbApple.sh, orbuildRocksdbAndroid.sh) compiles RocksDB itself for the configuration that is being processed. - Headers and static libraries are collected into
build/archives/<artifact>.zip, yielding aninclude/directory with RocksDB headers and alib/directory withlibrocksdb.aalongside the codec libraries built in step 4.
The table below lists every archive produced by the build orchestration along with the intended platform, architecture, and host requirement. All archives share the layout described above (headers under include/, static libraries under lib/).
| Archive | Platform | CPU architecture | Host required to build |
|---|---|---|---|
rocksdb-linux-x86_64.zip |
Linux | x86_64 | Linux |
rocksdb-linux-arm64.zip |
Linux | arm64 | Linux |
rocksdb-mingw-x86_64.zip |
Windows via MinGW | x86_64 | Linux |
rocksdb-mingw-arm64.zip |
Windows via MinGW | arm64 | Linux |
rocksdb-macos-x86_64.zip |
macOS | x86_64 | macOS |
rocksdb-macos-arm64.zip |
macOS | arm64 | macOS |
rocksdb-ios-arm64.zip |
iOS devices | arm64 | macOS |
rocksdb-ios-simulator-arm64.zip |
iOS Simulator | arm64 | macOS |
rocksdb-watchos-arm64.zip |
watchOS devices | arm64_32 | macOS |
rocksdb-watchos-device-arm64.zip |
watchOS devices | arm64 | macOS |
rocksdb-watchos-simulator-arm64.zip |
watchOS Simulator | arm64 | macOS |
rocksdb-tvos-arm64.zip |
tvOS devices | arm64 | macOS |
rocksdb-tvos-simulator-arm64.zip |
tvOS Simulator | arm64 | macOS |
rocksdb-android-arm32.zip |
Android | arm32 (armeabi-v7a) | Linux or macOS |
rocksdb-android-arm64.zip |
Android | arm64 | Linux or macOS |
rocksdb-android-x86.zip |
Android | x86 | Linux or macOS |
rocksdb-android-x64.zip |
Android | x86_64 | Linux or macOS |
The archives are staged under build/archives/ during a build and can be published from there when the build completes.
- Apple device and simulator archives only cover 64-bit hardware (arm64 for devices, arm64-based simulators, and x86_64 for macOS). Legacy 32-bit targets such as armv7 or i386 are intentionally not produced because those platforms have been deprecated for years by Apple.
- Similarly, simulator builds for iOS, watchOS, and tvOS are arm64-only—aside from the macOS x86_64 build, there are no simulator x86_64 variants because developers are expected to be on Apple Silicon hardware five years after its introduction.
- The
watchos-arm64archive labelled above uses thearm64_32ABI (64-bit registers with 32-bit pointers) because that remains the deployment baseline for physical watches.
- Continuous integration provisions
llvm-mingw-20241030-ucrt-x86_64, the first long-lived toolchain built from LLVM 19../buildRocksdbMinGW.shandbuildDependencies.shautomatically pick it up whenLLVM_MINGW_ROOTpoints at the extracted directory. - Kotlin/Native still links MinGW targets with GCC 9.2's libstdc++ runtime, so the workflow also downloads the matching WinLibs sysroot to keep ABI compatibility when consuming the prebuilt archives.
- List available build configurations:
./build.sh --list
- Build the default set for your current host (for example, Linux will build the Linux and MinGW variants):
./build.sh
- Build a specific archive while overriding the Kotlin/Native version used for toolchain provisioning:
The
./build.sh --konan-version 2.0.21 iosArm64
--konan-versionflag applies to every configuration in the invocation.
Before starting a build, ensure the RocksDB submodule is initialized:
git submodule update --init --recursiveThis is required because the orchestrator copies headers directly from rocksdb/include.
- Windows linker diagnostics explains the
comdat section ... without leader and unassociatedmessages thatlld-linkmay print when the Kotlin/Native toolchain links against the prebuilt MinGW archives.