Comment 6 for bug 1701232

Revision history for this message
Daniel Manrique (roadmr) wrote :

Hi Dave!

"snap find" has an architecture parameter which snapd is likely setting to the value of the invoking system's architecture. I question the value of extending the API to search in architectures other than the one we were given - perhaps snap should say "no snap found for 'blah' on architecture 'whatever'" to clarify the search parameters that were used, and point to the possibility it exists in other architectures but I wouldn't go further than that.

Likewise, "info" supports an architecture parameter; here, actually, if it's not given we do return all the information for the snap. If it is given, the API still returns something:

$ curl "https://api.snapcraft.io/v2/snaps/info/pi?architecture=amd64" -s -H "Snap-Device-Series: 16" -H "Snap-Device-Architecture: amd64" | jq .
{
  "channel-map": [],
  "default-track": null,
  "name": "pi",
  "snap": {
    "license": "unset",
    "name": "pi",
    "prices": {},
    "publisher": {
      "display-name": "Canonical",
      "id": "canonical",
      "username": "canonical",
      "validation": "verified"
    },
    "snap-id": "YbGa9O3dAXl88YLI6Y1bGG74pwBxZyKg",
    "store-url": "https://snapcraft.io/pi",
    "summary": "Raspberry Pi gadget",
    "title": "pi"
  },
  "snap-id": "YbGa9O3dAXl88YLI6Y1bGG74pwBxZyKg"
}

In the "info" case it seems snapd could say "this snap exists but not for this architecture" (actually if I don't filter by architecture I do get the entire channelmap and from there snapd could plausibly say "not available for this architecture but available for these other ones") though again I am unsure of the value - if a snap I'm interested in is available only for s390, I'm not about to go buy a mainframe so I can run it :).

A possible fallback would be to tell the user to visit the snap's page on the web; supported architectures are clearly indicated there:

https://snapcraft.io/libreoffice

I think API support to enhance this is present in the snap store, so I'll leave the store task as fix released. I also remember we have discussed this at length with Gustavo and other stewards of the snap ecosystem, it's probably fair to point out the imperfect user experience in the cases you mentioned but a change needs to be discussed with other stakeholders as well.