Snapcraft clean doesn't clean with SNAPCRAFT_CONTAINER_BUILDS set

export SNAPCRAFT_CONTAINER_BUILDS=1 then run snapcraft. A container is created for the project, the build runs in the container. Now run snapcraft clean.

Expected behaviour - container, parts, stage, prime etc are deleted
Actual behaviour - only the container is deleted

The parts/stage/prime etc directories should also be cleaned.



If I run snapcraft twice, it barfs…

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=2898', 'snap-id=99T7MUlRhtI3U0QFgl5mXXESAiSwt776']
Adding assertion core_2898.assert
Installing /run/core_2898.snap
error: cannot perform the following tasks:
- Copy snap "core" data (cannot copy "/var/snap/core/2898" to "/var/snap/core/2898": failed to copy all: "cp: cannot stat '/var/snap/core/2898': No such file or directory" (1))

I have to clean it, which completely takes away the point of doing container builds which are retaining build artefacts.

I’m having the double-run problem too: Snapcraft container builds triggering a bug in snapd

1 Like
1 Like