Improvements in snap download

It would be nice to make snap download consistent with snap install for end users.

Most snap commands make a call to the system’s snapd where the bulk of the processing takes place, but snap download is different - the download is handled entirely by the snap CLI. I believe this is only because access to the user’s file system is required when writing the snap’s binary and assertions.

Unfortunately, processing the download in the CLI means it may behave differently to snap install due to various bits of configuration typically only known to snapd:

  • store API URL
  • store tenant name
  • user’s auth
  • device auth

To improve consistency, the above configuration should always be applied for a download, with the user specifying the following on the command line:

  • snap name
  • channel or revision
  • architecture

Therefore, snap/snapd probably needs to do one of the following:

  • expose (safely) the snapd configuration to the CLI so it can perform the correct download
  • proxy the download via snapd
  • something else entirely :slight_smile:

Note: proxying is somewhat complicated by the need for a progress meter in the CLI and the download process that involves deltas, retries, resumes, etc.

Would a download be backed by a Change?

Last updated 1 year, 3 months ago. Help improve this document in the forum.