Permission problem trying to package Bottles

Hi all snapcrafters!
I’m trying to package my application as a snap but I can’t get an executable build.

This is my current snapcraft.yml: https://github.com/bottlesdevs/Bottles/blob/4867db1e00f91e5708ecf7f753d5b8a3560141e5/snapcraft.yaml

But when I try to run the dangerous installed snap, I get the following error:

`/snap/bottles/x2/snap/command-chain/snapcraft-runner: 6: exec: /snap/bottles/x2/usr/local/bin/bottles: Permission denied`

I have been around this forum for about a month, testing different fixes of those who have had the same problem as me but none of them seem to solve the problem.

I also tried using the desktop-launch command:

..
apps:
  bottles:
    command: bin/desktop-launch bin/bottles
..

but the following error come out:

Failed to generate snap metadata: The specified command 'bin/desktop-launch bin/bottles' defined in the app 'bottles' does not exist.
Ensure that 'bin/desktop-launch bin/bottles' is installed with the correct path.

I also tried using core20 but the behavior does not change.

My application is compiled and installed via meson and ninja and generates a binary in /usr/local/bin which works in other packages.

Who helps me understand where (for sure) I’m wrong?

The configuration is not complete, I know that once this problem is solved there will be others, for example for libhandy but I would like to get to the execution before proceeding to complete the configuration.

If using desktop-launch, it should be something like:

    command: bin/desktop-launch $SNAP/usr/local/bin/bottles

But I don’t think you have desktop-launch installed given the yaml. Perhaps you want to use a gnome extension? https://snapcraft.io/docs/gnome-3-28-extension

I have completely missed this:

..
apps:
  bottles:
    command: bin/desktop-launch $SNAP/usr/local/bin/bottles
    extensions: [gnome-3-34]
..

now it runs and I can move on to the next error. Thanks!

2 Likes

Just thought I’d mention that when using extensions, you don’t need to specify desktop-launch manually; but if you do specifically it manually, it’ll effectively be running twice resulting in slower startups and possibly some undefined behaviour. I’d recommend removing it from the command entry in this instance.

(Internally, extensions use an hidden command-wrapper entry instead, you can use snapcraft expand-extensions to see the end result and what else the extensions do, such as adding theme content snap entries).

3 Likes