It does’t. If both snaps have given hook (I tested with
pre-refresh only, but this should apply to any other hook of course), you can
snap try repeatedly without issues. It breaks if you:
snap try a snap without the hook.
- add hook to the snap
snap try again in the same directory with the hook now present.
As I said yesterday the symptoms I observed with this scenario were slightly different than originally reported; in the original discovery the apparmor profiles were missing and hooks were DENIED, in the above test I’m getting:
error: cannot perform the following tasks:
- Run pre-refresh hook of "snap-hooks" snap if present (run hook "pre-refresh": cannot stat /var/lib/snapd/seccomp/bpf/snap.snap-hooks.hook.pre-refresh.bin: No such file or directory)
after a few minutes of waiting (hook timeout), and there are no denials.
I’ll create a spread test that reproduces this issue, as a base for potential fix/workaround.