Building the code from source
When is it necessary to build from source?
In most cases, you can use a release build downloaded from the Releases page on GitHub. (See the quick start page for more information) You need to build from source in one of the following circumstances:
- To build a version of Shasta for which no release exists. For example, if you want to get a recently added feature not available in the most recent release build. For this specific use case, you can download a Shasta test build from GitHub, as described below.
- To test, develop, or debug Shasta code.
- To port the Shasta build to a different platform.
How to build from source
Build platforms
We currently support building from source on the following platforms:
- Ubuntu 22.04 for Intel/AMD processors. The Shasta static executable created by this build has no dependencies (and therefore requires no installation) and runs on most current 64-bit Linux platforms that use kernel version 3.2.0 or newer.
- Ubuntu 22.04 for ARM processors (for example, AWS Graviton/Graviton2/Graviton3 processors running Ubuntu, Raspberry Pi).
Shasta no longer builds on Ubuntu 20.04 or on any version of macOS.
Build commands
- Check out Shasta repository (You need to have
git
installed on your machine)git clone https://github.com/chanzuckerberg/shasta.git
- Install prerequisite packages
sudo shasta/scripts/InstallPrerequisites-Ubuntu.sh
- Build
mkdir shasta-build cd shasta-build cmake ../shasta make all -j make install
Build contents
The build process described above creates in the
shasta-build
directory ashasta-install
directory that contains the following:- A
bin
directory containing the Shasta executable, namedshasta
, Shasta shared libraryshasta.so
, and several scripts. - A
conf
directory containing sample config files. - A
docs
directory containing this and other documentation.
Building smaller binaries
If you don't plan to use your build for debugging, you can use command
make install/strip
instead ofmake install
as the last step of the build process. This will strip debug symbols from the Shasta executable and shared library, which significantly reduces the size of the build directory.An alternative to building from source: downloading a test build
Shasta uses GitHub Actions to perform a test build every time a push to the repository occurs. The main goal of these builds is to test that new code continues to build on all supported platforms, but the builds are accessible to all users for download for 90 days after their creation. The test builds are generally not as reliable as release builds and can sometimes be non-functional. With this in mind, you can use the following steps to download one of these test builds:
- Make sure to be logged in to GitHub. Any user will work, but GitHub will not allow downloading a test build anonymously.
- Go to the GitHub Actions page of the Shasta repository.
- Choose a build that has green checkmark and click on it. The checkmark indicates that a push occurred at that commit, followed by a successful test build.
- Scroll down to the Artifacts section
and select what you want to download.
Your browser will then download the file you selected as zipped.
You can use the
unzip
command, or equivalent, to unzip it. After unzipping it, if it is an executable. Before running it, you will have to set its execute permission bit viachmod ugo+x filename
.
- A