Comment 1 for bug 1824255

Revision history for this message
Sergio Schvezov (sergiusens) wrote : Re: snapcraft+snapd should allow generating/using wrappers for hooks

In snapcraft, if you create the hook through a part, command-chain will be properly setup with the right environment, the hooks need logic to install to $SNAPCRAFT_PART_INSTALL/snap/hooks/<hook-name>

The case you are presenting is probably the case where you just add hooks to <project_root>/snap/hooks which get straight up copied into <snap_root>/meta/hooks. This can be solved by setting a global environment.

The fact that the environment keyword at the root of a project is not respected was a snapd issue that has since been solved https://github.com/snapcore/snapd/pull/5498

I am marking the snapcraft issue as Invalid for such reason, and will let the snapd team attest to what I wrote and triage appropriately.