Skip to content

Commit

Permalink
HACKING.md: expect snapcraft 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
valentindavid authored and Meulengracht committed May 29, 2024
1 parent c5bb99e commit a279396
Showing 1 changed file with 8 additions and 31 deletions.
39 changes: 8 additions & 31 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,31 +70,22 @@ go get ./... && ./get-deps.sh

The easiest (though not the most efficient) way to test changes to snapd is to
build the snapd snap using _snapcraft_ and then install that snapd snap. The
[snapcraft.yaml](./build-aux/snapcraft.yaml) for the snapd snap is located at
[snapcraft.yaml](./build-aux/snap/snapcraft.yaml) for the snapd snap is located at
[./build-aux/](./build-aux/), and
can be built using snapcraft either in a LXD container or a multipass VM (or
natively with `--destructive-mode` on a Ubuntu 16.04 host).
can be built using snapcraft.

> Currently, snapcraft's default track of 5.x does not support building the
snapd snap, since the snapd snap uses `build-base: core`. Building with a
`build-base` of core uses Ubuntu 16.04 as the base operating system (and thus
root filesystem) for building and Ubuntu 16.04 is now in Extended Security
Maintenance (ESM, see
[Ubuntu 16.04 LTS ESM](https://ubuntu.com/blog/ubuntu-16-04-lts-transitions-to-extended-security-maintenance-esm)),
and as such only is buildable using snapcraft's 4.x channel. At some point in the future,
the snapd snap should be moved to a newer `build-base`, but until then `4.x`
needs to be used.
Snapcraft 8.x or later is expected.

Install snapcraft from the 4.x channel:
Install snapcraft:

```
sudo snap install snapcraft --channel=4.x
sudo snap install snapcraft
```

Then run snapcraft:

```
snapcraft
snapcraft --channel=latest/stable
```

Now the snapd snap that was just built can be installed with:
Expand All @@ -111,29 +102,15 @@ can either use `snap revert snapd`, or you can refresh directly with
#### Building for other architectures with snapcraft

It is also sometimes useful to use snapcraft to build the snapd snap for
other architectures using the `remote-build` feature. In order to build
remotely with snapcraft, make sure you have at least version `6.x` installed:
if the command `snap info snapcraft` shows that you are running an older
version, upgrade with:
other architectures using the `remote-build` feature.

```
snap refresh snapcraft --channel=latest/stable
```

Now you can use remote-build with snapcraft on the snapd tree for any desired
You can use remote-build with snapcraft on the snapd tree for any desired
architectures:

```
snapcraft remote-build --build-for=armhf,s390x,arm64
```

And to go back to building the snapd snap locally, just revert the channel back
to 4.x:

```
snap refresh snapcraft --channel=4.x/stable
```

#### Splicing the snapd snap into the core snap

Sometimes while developing you may need to build a version of the _core_ snap
Expand Down

0 comments on commit a279396

Please sign in to comment.