Skip to content

Draft: Add snap packaging

Tim requested to merge timsueberkrueb/snap-testing into master

As previously discussed in #524 (closed), this adds snap packaging for Veloren. Ideally, this would be hooked up to your existing CI. Previously, I was using snapcraft's public build infrastructure which continuously delivered new snap builds to the edge channel.

In order to enable a similar process, the following would be necessary:

  • The Veloren team creates a new Ubuntu One account (e.g. called veloren) which is used to manage snaps in the snap store
  • I transfer the snap package to the new account by requesting a transfer in the snapcraft forum
  • The Veloren team grants contributors that are interested in maintaining the snap package access to managing the snap in the store by adding them as collaborators

As I don't have the necessary access rights, I could not really test the CI configuration, so there may be some adjustments left to be done. The basic idea is a follows:

The SNAPCRAFT_LOGIN_DATA environment variable is set in the GitLab CI/CD settings. The value for SNAPCRAFT_LOGIN_DATA can be generated by running:

snapcraft export-login --snaps veloren --channels edge snapcraft-ci.login
base64 snapcraft-ci.login

I adjusted .gitlab/CI/publish.gitlab-ci.yml to build and publish snap packages if there are changes on the default branch. This only publishes snap builds to the edge channel. Releases need to be tested and published manually. Note that I have not tested this, yet, therefore the Draft status.

Known issues & open questions

  • Currently the home plug is used which grants the snap access to the home directory. Otherwise, veloren-voxygen crashes on start due to AppArmor denials when trying to access ~/Documents and a few other locations (presumably for logging, but needs further investigation).
  • Veloren seems to be using ALSA. Snaps can access ALSA directly using the alsa interface. However, this interface doesn't get automatically connected. The current packaging routes ALSA through Pulseaudio using snapcraft-alsa.

Links

Edited by Tim

Merge request reports