Call for testing: Snapcraft 7

You are spot on and I missed this in the release notes, we are working on a snapcraft lint command to address all these warnings and errors.

7.0.2 is giving me errors while building the core22 snap using https://github.com/snapcore/core-base/pull/45 :

$ snapcraft 
Launching instance...                                                                                                                                  
Installed package repositories                                                                                                                         
Executed: pull probert-deb                                                                                                                             
Executed: pull consoleconf-deb                                                                                                                         
/root/project/parts/bootstrap/install/var/cache/apt/archives/lock: Permission denied                                                                   
Full execution log: '/tmp/snapcraft.log'                                                                                                               
Failed to execute pack in instance.                                                                                                                    
Full execution log: '/home/abeato/.cache/snapcraft/log/snapcraft-20220531-112755.736487.log' 

Log is: https://paste.ubuntu.com/p/pT4W7K3Mcc/

@cmatsuoka another one to look at :point_up:

Successive builds now work flawlessly on 7.0.2 with no shutil.SameFileError issues. Thanks!

2 Likes

This seems to be caused by extra files in the project directory that shouldn’t be there (maybe leftovers from a previous execution in destructive mode?). Note that inside the container our work directory is /root/part instead of /root/project/part – the latter is considered part of the project. To solve this, remove directories parts, stage, prime from the project directory, run snapcraft clean to start from a well-defined state and pack again.

I managed to build our uc22 version of the network-manager snap with snapcraft 7.0.2 after making the suggested changes (https://git.launchpad.net/~awe/snappy-hwe-snaps/+git/network-manager/log/?h=snap-22-craft7x). The only thing I ran into that wasn’t mentioned in the migration guide was the removal of filesets, which I just replaced with prime filtering.

Maybe I’m misunderstanding the migration guide? A command-chain allowed for more than just control over the app’s environment. In the past I’ve used it for running snapcraft_preload, providing a wrapper script that dynamically sets env vars for a number of apps based on snap configuration, or using setpriv from a script to run postgresql as the snap_daemon user (these are all examples from the edgexfoundry snap).

Are any of these use cases still possible?

You can still use command-chain, what you don’t have anymore is snapcraft’s opinionated command chain that you could not easily or selectively get rid of

1 Like

Sorry about that, we actually missed mentioning it.

Thanks, that worked! Said this, if having a folder named parts, prime, etc. is going to be a problem it would be nice to print a more intuitive error message when they are detected. While developing a snap is not unusual to run into this type of situation.

Having these directory names is not a problem, but having superuser-owned files inside them (or in any place under the project subtree) that’s overwritten by the build process is the real issue, because they won’t be writable inside the container (in this case, it happened with the lock file). But we can add a warning if those directories are detected, even when it’s harmless.

One other nit, I can’t seem to find the lxd containers that snapcraft 7.x is spawning to build snaps? I used to be able to see them with lxc list?

Try lxc ls --project snapcraft.

That worked, thanks! It’d be nice to add this to the migration guide and/or release notes.

It looks like parsing metadata from an AppStream file doesn’t work.

Using core22 base, this can be built with snapcraft 6.1 but not snapcraft 7.0.2:

Getting the following error:

2022-06-01 17:45:12.719 :: 2022-06-01 15:45:12.234 extract metadata: parse info from edgex-device-usb-camera.metainfo.xml
2022-06-01 17:45:12.719 :: 2022-06-01 15:45:12.234 Field 'summary' was not adopted from metadata

After adding a local summary:

2022-06-01 20:31:21.975 :: 2022-06-01 18:31:21.356 Extracting and updating metadata...
2022-06-01 20:31:21.975 :: 2022-06-01 18:31:21.357 Field 'description' was not adopted from metadata

I can build after adding both local summary and description.

Thanks, this will probably show up in 7.0.3 in the following (work) day or two

1 Like

As planned 7.0.2 is now on 7.x/stable The default user install of latest/stable is still one week away.

I am sorry to say that we decided to move the release to latest/stable to 2022-06-13T03:00:00Z, we will soon be releasing 7.0.3 (https://github.com/snapcore/snapcraft/releases/tag/7.0.3) to 7.x/candidate and latest/candidate (as soon as one of the architectures the snap uses finishes its build)

2 Likes
$ snapcraft plugins --base core22
Usage: snapcraft plugins [OPTIONS]
Try 'snapcraft plugins -h' for help.

Error: Invalid value for '--base': 'core22' is not one of 'core18', 'core20'.
1 Like
$ snapcraft list-keys
Retrieving credentials for 'snapcraft' on 'dashboard.snapcraft.io' from keyring 'SecretService Keyring'.
Credentials not found in the keyring 'SecretService Keyring'
craft-store error: No credentials found for 'snapcraft' on 'dashboard.snapcraft.io'.                                      
Full execution log: '/home/espy/.cache/snapcraft/log/snapcraft-20220610-181647.111512.log'   

This one also caught me by surprise… is snapcraft now just using the user’s default keyring (~/.gnupg/pubring.kbx)?