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 20.04 for Intel/AMD processors. The Shasta static executable created by this build runs on most current 64-bit Linux platforms.
- Ubuntu 20.04 for ARM processors (for example, AWS Graviton/Graviton2/Graviton3 processors, Raspberry Pi).
- macOS 11 for Intel processors.
- macOS 11 for ARM processors (Apple M1, M2 processors).
For Ubuntu, we plan to switch to 22.04 soon after it is released. Soon after that, Shasta will no longer build on Ubuntu 20.04.
Porting the build process to other Linux platforms is possible. If you are interested in porting to a different platform, please file an Issue on GitHub. Even better, submit a Pull Request with the necessary changes.
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 # OR shasta/scripts/InstallPrerequisites-macOS.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 Commits page of the Shasta repository.
- Choose a commit that has green checkmark like this ✓. The checkmark indicates that a push occurred at that commit, followed by a successful test build.
- Click on the green checkmark, then click on one of the Details links that appear in the pop up window.
- You are now on the GitHub Actions page for that test build.
Click on Summary on the left of the window,
then 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