This document describes how to build Scylla's executables, tests, and packages.
Please note that these instructions use dbuild -- a Docker-based development environment -- to build Scylla.
However, dbuild is optional and you can also build on your host machine by running the same commands without the dbuild prefix.
To build everything, run:
git clone https://github.com/scylladb/scylla
cd ./scylla
git submodule update --init --force --recursive
./tools/toolchain/dbuild ./configure.py --mode=<mode>
./tools/toolchain/dbuild ninjawhere mode is dev for development builds, release for release builds, and debug for debug builds.
Alternatively, you can also pass the mode directly to the ninja command:
git submodule update --init --force --recursive
./tools/toolchain/dbuild ./configure.py
./tools/toolchain/dbuild ninja <mode>After the build completes, you can find build artifacts in build/<mode> directory.
You can run unit tests with:
./tools/toolchain/dbuild ninja testor launch a Scylla server locally with:
./tools/toolchain/dbuild ./build/dev/scylla --workdir tmp --smp 1 --memory 1GFor more help with build targets, run:
./tools/toolchain/dbuild ninja helpThat's it!
The configure.py script, which is run as the first step of a build, generates a build.ninja build file (similar to a Makefile) for the Ninja build tool that we use for building.
To configure the build system for a specific build mode, run:
./tools/toolchain/dbuild ./configure.py --mode=<mode>The mode flag determines build flags for the scylla executable:
releaseis the release build that targets fast execution time (slow build, fast execution).devis the development build that targets fast build times (fast build, reasonable execution)debugis the debug build that targets error discovery (slow build, slow execution).
If you don't specify a build mode, the build.ninja will contain configuration for all build modes.
To build Scylla executables and tests, run:
./tools/toolchain/dbuild ninja buildThis will build Scylla for the build mode specified by the configure.py command.
Alternatively, if you did not specify a build mode in the configure.py step, you can build executables and tests for a specific build mode with:
./tools/toolchain/dbuild ninja <mode>-buildTo run unit tests, run:
./tools/toolchain/dbuild ninja testAlternatively, to run unit tests for a specific build mode, run:
./tools/toolchain/dbuild ninja <dev>-testThe build system generates relocatable packages, which means that the packages contain all the dependencies they need, and you can, therefore, install and run the same binaries on all Linux distributions.
The relocatable package tarball is used as a base for building the Linux distribution specific packages, .rpms and .debs.
To build packages, run:
./tools/toolchain/dbuild ninja distAlternatively, to build packages for a specific build mode, run:
./tools/toolchain/dbuild ninja <mode>-distTo verify the packages, run:
ninja dist-checkPlease note that you need to run dist-check on the host because it requires Docker to perform the verification.
This section lists all the artifacts generated by the build system.
Executables:
build/<mode>/scylla
Tests:
build/<mode>/test/**
Tarballs:
build/<mode>/dist/tar/scylla-unified-package.tar.gzbuild/<mode>/dist/tar/scylla-package.tar.gzbuild/<mode>/dist/tar/scylla-python3-package.tar.gzbuild/<mode>/dist/tar/scylla-jmx-package.tar.gzbuild/<mode>/dist/tar/scylla-tools-package.tar.gz
.rpms:
build/dist/<mode>/redhat/RPMS/x86_64/scylla-*.rpmbuild/dist/<mode>/redhat/RPMS/x86_64/scylla-conf-*.rpmbuild/dist/<mode>/redhat/RPMS/x86_64/scylla-debuginfo-*.rpmbuild/dist/<mode>/redhat/RPMS/x86_64/scylla-kernel-conf-*.rpmbuild/dist/<mode>/redhat/RPMS/x86_64/scylla-node-exporter-*.rpmbuild/dist/<mode>/redhat/RPMS/x86_64/scylla-server-*.rpmtools/python3/build/redhat/RPMS/x86_64/scylla-python3-*.rpmtools/jmx/build/redhat/RPMS/noarch/scylla-jmx-*.rpmtools/java/build/redhat/RPMS/noarch/scylla-tools-*.rpmtools/java/build/redhat/RPMS/noarch/scylla-tools-core-*.rpm
.debs:
build/dist/<mode>/debian/scylla-conf_*.debbuild/dist/<mode>/debian/scylla_*.debbuild/dist/<mode>/debian/scylla-server_*.debbuild/dist/<mode>/debian/scylla-kernel-conf_*.debbuild/dist/<mode>/debian/scylla-node-exporter_*.debbuild/dist/<mode>/debian/scylla-server-dbg_*.debtools/python3/build/debian/scylla-python3_*.debtools/jmx/build/debian/scylla-jmx_*.debtools/java/build/debian/scylla-tools-core_*.debtools/java/build/debian/scylla-tools_*.deb