Skip to content

Latest commit

 

History

History
94 lines (61 loc) · 3.33 KB

00-develop.md

File metadata and controls

94 lines (61 loc) · 3.33 KB

Install, Run, and Develop RisingLight

To run RisingLight, you will need Linux or macOS operating systems and the Rust toolchain.

Install the Rust toolchain

The recommended way to set up the Rust toolchain is using rustup. The following command will set up everything for you:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Upon running the above command, the setup wizard will ask for a toolchain version. You may go ahead and use the default toolchain.

For Chinese users, you may configure rustup to use a mirror to speed up download.

Rust toolchain has multiple release channels, e.g., stable channel and nightly channel. RisingLight requires a specific version of nightly toolchain, as it is using some experimental features in the Rust compiler. However, some mirror sites only retain recent versions of nightly releases. If you encountered errors when downloading Rust toolchains, you may switch to a mirror site with full Rust toolchain or use the official rustup source.

Install Tools

RisingLight uses protobuf to encode some on-disk data. Therefore, you will need to install protobuf compiler or toolchains to build protobuf compiler in advance.

On Debian-based Linux distros,

sudo apt install make build-essential cmake protobuf-compiler

On macOS with Homebrew,

brew install cmake protobuf

Compile RisingLight

After installing the Rust toolchain, you may download and compile RisingLight.

You'd better use the rust toolchain specified in rust-toolchain.toml, otherwise you may encounter compilation errors. But fixing bugs of this project with latest rust toolchain and updating rust-toolchain.toml is welcome.

git clone https://github.com/risinglightdb/risinglight
cd risinglight
cargo build # Or cargo build --release

For Chinese users, you may configure a mirror for cargo to speed up downloading dependencies:

Run RisingLight

RisingLight provides a SQL interactive shell. Simply use cargo run to start the shell.

cargo run

You may refer to Importing TPC-H Data for supported query types.

Development

It is recommended to use VSCode with rust-analyzer extension to develop RisingLight. Simply install rust-analyzer extension in VSCode, and everything will be set for you. Note that rust-analyzer conflicts with the official Rust extension. You will need to uninstall "The Rust Programming Language" extension before proceeding.

Also, you'll need to install cargo-nextest to run unit tests.

cargo install cargo-nextest

To enable debug logs for RisingLight, export the following environment variable to your shell environment.

export RUST_LOG=risinglight=debug

If you want to contribute to the RisingLight project, refer to Contributing to RisingLight docs for more information.