Development / Build

Install build tools (rust and rustup)

Linux / Raspberry Pi / MacOS

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

Rustup

rustup is an installer for the systems programming language Rust.

Windows

Please follow the instructions for Installing rustup on Windows

Install nightly toolchain

Once you have rustup up and running, please install the nightly toolchain.

rustup update nightly

Clone the repository

git clone https://github.com/inexorgame/inexor-rgf-application.git

Build the application

Build in development mode:

cd inexor-rgf-application
cargo build

Build in release mode (takes longer, smaller binaries):

cd inexor-rgf-application
cargo build --release

Cargo

Cargo is the Rust package manager. Cargo downloads your Rust package's dependencies, compiles your packages, makes distributable packages, and uploads them to crates.io, the Rust community’s package registry.

Run the application

cargo run

or:

cargo run --release

Checkout new version and rebuild

  1. Fetch the latest version from git:
    git pull
    
  2. (Optional) If you want a completely clean build
    cargo clean
    
  3. Update dependencies
    cargo update
    
  4. Build the application
    cargo build
    
  5. Repeat this for all plugins

Plugin API version must match

The application and the plugins must be compiled with the same version of the Plugin API!

Build plugins

Checkout and build the plugin

cd ..
git clone https://github.com/inexorgame/inexor-rgf-plugin-mqtt.git
cd inexor-rgf-plugin-mqtt

Build in development mode:

cargo build

Build in release mode:

cargo build --release

Configure plugin

Edit config/plugins.toml and add a section for the plugin. The name must match the crate name of the plugin. Specify the path to the dynamically linked library. The path can be either absolute or relative to the working directory of the application.

[[plugin]]
name = "inexor-rgf-plugin-mqtt"
active = true
path = "../inexor-rgf-plugin-mqtt/target/debug/libinexor_rgf_plugin_mqtt.so"

Artifact Location

Release builds are located in target/release instead of target/debug

Configure plugins

Please consult the documentation for configuring plugins

Plugin Compatibility

17:18:18.642 [ERROR] [main] inexor_rgf_application::implementation::plugin_registry_impl:198 - Cannot load plugin ../inexor-rgf-plugin-flow-manager/target/debug/libinexor_rgf_plugin_flow_manager.so because of a compiler version mismatch: rustc 1.61.0-nightly (expected: 1.63.0-nightly)

Rust Compiler

The plugins have to be compiled by the same rust compiler.