plugs in apps in snap.yaml makes global plugs ignored for hooks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| snapd |
High
|
Unassigned |
Bug Description
with a snap.yaml that globally declares its plugs and also declares app-specific plugs like so:
```
name: lp-1854046
version: '0.1'
summary: regression test snap for LP bug 1854046
description: https:/
base: core18
architectures:
- amd64
confinement: strict
grade: stable
plugs:
opengl: null
apps:
lp-1854046:
command: snap/command-
plugs:
- opengl
```
The top level plugs are ignored and not generated in the policy for the hooks. You can see this with a simple configure hook that tries to read from /var/lib/
```
#!/bin/sh -e
sha1sum /var/lib/
```
With this the snap will refuse to install.
Changed in snapd: | |
assignee: | nobody → Ian Johnson (anonymouse67) |
Changed in snapd: | |
status: | New → Triaged |
Ian Johnson (anonymouse67) wrote : | #2 |
I adjusted the title/description as this bug is a little bit more finicky but I have a full regression test we can use for this.
description: | updated |
summary: |
- global plugs in snap.yaml makes hook plugs ignored + plugs apps in snap.yaml makes global plugs ignored for hooks |
summary: |
- plugs apps in snap.yaml makes global plugs ignored for hooks + plugs in apps in snap.yaml makes global plugs ignored for hooks |
Ian Johnson (anonymouse67) wrote : | #3 |
Closing this with AsDesigned because the top-level (also known by me as "global") plugs/slots operate in two ways:
- as applying to all hooks and apps if _none_ of the apps and hooks declare plugs/slots
- as a "pool" of plugs/slots where individual apps/hooks can explicitly use each individual plug/slot from the top-level declaration and that plug/slot becomes "scoped" to that app hook and other apps/hooks that don't declare any of those top-level plugs/slots don't automatically get them
This case is the latter, where the lp-1854046 app is scoping the opengl plug, denying the plug to the install hook. To make this particular snap work, the solution is to either not declare plugs in the opengl app or to also explicitly declare the opengl interface as a plug.
Changed in snapd: | |
status: | Triaged → Won't Fix |
assignee: | Ian Johnson (anonymouse67) → nobody |
I tagged that as high importance because ian is already working on this, thanks Ian for raising the issue.