Skip to content

Instantly share code, notes, and snippets.

@come-maiz
Last active September 22, 2016 02:45
Cargo snap testing

Smoke tests for the Cargo snap (based on http://doc.crates.io/index.html)

First, build and install the snap:

$ sudo apt install git snapcraft
$ git clone https://github.com/elopio/cargo
$ cd cargo
$ git checkout snapcraft
$ snapcraft
$ sudo snap install cargo*.snap --force-dangerous

Print the help:

$ cargo
$ cargo -h
$ cargo --help
$ cargo help
Rust's package manager 

Usage:
[...]

Print the version:

$ cargo -V
cargo 0.13.0

Start a new project:

$ cargo new hello_world --bin
     Created binary (application) `hello_world` project

Build the project:

$ cargo build
@come-maiz
Copy link
Author

Build fails because rustc is not part of the snap, and if it's installed in the system, the snap can't execute it. See https://lists.ubuntu.com/archives/snapcraft/2016-September/001120.html for a discussion about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment