`priority` property not recognized in `package-repositories` section using Snapcraft 7.5.5

Hello!

I’m trying to build a snap using a private package repository that I would like to prioritize to get packages from there instead of the public repos.

I’m using Snapcraft 7.5.5 from the 7.x/stable channel, because this snap needs to build against core18.

According to the documentation, to use the priority field, one needs Snapcraft 7.4 (and above, I assume).

I’m trying to add a package repository in my snapcraft.yaml, and add this section:

package-repositories:
  - type: apt
    formats: [deb]
    components: [main]
    suites: [bionic]
    key-id: ***
    url: https://ppa.launchpadcontent.net/***/ubuntu # This is a private repository
    priority: always

Running snapcraft fails with:

Issues while validating snapcraft.yaml: The 'package-repositories[0]' property does not match the required schema: OrderedDict([('type', 'apt'), ('formats', ['deb']), ('components', ['main']), ('suites', ['bionic']), ('key-id', '***'), ('url', 'https://ppa.launchpadcontent.net/***/ubuntu'), ('priority', 'always')]) is not valid under any of the given schemas

If I remove the priority field, it works. However, I need to set this field to prioritize packages from this repo when building the snap.

How can I do?

P.S.:

I also tried using this instead:

package-repositories:
  - type: apt
    ppa: ***/***
    priority: always

as stated in the example section of the doc, but it fails the same way. (removing priority fixes the snapcraft error message, but not my problem :))

Thanks in advance for your help!

this snap needs to build against core18.

A detail that we dropped the ball on communicating (as it came out as an emergency fix late in the cycle) is that the package-repositories changes listed as requiring Snapcraft 7.4 or later only affect core22 (and later) snaps.

1 Like