App command not found

Although I resolved the issue, it was frustrating enough to share the story such that docs and messages can be improved.

While with core18, this snippet worked:

    command: swipl

After upgrading to core20, it complains it cannot find the command swipl for the app swipl. The file exists in /root/prime/usr/bin/swipl. It is a (working) symlink though.

Using an absolute path results in the misleading message below.

Failed to generate snap metadata: The specified command '/usr/bin/swipl-win' defined in the app 'swipl-win' does not match the pattern expected by snapd.

What did work is a relative path:

    command: usr/lib/swipl

Note that for another project I have a core22 snap that includes swipl. There I had the same issue, but an absolute path for command resolved it.