Skip to content

Instantly share code, notes, and snippets.

@come-maiz
Last active September 22, 2016 02:45
Show Gist options
  • Save come-maiz/67e03ed41d950aeec04003253f09fee7 to your computer and use it in GitHub Desktop.
Save come-maiz/67e03ed41d950aeec04003253f09fee7 to your computer and use it in GitHub Desktop.
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