Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 2.01 KB

HACKING.md

File metadata and controls

57 lines (37 loc) · 2.01 KB

Snapcraft

Setting up a development environment

We want to make sure everyone develops using a consistent base, to ensure that these instructions rely on LXD (use whatever is convenient as long as you do not stray away from an Ubuntu 16.04 LTS base)

Clone these sources and make it your working directory:

git clone https://github.com/snapcore/snapcraft.git
cd snapcraft

If you already have LXD setup you can skip this part, if not, run:

sudo snap install lxd
sudo lxd init --auto --storage-backend=dir
sudo adduser "$USER" lxd
newgrp lxd

Setup the environment by running:

./tools/environment-setup.sh

To work inside this environment, run:

lxc exec snapcraft-dev -- sudo -iu ubuntu bash

Import your keys (ssh-import-id) and add a Host entry to your ssh config if you are interested in Code's Remote-SSH plugin.

Testing

See the Testing guide.

Enabling debug output

Given that the --debug option in snapcraft is reserved for project specific debugging, enabling for the logger.debug calls is achieved by setting the "SNAPCRAFT_ENABLE_DEVELOPER_DEBUG" environment variable to a truthful value. Snapcraft's internal tools, e.g.; snapcraftctl should pick up this environment variable as well.

Evaluating pull requests

Oftentimes all you want to do is see if a given pull request solves the issue you were having. To make this easier, the Travis CI setup for snapcraft publishes the resulting snap that was built for x86-64 using transfer.sh. To download the snap, find the relevant CI job run for the PR under review and locate the "snap" stage, the URL to download from will be located at the end of logs for that job.

Reaching out

We'd love the help!