From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 2FleGpo+imPFkAAAbAwnHQ (envelope-from ) for ; Fri, 02 Dec 2022 19:06:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iLRYGpo+imMXggEA9RJhRA (envelope-from ) for ; Fri, 02 Dec 2022 19:06:18 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1997815F5D for ; Fri, 2 Dec 2022 19:06:18 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1APv-0007Vh-49; Fri, 02 Dec 2022 13:05:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p1AJF-0006HX-2G for guix-devel@gnu.org; Fri, 02 Dec 2022 12:58:49 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p1AJD-0006Vz-93 for guix-devel@gnu.org; Fri, 02 Dec 2022 12:58:48 -0500 Received: by mail-wm1-x334.google.com with SMTP id t1so4055072wmi.4 for ; Fri, 02 Dec 2022 09:58:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=+Lxd/UZt2CPHiMMqet0d3ADFjMIJK7lASozsfYG8cEg=; b=dgI9Wz1ymUZykyl4HFWEgMmYWVvwZgvYa2s4DNdL/QI5vo17P1EFauPqao/i1ll9Bs dx4S2YAKjNJaGtPxMzzkXGnKtzkFkXmSSqwRCGDeZhl0YxNsx/ihqogOFCC3l4tAAHWx 03onqyceH5SFc53zmvpMnadbpr/OeCgtyOuQYlOkj+bzutqbXNBqWs8sjOIAktRGlrSA bFKrpGiz2JOh/usKV94QgBv1Pliva/w4uP08ifAAVzkhwS1zvhCpD02j8GYjCKaeyG0O jNp2cGDucohQPMyRd3oL3noS3GE5bQLnJrLNvi+OtemWgCc2m/HJNuS1iGyJv9iCwf+e jkGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=+Lxd/UZt2CPHiMMqet0d3ADFjMIJK7lASozsfYG8cEg=; b=gW5ridHvbgTYH1pwzUNCyB1Bbx0gFi2YOfT4nnYWN/qZXVREcLAOAjYaILylDcQ/aJ s8k6+g4hnki1S0lB6UmDivkFiHOiV1FQCOtGzPPZrfXmQYHcjgqr7eR2w9hQW822k5pU QcKzKeHjs87l+1lWok9C7SkvinVrT2PNiJ88UCGvYQXph4u003waKm8kvfEUjAT98bXj Vravm7ENVNXp0YlRTkZBMo8SiXCCTBk1WNOk/0ZPqhodg0b83AE9IsZAPkhhEXrDVSUP WmR6TUKk8MDQblkyFQIpAgjT+KHHsvKw1tWxOi+ZLcGfYRXMhb5fX6pksu7LYYO7ZSML LRaQ== X-Gm-Message-State: ANoB5pmDtjQOt1yGv8fE4wKLWm5ZkxZK981phh4omdwGP6m8kPG+J27X Y6p4TaVA1xxiQpj3m3JzJ15Ok/ir+/Y= X-Google-Smtp-Source: AA0mqf46rK7DumPczg4o9c1Mh7o4hRNdM7j9B9PgPc2h/hm8TuaiO5e9kvbRrjsEOAs3bvHvYrMzgQ== X-Received: by 2002:a1c:f606:0:b0:3b4:bf6d:f9ba with SMTP id w6-20020a1cf606000000b003b4bf6df9bamr52232917wmc.133.1670003924762; Fri, 02 Dec 2022 09:58:44 -0800 (PST) Received: from yavin4 ([2a01:e0a:1c8:8a40:2394:a743:1507:85ab]) by smtp.gmail.com with ESMTPSA id k9-20020adfe8c9000000b00241f632c90fsm8854540wrn.117.2022.12.02.09.58.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 09:58:44 -0800 (PST) From: antoine.romain.dumont@gmail.com To: guix-devel@gnu.org Subject: Re: File search Date: Fri, 02 Dec 2022 18:58:42 +0100 Message-ID: <87pmd1r8kt.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=antoine.romain.dumont@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 02 Dec 2022 13:05:41 -0500 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list 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+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670004378; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=+Lxd/UZt2CPHiMMqet0d3ADFjMIJK7lASozsfYG8cEg=; b=dHQsg0ODkHtaStU86xkVNQzY+9DROFbJ9KuYCLTpar+UDZcMOVPZ+YsGGhrDuQDCg1vmCj NAH6zqHm40WQB49PDyZLnK1gvhSQmt8FkNqjyxbXCg2BHRs9wgdFyZmmEMhTuqiG+sYcAJ KKhI1rgU1TcGkl7uzHsCO0nXiwRw7o8RN+A0pKrRROtkctvjG9AlaMubQxr3ZkNszBCakH +PxpEoNGpW78YpSvVra4V57MiqxU4w0almsu3t+RgHYV+GCLP4ZzUmdLLYWcpziFUiOTLV Awe9JD0HMpiiMwRBJhcVJH7BaV6R2E8yrhbTGJnyh5LDMDjgMhLm5sOtLI0lEQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670004378; a=rsa-sha256; cv=none; b=XZXDDGrCMyOYILQw01mbAI+VAFiVqJ7IM3GYvJ/XYP1+WNuSE3AVgMUQ3V1Ef1iwQ2VLPf xZG1Q85tjsZ9yrKQChGpF0box6RAkQmfF28Tw94o+ITH9R1udAU8S8VP+EOEYnh1BEo1by Be41cK5k6A8IXFoo7ns0BeRCAVVWblhkWLnmVBVFn/eDyfdZcch/M/bRwmcLpg/1xe/M9C o7Ob1kqmlMYAl8mh2fqSadQ31g9n7gKPJvaEt6UmtO6Ed5UB/ryCkIgfFjN4VjVREwe4Yg NUJ56VSBqcf6LV6k3lauPvqwMDneuHPihcEv9vsYhxEUhZ48hTHbgCNEeWP1wg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=dgI9Wz1y; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.57 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=dgI9Wz1y; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1997815F5D X-Spam-Score: -3.57 X-Migadu-Scanner: scn1.migadu.com X-TUID: ww5DpmrxTQTF --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Guix! Guix is top so thanks for the awesome work! Just to give some feedback on this thread. That's a good news that the file search functionality in the radar. > Lately I found myself going several times to > to look for packages providing a given > file and I thought it=E2=80=99s time to do something about it. I've finally started to set up my machine with Guix system (and Guix Home). Finding out where such program or cli is packaged is definitely something that I need to port my existing use (from mainly nixified debian or nixos machines) to Guix. And to answer such question, I used existing "offline" programs in my machines. I've bounced back and forth between `nix-locate` and `apt-file search` to determine approximately the packages in Guix (names aren't usually that different). Hence, as a user, it's one of my expectation that the Guix cli provides some equivalent program to lookup from file to package ;). > The script below creates an SQLite database for the current set of > packages, but only for those already in the store: > > Guix repl file-database.scm populate > > That creates /tmp/db; it took about 25mn on berlin, for 18K packages. > Then you can run, say: > > Guix repl file-database.scm search boot-9.scm > > to find which packages provide a file named =E2=80=98boot-9.scm=E2=80=99.= That part is > instantaneous. > > The database for 18K packages is quite big: > > --8<---------------cut here---------------start------------->8--- > $ du -h /tmp/db* > 389M /tmp/db > 82M /tmp/db.gz > 61M /tmp/db.zst > --8<---------------cut here---------------end--------------->8--- For information, in a most recent implementation (@civodul provided me in #guix-devel), I noticed multiple calls to the indexation step would duplicate information (at all levels packages, files, directories). So that might have had an impact in the extracted values above (if ludo had triggered multiple times the script at the time). Jsyk, I have started iterating a bit over that provided implementation (and fixed the current caveat mentioned), added some help message... I'll follow up with it in a bit (same thread) to have some more feedback on it. > How do we expose that information? There are several criteria I can > think of: accuracy, freshness, privacy, responsiveness, off-line > operation. > > I think accuracy (making sure you get results that correspond precisely > to, say, your current channel revisions and your current system) is not > a high priority: some result is better than no result. I definitely agree with this. At least from the offline use perspective. I did not focus at all on the second part of the problematic ("online" and distribution use). > Likewise for freshness: results for an older version of a given > package may still be valid now. Indeed. Cheers, =2D- tony / Antoine R. Dumont (@ardumont) =2D---------------------------------------------------------------- gpg fingerprint BF00 203D 741A C9D5 46A8 BE07 52E2 E984 0D10 C3B8 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJUBAEBCgA+FiEEvwAgPXQaydVGqL4HUuLphA0Qw7gFAmOKPNIgHGFudG9pbmUu cm9tYWluLmR1bW9udEBnbWFpbC5jb20ACgkQUuLphA0Qw7iswg//faBo+XjNnTiZ K9VCuXuxDdnV4aUh6H+CRn/W0bKBO7Gi3GYlOcqcxvf8XwWIWCYBanuCnLEuL0JK VKfVwf6OT2QFI6jMVKBc9LgIkXNuq6uE3LtsabZxcqDh0ubCcGXrb7LTjpx549qM ptFqpGwDrjV7Jo12Cljcwe+dLYkjmGV4Ods7JBBAAVJmvmsqiNLeNqpxh8/TMF2E 5/Ns7qBPxFiY82mw8mw4YWv66jiF2aPnYCR5QPpYtORbpSJOdXhGG+gCiYNo0KIr V36KL2NUOLt9QkXvXsJif9OvB0LbUpbtmLViKaAOkoc//pd1/7ocMTKJom+Rm2sd VUKjtE2P2B/tgJMR8h1nJdQFQCydUddBJ6Mhz06LGvvHs5KH/VBBSTNT2H0Jo/QL FHe0g0XYsfmNy7M/zmzmzIl+ZxNRKpvQIh4EY6oFEtrH7CJxHW+FhelRDt+d+wgm O5g2NS6RE5MYJUV7E+9s9z/XCd8sTB0adx5NvVKVJbR9HaohVgJ8oqA+tI1SPk3W ph3AipWgp6lvX99P7fONaOnmLpRdw2M/Sanl65R04GOX87d5MKB9+HagKxALSfdA KFIPsPPwrrgXxkQMPqfsgPaYDNG0h2UEawzf9MpoXIv/+SNUEU9GcJvSdt3abwzc fc7YzQ+/ko73DlBaW977xagYinWBSng= =1oBg -----END PGP SIGNATURE----- --=-=-=--