snapcraft does not seem to call `snap pack --check-skeleton` to validate that snap has correct things

Bug #1950465 reported by Dimitri John Ledkov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Invalid
Undecided
Frederik Du Toit Lotter
snapd
In Progress
Low
Frederik Du Toit Lotter

Bug Description

I built a snap with plug name that contains '.'

snapcraft made the snap just fine.

But when i installed it, snapd said that there is a new warning and that my snap has bad plugs or slots, listed them as invalid plug name.

I would have hoped that snapcraft would show such a warnings; and/or fail to build the snap.

After fixing that, i got a new warning that system-files plug cannot end with "/". Again I would have hoped that snapcraft would tell me that, not snapd.

description: updated
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

snapcraft relies on "snap pack --validate-skeleton" for these checks.

Changed in snapcraft:
status: New → Invalid
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

$ snapcraft --provider lxd
....

Snapped snapname_2-14-g66315a3_amd64.snap

$ unsquashfs snapname_2-14-g66315a3_amd64.snap

$ snap pack --check-skeleton squashfs-root
snap "snapname" has bad plugs or slots: modprobe.d (invalid plug name: "modprobe.d")

....

I do not see that snapcraft calls `snap pack --validate-skeleton` which is invalid command. And I don't see snapcraft calling `snap pack --check-skeleton`.

Maybe snapcraft should actually call `snap pack --check-skeleton` ?

summary: - snapcraft allowed to build snap with a bad plug name
+ snapcraft does not seem to call `snap pack --check-skeleton` to validate
+ that snap has correct things
Changed in snapd:
status: New → Invalid
Changed in snapcraft:
status: Invalid → New
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

This is strange, snap pack should --check-skeleton

Changed in snapd:
status: Invalid → New
Revision history for this message
Ian Johnson (anonymouse67) wrote :

Indeed, it seems we do not call the Go code for --check-skeleton when used with just `snap pack`. Perhaps there are reasons for this, but I don't see why we shouldn't do this.

Changed in snapd:
status: New → Confirmed
importance: Undecided → Low
Changed in snapd:
assignee: nobody → Frederik Du Toit Lotter (flotter)
Changed in snapcraft:
assignee: nobody → Frederik Du Toit Lotter (flotter)
Changed in snapd:
status: Confirmed → In Progress
Changed in snapcraft:
status: New → In Progress
Changed in snapcraft:
status: In Progress → Invalid
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Added --check-skeleton to snapcraft as a temporal workaround https://github.com/snapcore/snapcraft/pull/3743

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.