This is my first attempt at using snapcraft to build a snap.
I have installed Vagrant and pulled down the ubuntu/xenial64 box. After SSHing into the virtual machine, initialising lxd and installing snapcraft I have attempted to check my environment is set up correctly.
sudo snap install snapcraft --classic
snapcraft init
sudo snapcraft cleanbuild
Below shows the output from this last command:
vagrant@ubuntu-xenial:~/foo$
vagrant@ubuntu-xenial:~/foo$ sudo snapcraft cleanbuild
Creating snapcraft-gorgedly-trothless-dollie
Starting snapcraft-gorgedly-trothless-dollie
error: flag provided but not defined: --format
Failed to get container image info: `lxc image list --format=json ubuntu:xenial/amd64` returned with exit code 2, output: b''
It will not be recorded in manifest.
Waiting for a network connection...
Network connection established
Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7532 kB]
Get:6 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [511 kB]
Get:7 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [219 kB]
Get:8 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [354 kB]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [132 kB]
Get:10 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [3456 B]
Get:11 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [1744 B]
Get:12 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en [4354 kB]
Get:13 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB]
Get:14 http://archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB]
Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [795 kB]
Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [329 kB]
Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [635 kB]
Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [255 kB]
Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [16.4 kB]
Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [8344 B]
Get:21 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [4844 B]
Get:22 http://archive.ubuntu.com/ubuntu xenial-backports/main Translation-en [3220 B]
Get:23 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [7400 B]
Get:24 http://archive.ubuntu.com/ubuntu xenial-backports/universe Translation-en [3996 B]
Fetched 15.7 MB in 7s (2204 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libfreetype6
Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
squashfuse
0 upgraded, 1 newly installed, 0 to remove and 10 not upgraded.
Need to get 17.4 kB of archives.
After this operation, 54.3 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 squashfuse amd64 0.1.100-0ubuntu1~ubuntu16.04.1 [17.4 kB]
Fetched 17.4 kB in 0s (248 kB/s)
Selecting previously unselected package squashfuse.
(Reading database ... 25657 files and directories currently installed.)
Preparing to unpack .../squashfuse_0.1.100-0ubuntu1~ubuntu16.04.1_amd64.deb ...
Unpacking squashfuse (0.1.100-0ubuntu1~ubuntu16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up squashfuse (0.1.100-0ubuntu1~ubuntu16.04.1) ...
error: no changes of type "auto-refresh" found
Looking up assertion ['account-key', 'public-key-sha3-384=BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul']
Looking up assertion ['snap-declaration', 'snap-name=core']
Looking up assertion ['snap-revision', 'snap-revision=4650', 'snap-id=99T7MUlRhtI3U0QFgl5mXXESAiSwt776']
error: open /var/lib/snapd/hostfs/home/vagrant/snap/lxd/common/snapcraftx_f_16kg/core_4650.assert: no such file or directory
Stopping local:snapcraft-gorgedly-trothless-dollie
Sorry, Snapcraft ran into an error when trying to running through its
lifecycle that generated the following traceback:
Traceback (most recent call last):
File "/snap/snapcraft/1594/bin/snapcraft", line 11, in <module>
load_entry_point('snapcraft==2.42.1', 'console_scripts', 'snapcraft')()
File "/snap/snapcraft/1594/lib/python3.5/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/snap/snapcraft/1594/lib/python3.5/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/snap/snapcraft/1594/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/snap/snapcraft/1594/lib/python3.5/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/snap/snapcraft/1594/lib/python3.5/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 222, in cleanbuild
build_environment=build_environment)
File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_containers.py", line 53, in cleanbuild
_deprecated_cleanbuild(project, remote, config, tar_filename)
File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_containers.py", line 77, in _deprecated_cleanbuild
metadata=config.get_metadata(), remote=remote).execute()
File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/lxd/_containerbuild.py", line 186, in execute
with self._container_running():
File "/snap/snapcraft/1594/usr/lib/python3.5/contextlib.py", line 59, in __enter__
return next(self.gen)
File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/lxd/_containerbuild.py", line 84, in _container_running
with self._ensure_started():
File "/snap/snapcraft/1594/usr/lib/python3.5/contextlib.py", line 59, in __enter__
return next(self.gen)
File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/lxd/_containerbuild.py", line 107, in _ensure_started
self._ensure_container()
File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/lxd/_cleanbuilder.py", line 50, in _ensure_container
self._inject_snapcraft(new_container=True)
File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/lxd/_containerbuild.py", line 253, in _inject_snapcraft
self._inject_snap('core', tmp_dir)
File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/lxd/_containerbuild.py", line 303, in _inject_snap
], tmp_dir)
File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/lxd/_containerbuild.py", line 377, in _inject_assertions
self._push_file(filepath, container_filename)
File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/lxd/_containerbuild.py", line 326, in _push_file
src, '{}{}'.format(self._container_name, dst)])
File "/snap/snapcraft/1594/usr/lib/python3.5/subprocess.py", line 581, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['lxc', 'file', 'push', '/home/vagrant/snap/lxd/common/snapcraftx_f_16kg/core_4650.assert', 'local:snapcraft-gorgedly-trothless-dollie/run/core_4650.assert']' returned non-zero exit status 1