Spaces in executable path

When building a snap with base: core20 snapcraft is stricter in the commands that it accepts. This is a problem when you need to either escape a character or include quotes to surround a path with spaces. For example, I’m working on GOG Galaxy Wine right now and I need to include the full path to the executable inside the WINEPREFIX but this has spaces so I need to put quotes around it to prevent the shell breaking it into multiple parameters:

command: bin/sommelier "$WINEPREFIX/drive_c/Program Files/GOG Galaxy/GalaxyClient.exe"

Output of snapcraft:

Failed to generate snap metadata: The specified command 'bin/sommelier "$WINEPREFIX/drive_c/Program Files/GOG Galaxy/GalaxyClient.exe"' defined in the app 'gog-galaxy-wine' does not match the pattern expected by snapd.
The command must consist only of alphanumeric characters, spaces, and the following special characters: / . _ # : $ -
Run the same command again with --debug to shell into the environment if you wish to introspect this failure.
1 Like

This is being tracked in https://bugs.launchpad.net/snapd/+bug/1882839 and is largely a snapd design choice which would have to be modified. It’s possible that snapcraft could do something else to generate something that is valid with snapd (effectively reverting the new core20 behavior AFAICT), but I think this is better served as a snapd bug.

3 Likes

Thanks for the pointer. I’ve commented about quotes there, to add to the record :slight_smile:

1 Like