Skip to content

Latest commit

 

History

History
84 lines (57 loc) · 2.89 KB

COMPILING.md

File metadata and controls

84 lines (57 loc) · 2.89 KB

Compiling from source

Initial setup

Spoticord is built using rust, so you'll need to install that first. It is cross-platform, so it should work on Windows, Linux and MacOS. You can find more info about how to install rust here.

Rust formatter

Spoticord uses rustfmt to format the code, and we ask everyone that contributes to Spoticord to use it as well. You can install it by running the following command in your terminal:

rustup component add rustfmt

If you are using VSCode, you can install the rust-analyzer extension, which will automatically format your code when you save it (if you have format on save enabled). Although rust-analyzer is recommended anyway, as it provides a lot of useful features.

Build dependencies

On Windows you'll need to install the Visual Studio Build Tools to be able to compile executables in rust (this will also be explained during the rust installation).

If you are on Linux, you can use your package manager to install the following dependencies:

# Debian/Ubuntu
sudo apt install build-essential

# Arch
sudo pacman -S base-devel

# Fedora
sudo dnf install gcc

Additionally, you will need to install CMake and OpenSSL (Linux only). On Windows, you can download CMake here. On Linux, you can use your package manager to install them:

# Debian/Ubuntu
sudo apt install cmake libssl-dev

# Arch
sudo pacman -S cmake openssl

# Fedora
sudo dnf install cmake openssl-devel

Compiling

Now that you have all the dependencies installed, you can compile Spoticord. To do this, you'll first need to clone the repository:

git clone https://github.com/SpoticordMusic/spoticord.git

After cloning the repo run the following command in the root of the repository:

cargo build

Or if you want to build a release version:

cargo build --release

This will compile the bot and place the executable in target/release. You can now run the bot by running the following command:

./target/release/spoticord

If you are actively developing Spoticord, you can use the following command to build and run the bot (this is easier than building and running the bot manually):

cargo run

Features

As of now, Spoticord has one optional feature: stats. This feature enables collecting a few statistics, total and active servers. These statistics will be sent to a redis server, where they then can be read for whatever purpose. If you want to enable this feature, you can do so by running the following command:

cargo build [--release] --features metrics

MSRV

The current minimum supported rust version is 1.67.0.