Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: starcraft
version: git
base: core24
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
This is starcraft 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.
confinement: strict
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether we should just put classic here since all of our snaps currently are classic...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wondered too but then saw that our newest app is strict and was able to get away with some plugs. So maybe we should keep strict by default and have the action to set another confinement a conscious decision.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or does a snapcraft.yaml boilerplate that would work for our apps belong in https://github.com/canonical/craftcraft? It already has one, but is missing recent updates like the parts for libgit2, git, chisel, and the auto-completer.

I'm fine to have starbase's snapcraft.yaml be the absolute minimum to snap a UV project. I'd even be fine to drop the craft-cli autocompleter.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that craftcraft was removed, starbase is the next best home but I'm still not convinced it belongs here.

I'm still unsure of the value proposition of this snapcraft.yaml since it's somewhere in between a generic uv application and a craft app.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This semi-generic snapcraft.yaml serves several purposes:

  • when starting a new craft application, it makes it easier to get a basic snap. Without this file users have to write one from scratch.
  • propose a template implementing as much as possible what we consider the basic features of our snaps (auto-completion, platforms list, license, etc.)
  • help spot differences in our snapcraft.yaml when rebasing on starbase and so help harmonize them.

grade: devel
license: GPL-3.0
compression: lzo
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lengau I am not sure about this but I understand that the snap taking a bit more space to get a faster start-up time is an interesting trade off for us.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I measured this for Charmcraft I determined it was pretty irrelevant for our own snaps, so I don't really care either way. (zstd was better for our use case, but alas...)


platforms:
amd64:
arm64:
armhf:
riscv64:
s390x:
ppc64el:

apps:
starcraft:
command: bin/starcraft
completer: completion.sh
plugs:
- network
- home

parts:
starcraft:
source: .
plugin: uv
build-packages:
- cargo
- git
- libffi-dev
- libssl-dev
- pkg-config
build-snaps:
- astral-uv
Comment thread
upils marked this conversation as resolved.
build-environment:
- UV_COMPILE_BYTECODE: "1"
- UV_NO_BINARY: "1"

bash-completion:
after: [starcraft]
plugin: nil
build-environment:
- PYTHONPATH: $CRAFT_STAGE/lib/python3.12/site-packages
override-build: |
python3 -m craft_cli.completion $CRAFT_PROJECT_NAME starcraft.app:get_app_info \
> $CRAFT_PART_INSTALL/completion.sh