[core22] gnome ext prevents use of configure hook

Bug #1989499 reported by Tony Espy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

When building a snap using the experimental core22 'gnome' extension in snapcraft 7, a command-chain is added to the configure hook which seems to prevent a snap-provided configure hook from running.

hooks:
    configure:
        plugs:
        - desktop
        command-chain:
        - snap/command-chain/hooks-configure-fonts

This command doesn't seem to chain properly, as it seems to prevent an actual configure hook from being called.

I've also provided a sample based on the Desktop team's workshops snap which can be found here:

https://github.com/tonyespy/workshops/tree/configure-hook-bug

To test, build the snap from my branch, install, and then run `snap set workshops foo=bar`. You'll see the following messages in the journal:

Started snap.workshops.hook.configure.a4520ba7-bb96-43f0-854e-7a34bdb3b648.scope.
snap.workshops.hook.configure.a4520ba7-bb96-43f0-854e-7a34bdb3b648.scope: Deactivated successfully.

...but not the message logged by the configure hook, nor will the file $SNAP_COMMON/configure-hook-run exist.

snapcraft version: 7.1.3 8187 (amd64)
build environment: 22.04 Desktop

Revision history for this message
Tony Espy (awe) wrote :

The extension adds:

hooks:
    configure:
        plugs:
        - desktop
        command-chain:
        - snap/command-chain/hooks-configure-fonts

...which should lead to snapd calling snap/command-chain/hooks-configure-fonts, then `snap/hooks/configure`. The the latter is never called in this case.

The bug is that the command-chain `hooks-configure-fonts` script that gets installed by the extension runs the command:

exec "${SNAP}/snap/command-chain/run" "${SNAP}/gnome-platform/command-chain/hooks-configure-fonts" "$@"

The script run actually checks for the existence of `${SNAP}/gnome-platform/command-chain/hooks-configure-fonts`, doesn't find it (because it's not available from the gnome-42-2204 snap), and silently exits using exit (v.s. exit 1 which would cause the hook to fail).

Revision history for this message
Ken VanDine (ken-vandine) wrote :
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.