`snapd` required even by adding `gnome` extension

Hello ! @Snapcrafters

When using the gnome extension, is it necessary to add snapd in stage-packages ? The gnome extension requires snapctl when I launch my application, but as far as I remember, snapctl is provided by the snapd package (which is quite large).

Thanks for your help :pray:.

The snapctl command is provided by the base snap, so it’s there for you automatically without needing to stage anything. I wouldn’t recommend staging the snapd package for any reason.

Thanks for your response, @kenvandine.

In this case, how can snapctl be exposed for GNOME to use ? Or is there another approach ? :face_with_monocle:

You don’t need to do anything to expose snapctl. It’s available at /usr/bin/snapctl from inside the snap’s environment. What are you trying to do?

The gnome extension use a snapctl command to confirm the content interface necessary is connected and print an error if it isn’t.

Can you specify the environment variables, or is there another way? :face_with_monocle:

When I remove snapd from stage-packages by using the gnome extension, the program doesn’t launch properly.

Okay, I see :slightly_smiling_face:.

Thank you !

Hint → /usr/bin/snapctl ($PATH env)

Nop ! I thought so, it doesn’t work :slightly_smiling_face:

touch: cannot touch '/home/sagacity/snap/flamerobin/common/.cache/desktop-runtime-date': No such file or directory
/snap/flamerobin/x1/gnome-platform/command-chain/desktop-launch: line 155: snapctl: command not found
ERROR: not connected to the gnome-46-2404 content interface.

The important message /snap/flamerobin/x1/gnome-platform/command-chain/desktop-launch: line 155: snapctl: command not found

I had to add this to make it work (base: core24)

environment:
    USR_BIN: "/usr/bin" # This
    USR_LOCAL_BIN: "/usr/local/bin"
    PATH: "$SNAP/bin:$SNAP/usr/bin:$SNAP/usr/local/bin:$USR_BIN:$USR_LOCAL_BIN${PATH:+:$PATH}"

I don’t know why the PATH environmental variable doesn’t have the /usr/bin path :face_with_monocle: .

It worked too when I left the PATH environment variable intact.