Improving the aliases implementation

@pedronis can you take a look at @kyrofa’s proposal?

FYI, the review-tools have been updated to show a deprecation message, but currently at ‘info’ level which won’t block automated reviews. When the time is right, we can change this from ‘info’ to ‘warn’.

@pedronis - is the time right to adjust the review tools to trigger manual review if specifying v1 aliases?

Was that ever done? Yes, we should definitely be blocking old aliases by now.

No, it wasn’t because I didn’t get an answer. You gave it, so I’ll update the tools accordingly.

What’s the status of support in different distributions now? I have been maintaining old-style aliases in snapcraft.yaml because the last time I looked, distros other than Ubuntu were on older snapd versions that didn’t support the store aliases.

Good question. @mvo?

Hi Folks,

Is there any way to include aliases in the snap package?

I tried to use the configure and install hook to run the script with the “sudo snap alias” stanza, but got the error “snap hello has install-snap change in progress.”.

Can anyone suggest a workaround or correct way in which hooks may be used?

Thanks in Advance, Eugene

Please have a look at the documentation, specifically https://snapcraft.io/docs/deprecation-notice-5

Just FYI, a snap will obviously not be able to change the user’s environment and create an alias itself. Aliases can either be created manually https://snapcraft.io/docs/commands-and-aliases#p-19557-application-commands or automatically if approved by the snap store (where still if there is a conflict and alias would not be created).

Hi,

Thanks for the answer.

Actually, I want to create manual aliases for my snap with the install procedure. It is possible to create a symbolic link to /snap/mysnap/current/usr/local/bin/mysnap with the install hook, but I’m not sure that is the correct way. When I tried to use the “snap alias” shell command with the insall hook, I got the error: “snap hello has install-snap change in progress.”

Thanks, Eugene

There is no way to do this from an install hook, you will have to open a store request to get aliases granted by the store team, then they will be put automatically in place by snapd at install time.