*EXPERIMENTAL* package-repositories in use
Failed to install GPG key: sudo: unable to resolve host snapcraft-pi: Name or service not known
sudo: setrlimit(RLIMIT_CORE): Operation not permitted
Executing: /tmp/apt-key-gpghome.zOSFF1WULV/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 78E1918602959B9C59103100F1831DDAFC42E99D
gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
gpg: connecting dirmngr at '/tmp/apt-key-gpghome.zOSFF1WULV/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr
Recommended resolution:
Verify any configured GPG keys.
Detailed information:
GPG key ID: 78E1918602959B9C59103100F1831DDAFC42E99D
GPG key server: keyserver.ubuntu.com
If I do this with snapcraft --debug and manually run apt install dirmngr -y and re-run snapcraft then it works like a charm.
(also the sudo: setrlimit(RLIMIT_CORE): Operation not permitted is because sudo doesn’t work in a lxd container, perhaps in the lxd case don’t run commands with sudo? this message is probably harmless so not a big deal but could be a bad user experience)
Speaking as a user who just recently ran their first multipass build, I was horrified by the amounts of data being pulled for what I thought should be a simple and “quick” build (it also took ages), based on my experience with older versions of snap – with no indication where that data went, and how I could clean it up. If you can improve the experience in that regard, yay!
</random feedback>
The default behavior is to use a clean environment. It is always bootstrapped for each Snapcraft project, similar using pbuilder or schroots in Debian.
If this is the part that is surprising, then you can always resort to --destructive-mode, just know that you might want to run it in an environment where packages and such might get installed (your build and runtime dependencies). Also, just like building debs, you will need to take special care of the base you are targeting and the environment you are using to build this snap.
If that last paragraph is not the concern of data please clarify in detail to address correctly (in words or reflection in code).
I’ve been trying to build a snap that includes a couple of python parts. These parts build fine when the snap has base core or core18, but do not with base core20. The were integration tests for similar parts to this in the plugin v1 intergration tests, I believe. Current version of parts definitions:
Is there / could there be a plugin-specific keyword to inhibit the cache generation and so reverting to previous behaviour? This would help when maintain snaps across a number of bases.
This time, it might work if you can run find and remove all the cache files after snapcraftctl build but you shouldn’t expect the same language as new bases are introduced, the technology stack does evolve and we try to push the needle to what is current and best behavior at the time of introducing a new base.
Is it expected that snapcraft cannot launch a core20-compatible container or vm for building a snap (using lxd or multipass respectively)?
$ snapcraft
Launching a VM.
launch failed: Unable to find an image matching "core20"
An error occurred with the instance when trying to launch with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.
edit: oh, reproducing the lxd variant to capture the log output to post here, it seems to have successfully started a container this time around…