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-revision (string)
    Used to select which rust version
  • rust-features (list of strings)
    Features used to build optional dependencies

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.