The rust plugin


#1

The rust plugin is useful for building Rust-based parts using the Cargo package manager to drive the build.

This plugin uses the common plugin keywords as well as those for “sources”. For more information, see Snapcraft parts metadata.

Additionally, this plugin uses the following plugin-specific keywords:

  • rust-channel (string)
    Used to select which rust channel (stable, beta, nightly)
  • rust-features (list of strings)
    Features used to build optional dependencies
  • rust-revision (string)
    Used to select which rust version

If a rust-toolchain file is detected, the toolchain it specifies will be used by default. However, if rust-channel or rust-revision are set, the rust-toolchain file will be overridden.

If neither a rust-toolchain exists nor rust-channel or rust-revision are set, the latest stable toolchain will be used.

See Rust applications for a simple example, or search GitHub for projects already using the plugin.

NOTE: There are significant bugs in the rust plugin when used with the legacy version of Snapcraft. To avoid these issues, ensure you’re using Snapcraft 3.x and the base keyword in snapcraft.yaml. See the corresponding GitHub issue for more details.

ⓘ This is a snapcraft plugin. See Snapcraft plugins and Supported plugins for further details on how plugins are used.


Snap documentation
Release notes: Snapcraft 3.7
Snapcraft build, debug and publishing docs roadmap (page breakdown)
#2

I’m having trouble getting the rust plugin to work, reported a bug here: https://bugs.launchpad.net/snapcraft/+bug/1813618

It looks like maybe rustup has changed and the plugin needs to be updated. Anyone else having this issue?