Build From Source
Prerequisites
Section titled “Prerequisites”- Go
- GNU Make
- git
- GCC
- pkg-config
- cmake
- protoc (protobuf compiler) >= v3.20.0
- openssl
- openssl-dev
- rustup
- ziglang and zigbuild (for GNU Linux only)
- valkey (for testing)
Valkey installation
Section titled “Valkey installation”See the Valkey installation guide to install the Valkey server and CLI.
Build Instructions
Section titled “Build Instructions”-
Install Common Prerequisites
Section titled “Install Common Prerequisites”Terminal window sudo apt update -ysudo apt install -y git gcc pkg-config openssl libssl-dev unzip cmake python3# Install rustcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shsource "$HOME/.cargo/env"# Check that the Rust compiler is installedrustc --versionInstall
Section titled “Install ziglang and zigbuild”ziglangandzigbuildTerminal window pip3 install ziglangcargo install --locked cargo-zigbuildTerminal window sudo yum update -ysudo yum install -y git gcc pkgconfig openssl openssl-devel unzip cmake wget tar python3# Install rustcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shsource "$HOME/.cargo/env"# Check that the Rust compiler is installedrustc --versionInstall
Section titled “Install ziglang and zigbuild”ziglangandzigbuildTerminal window pip3 install ziglangcargo install --locked cargo-zigbuildTerminal window brew updatebrew install git gcc pkgconfig openssl cmake unzip python3# Install rustcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shsource "$HOME/.cargo/env"# Check that the Rust compiler is installedrustc --versionInstall Protobuf Compiler
Section titled “Install Protobuf Compiler”Terminal window PB_REL="https://github.com/protocolbuffers/protobuf/releases"curl -LO $PB_REL/download/v29.1/protoc-29.1-linux-x86_64.zipunzip protoc-29.1-linux-x86_64.zip -d $HOME/.localexport PATH="$PATH:$HOME/.local/bin"protoc --versionTerminal window PB_REL="https://github.com/protocolbuffers/protobuf/releases"curl -LO $PB_REL/download/v29.1/protoc-29.1-linux-x86_64.zipunzip protoc-29.1-linux-x86_64.zip -d $HOME/.localexport PATH="$PATH:$HOME/.local/bin"protoc --versionTerminal window PB_REL="https://github.com/protocolbuffers/protobuf/releases"curl -LO $PB_REL/download/v29.1//protoc-29.1-osx-universal_binary.zipunzip protoc-29.1-osx-universal_binary.zip -d $HOME/.localexport PATH="$PATH:$HOME/.local/bin"protoc --versionOther platform-specific binaries can be found here.
-
Install Go
Section titled “Install Go”Terminal window sudo snap install go --classicexport PATH="$PATH:$HOME/go/bin"Terminal window sudo yum install -y wget tarwget https://go.dev/dl/go1.22.0.linux-amd64.tar.gzsudo tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gzexport PATH="$PATH:/usr/local/go/bin"export PATH="$PATH:$HOME/go/bin"Terminal window brew install goexport PATH="$PATH:$HOME/go/bin" -
Clone the repository
Section titled “Clone the repository”Terminal window mkdir -p $HOME/srccd $HOME/srcgit clone https://github.com/valkey-io/valkey-glide.gitcd valkey-glide -
Install Dependencies and Build
Section titled “Install Dependencies and Build”Terminal window cd go# Only needed once.make install-build-toolsmake build -
Quick Test
Section titled “Quick Test”Terminal window go test -race ./... -
Install Go development tools
Section titled “Install Go development tools”Terminal window make install-dev-tools