Building From Source¶
In order to build dnst from the source, you need to have Rust installed on your system. The Rust compiler runs on, and compiles to, a great number of platforms, though not all of them are equally supported. The official Rust Platform Support page provides an overview of the various support levels.
While some system distributions include Rust as system packages, dnst relies on a relatively new version of Rust, currently 1.88 or newer. We therefore suggest to use the canonical Rust installation via a tool called rustup.
Assuming you already have curl installed, you can install rustup and Rust by simply entering:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Alternatively, visit the Rust website for other installation methods.
Building and Updating¶
In Rust, a library or executable program such as dnst is called a crate. Crates are normally published on crates.io, the Rust package registry. Cargo is the Rust package manager. It is a tool that allows Rust packages to declare their various dependencies and ensure that you’ll always get a repeatable build.
Cargo fetches and builds dnst’s dependencies into an executable binary for
your platform. By default you install from crates.io, but because dnst is not
yet published in the Rust package registry, you can currently only install it
directly from GitHub using the --git option. If you want to try a
specific branch, include the --branch option as well:
cargo install dnst --bin dnst --git https://github.com/NLnetLabs/dnst.git --branch main
See also
For more installation options refer to the Cargo book.
Platform Specific Instructions¶
For some platforms, rustup cannot provide binary releases to install directly. The Rust Platform Support page lists several platforms where official binary releases are not available, but Rust is still guaranteed to build. For these platforms, automated tests are not run so it’s not guaranteed to produce a working build, but they often work to quite a good degree.
OpenBSD¶
On OpenBSD, patches are required to get Rust running correctly, but these are well maintained and offer the latest version of Rust quite quickly.
Rust can be installed on OpenBSD by running:
pkg_add rust