Requesting automatic alias for dotnet

Since there is a dotnet snap and two snaps that provide the ‘dotnet’ alias, I decided to look into how snapd behaves in various situations: Process for aliases, auto-connections and tracks

"

  • if a snap is installed with an alias, then installing a snap with the name of the alias (ie snap install ) results in the snap being uninstallable until the alias is removed with snap unalias
  • if a snap is installed that has an automatic alias that matches the name of an already installed snap, then installing the snap with the alias results in the snap being uninstallable (this may be a bug, but it is safe)
  • if two snaps have an automatic alias with the same name, the second snap is not installable until the first’s alias is removed with snap unalias

"

So, in terms of these three snaps:

  1. if dotnet-runtime or dotnet-sdk are installed, dotnet is not installable until the ‘dotnet’ alias is removed
  2. if dotnet is installed, dotnet-runtime and dotnet-sdk are not installable
  3. if one of dotnet-runtime or dotnet-sdk are installed, then the other one is not installable until the first’s alias is removed

@niemeyer - there is a bug here since with ‘1’ you can install all three if you install dotnet-runtime and dotnet-sdk first (and unaliasing ‘dotnet’), but with ‘2’ you can only install dotnet. I suspect the correct behavior is if a snap declaration grants an auto-alias, we should warn but not grant the alias if it is already taken (covers ‘2’ and ‘3’). For ‘1’ we should error, instructing the user to unalias, thus making the snap with the name of the alias installable.