`snap` should provide functionality to find non-installed snap which contain known file (analog of `apt-file search`)

Bug #1748633 reported by Norbert
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
snapd (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

Steps to reproduce:
1. Install Ubuntu 14.04 LTS, 16.04 LTS, 17.10 or 18.04 LTS
2. Try to use `snap` to search files, which are included to non-installed snap (analog of `apt-file search`)

Expected results:
* snap has functionality similar too `apt-file search`

Actual results:
* snap do not have functionality similar to `apt-file search`

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: snapd 2.29.4.2
ProcVersionSignature: Ubuntu 4.4.0-112.135-generic 4.4.98
Uname: Linux 4.4.0-112-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.15
Architecture: amd64
CurrentDesktop: MATE
Date: Sat Feb 10 17:26:15 2018
InstallationDate: Installed on 2018-01-04 (36 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
SourcePackage: snapd
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Norbert (nrbrtx) wrote :
tags: added: artful bionic
Norbert (nrbrtx)
description: updated
tags: added: trusty
Revision history for this message
Oliver Grawert (ogra) wrote :

this apt behaviour might conceptually not be feasible for snaps, do not forget that snaps usually ship their dependencies included ...

something like a "snap find-file npm" could give you 1000s of useless results (simply every node based snap in the store), you would simply end up with massive duplication.

while an "apt-file search libpng1.2" will only return the few apt packages that actually ship libpng (which will then be used via the binary package dependency system), in the snap world it would simply return every graphical app including this lib in the snap (due to the fact that snaps explicitly forbid dependencies you will likely never have something like a libpng-snap). dependency resolution of snaps happens via parts at build-time in snapcraft, not at run-time via binary package dependencies like in the apt/dpkg world.

Revision history for this message
Seth Arnold (seth-arnold) wrote : Re: [Bug 1748633] Re: `snap` should provide functionality to find non-installed snap which contain known file (analog of `apt-file search`)

On Sat, Feb 10, 2018 at 05:34:48PM -0000, Oliver Grawert wrote:
> something like a "snap find-file npm" could give you 1000s of useless
> results (simply every node based snap in the store), you would simply
> end up with massive duplication.

Perhaps one is looking for snaps that have a vulnerable library or
specific data contents. "useless" is highly subjective.

Thanks

Revision history for this message
Oliver Grawert (ogra) wrote :

yeah, well, i simply think the sheer amount of returned data will make it useless to standard endusers (compared to apt-file which will return a handfull of packages due to the different design of the packaging format)

Revision history for this message
Oliver Grawert (ogra) wrote :

also ... while in deb packages you will have a guarantee what the "libz.so.1.2.3.4" binary contains, how will you know that the 8474583754 returned "libz.so.1.2.3.4" form a

"snap-file find libz.so.1.2.3.4"

is actually returning info about the same binary ?

some snaps might use libz.so.1.2.3.4 from a binary deb from the archive, others might build upstream without any patches and others again might build upstream with patches, all binaries your file search would be named libz.so.1.2.3.4 but you will not actually know if their binary content is identical ... how would "snap-file search..." know *which* binary libz.so.1.2.3.4 you actually want to find ...

Revision history for this message
Ian Johnson (anonymouse67) wrote :

I can see the use case here, but I tend to agree with @ogra that it is not as useful as for debs and the sheer quantity of the output will make it difficult to actually do anything useful with the output. Setting as wishlist for now, if there are additional use cases for this feature, please feel free to comment on this bug or create a post at forum.snapcraft.io where we can discuss this with snapd architects.

Also note that this feature would require work from the snap-store team as well.

Changed in snapd (Ubuntu):
status: New → Triaged
importance: Undecided → Wishlist
Norbert (nrbrtx)
tags: added: focal groovy
removed: artful
Norbert (nrbrtx)
tags: added: hirsute impish
removed: groovy trusty
Norbert (nrbrtx)
tags: added: jammy
removed: xenial
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.