From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Neidhardt Subject: Re: Package file indexing Date: Thu, 02 Jan 2020 18:12:01 +0100 Message-ID: <87imlt3hr2.fsf@ambrevar.xyz> References: <20190314204941.GA21065@jasmine.lan> <87mulx9kuv.fsf@nckx> <87zhpx846u.fsf@ambrevar.xyz> <87bm21y2s2.fsf_-_@gnu.org> <87imw7cpe7.fsf@bababa.i-did-not-set--mail-host-address--so-tickle-me> <87pnqdhkpf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:34081) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1in413-0004JN-SJ for guix-devel@gnu.org; Thu, 02 Jan 2020 12:12:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1in412-00057t-5e for guix-devel@gnu.org; Thu, 02 Jan 2020 12:12:09 -0500 In-Reply-To: <87pnqdhkpf.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: Guix-devel --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello again! I'm resurrecting this since I've just started working on this as part of the NGI application! :) >>> Internally it=E2=80=99d call =E2=80=98guix substitute=E2=80=99 to fetch= the file index from >>> the substitute server, check its signature, cache it locally, and then >>> look up the file. What about storing the file listing in the narinfo instead? Is this doable? If so, then it should be quite simple to implement, it would basically mimic "guix size." >>> You should look at how NixOS does it for its =E2=80=98command-not-found= =E2=80=99 support >>> (I think it=E2=80=99s part of NixOS, not Nix). IIRC they distribute an= SQLite >>> database, but it=E2=80=99s a pretty ad-hoc mechanism without authentica= tion. I'll see if I can find the code for this. If we embed the file listing in the narinfo as I suggested above, then there we be no point in maintaining a separate database. >> I could work on this, but that seems like a lot of work, especially for >> me who knows nothing about the daemon (but hey, it's a great opportunity >> to learn!). > > Note that the daemon would act as an intermediary, but in practice the > functionality would be very much peripheral to the daemon. IOW, you > don=E2=80=99t need to know about the daemon internals. Any files you recommend looking at to get started? I suppose that "guix/scripts/size.scm" is a good start. Last but not least: previously we suggested adding a subcommand like "guix which" or "guix filesearch". In another thread, Simon suggested that this would be a bad idea and factoring the file search into "guix search" is probably better. For instance, we could do guix search bin/foo and it would report the packages containing the "bin/foo" path. This could mean that we need to adapt the output to display the file listing as well. If listing all files would be too verbose, we can list only the matching files: =2D-8<---------------cut here---------------start------------->8--- name: jami version: 20191101.3.67671e7 outputs: out systems: x86_64-linux i686-linux dependencies: adwaita-icon-theme@3.32.0 clutter-gtk@1.8.4 clutter@1.26.2 do= xygen@1.8.15 + evolution-data-server@3.32.4 gettext@0.20.1 glib@2.60.6 gtk+@3.24.12 libc= anberra@0.30 + libnotify@0.7.7 libring@20191101.3.67671e7 libringclient@20191101.3.67671= e7 + pkg-config@0.29.2 qrencode@4.0.2 sqlite-with-column-metadata@3.28.0 webki= tgtk@2.26.2 location: gnu/packages/telephony.scm:890:2 homepage: https://jami.net license: GPL 3+ synopsis: Distributed, privacy-respecting communication program=20=20 description: Jami (formerly GNU Ring) is a secure and distributed voice, vi= deo and chat + communication platform that requires no centralized server and leaves the= power of privacy + in the hands of the user. It supports the SIP and IAX protocols, as well= as decentralized + calling using P2P-DHT. +=20 + This package provides the Jami client for the GNOME desktop. filepaths: + bin/foo + share/bar/bin/foo-blah relevance: 24 =2D-8<---------------cut here---------------end--------------->8--- That said, some terms may match too frequently. For instance, "guix search lib" would match almost all packages that have libraries and result in a huge, useless output. I suggest the following: =2D Add a "--search-file-paths=3D[auto|on|off]" option. =2D When --search-file-paths is "auto", file paths are automatically searched for against terms that contain a slash. E.g. "lib" won't return file paths but "lib/" will. Another feature that could be nice: list the file paths for the given packages. I think we need a separate subcommand for this, e.g. "guix list-files". Thoughts? Cheers! =2D-=20 Pierre Neidhardt https://ambrevar.xyz/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl4OJGEACgkQm9z0l6S7 zH9KFwf/axqDLkm0IVk0loARpnLq3RNczIPHeojkaZ5+rslDfi0LPj4F9N5NfYd2 Vm6zeAjkXh0/5OoER0IY0V8ZguuEjlRQ9F/R1q3etd8b6H9mu3QSeWBBU9fDZ6gc jlUe1FZ3o2mfZxVOghCoX2/McHzUe17ZVuZhCYEoSOW0m7Hf+NvwFgsFJaas7Pw1 viBHnPJaUaBy5a1vhJM5AJwRadI7VNnjxiHxTBANz5HVw3ihapmfmfQ8djtFd4DE lhSDez4i7ikXxe9secvHXVCtE1PTLGk9yrGugh5UKDT0rTmXZnDJmIkH26walXR+ 4xMYbCkRBCEOeN0FKdC4wmJ8S9fWhQ== =9glK -----END PGP SIGNATURE----- --=-=-=--