This is how my snapcraft.yaml looks like (at the root of my Rust project):
name: keval-snap
base: core20
version: '0.1'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
This is my-snap's description. You have a paragraph or two to tell the
most important story about your snap. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the snap
store.
grade: stable
confinement: strict
apps:
keval-snap:
command: bin/keval-snap
daemon: simple
parts:
my-part:
plugin: rust
source: .
build-packages:
- pkg-config
- libssl-dev
And my Cargo.toml :
[package]
name = "my-package"
version = "0.1.0"
edition = "2021"
default-run = "keval-snap"
[[bin]] # Bin to run the http client
name = "keval-snap"
path = "src/main.rs"
doc = false
.............
After creating the YAML I did
snapcraft
snapcraft upload --release=stable keval-snap_0.1_amd64.snap
I can see my package on my Snapcraft account
Then, I Installed with snap install keval-snap
The only thing is when I run keval-snap --help
it says command not found !
I expect to see the possible commands and options here.
Is there anything wrong with snapcraft.yaml OR cargo.toml ?
The issue was mismatching names.
I used snapcraft --debug
and saw all the files inside VM.
Turns out, application command name should match with part name.
I had my code built inside bin/my-part
, and I was calling the command bin/keval-snap
Changed my part name to keval-snap
& Issue was resolved !