Command resolution warnings - core18 vs core20

Something I found when messing around today with a test snap and changing base from core18 to core20.

For this snapcraft snippet:

    command: bin/wayland-launch $SNAP/usr/bin/glmark2-wayland --fullscreen

With core18 you get these warning:

The command 'wayland-launch' for 'wayland-launch $SNAP/usr/bin/glmark2-wayland --fullscreen' was resolved to 'bin/wayland-launch'.
The command 'wayland-launch $SNAP/usr/bin/glmark2-wayland --fullscreen' has been changed to 'bin/wayland-launch $SNAP/usr/bin/glmark2-wayland --fullscreen'.

With core20. you actually get a hard failure:

Failed to generate snap metadata: The specified command 'wayland-launch $SNAP/usr/bin/glmark2-wayland --fullscreen' defined in the app 'glmark2' is not executable.

If I change the snapcraft config to include the automatically fixed suggestsion when using core18:

    command: bin/wayland-launch $SNAP/usr/bin/glmark2-wayland --fullscreen

…then re-build with core20, everything works fine, no errors.

Questions are:

Why does building with core20 produce the hard errors, and not the warnings ? Is the configurable, or am I missing something more fundamental ?

The error message for the hard failure with core20 is not great - not executable feels misleading [ the file is there and executable ] , perhaps not in expected location or some such might be better ?


1 Like

For core20, we wanted Snapcraft to make fewer assumptions and modifications of the commands the user specified. Previously Snapcraft would rewrite the commands (and sometimes create wrapper scripts) without notice, so we added logging to indicate the rewrites that were happening. In core20, we stopped rewriting commands altogether.

I’ve reproduced this, and you are correct, it’s a misleading error. It should indicate that command is not found instead. We will fix that, thanks for the feedback :smiley:

Awesome - thanks for info and listening to the feedback :slight_smile:

Cheers, Just