From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id aNqAHkCboWNpiAAAbAwnHQ (envelope-from ) for ; Tue, 20 Dec 2022 12:23:44 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qHubHUCboWPeGAEAG6o9tA (envelope-from ) for ; Tue, 20 Dec 2022 12:23:44 +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 935781AB74 for ; Tue, 20 Dec 2022 12:23:43 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7aZ1-0004qP-Ix; Tue, 20 Dec 2022 06:13:39 -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 1p7aYz-0004pj-FZ for guix-devel@gnu.org; Tue, 20 Dec 2022 06:13:37 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p7aYx-00045O-M6; Tue, 20 Dec 2022 06:13:37 -0500 Received: by mail-wr1-x435.google.com with SMTP id h11so11346581wrw.13; Tue, 20 Dec 2022 03:13:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=yGd05g6wjODy2q0iggHp2Y888WjaoTWVBfumIDF+cvI=; b=mFnnNHEYsBmK+SGEHOZa5UoCiz7D/hbiV5fE5hI8mEFgfiSsxj4Rc4phD3hUvXRce5 Ip7+XLvY/hHE7poLKvD5TFbTYInhXZCo2ES3BhCdWiN9yV9aaZo3kCP/ABBye3c8a6xV bytva/vzzMv3y+5j0JwCSD7RAfNAnXNb3WYzYaJuJpMqryj8/2ekaPHIRNayxZcrn+Nz gi0+q9+dZwf52IsooBpxFXJAjU3w6DQIRXBQOw+fGXFAo7uGAaQv2rh16PTVS6Uulmif HiuksGbhjxrsyH6wrgXPu0fNOnoa+WjbGaBXg6RXHA8GscUobKJF5EDhMkMHhb0AEFsf fx9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yGd05g6wjODy2q0iggHp2Y888WjaoTWVBfumIDF+cvI=; b=OdJMftO34xAqA9URhHv/l/5MJW5l1JZVqL6x5cdkFQZevYWKQZq/cRUAAi53N6wvkR V/kvJtC680o0HZG5KPymLXTyYsinbPYv3LRiSZ6EUH33L1mKtXAm3UdDeDJajNJoM/18 qUovEVSHhevmc8qFbVanqYjSGiecJW6AtPmrNesSbJt6OWlXNeNnyi5dMN8pTKxBWwKz /e5Vrfwz6k7HOkYSZVLdCFiPaBBLQh0AYSh8wODiEp4Vwg+bIbjKlrTbEugaYaUCpGwX FWlvjL6ZXtYb/6LU+paP3KW7+XO4L4Ou+0Jk17UwFuUMYYaJ2ClkukPzkaWpfn1ERsqE 0NFw== X-Gm-Message-State: ANoB5pmBLVY0/CZ5L4Tgcnv+KW7PnHFICXg0qUdAAj63vMdyQs18/XKt v1oTDJkOSp6mZ5HYFCot/EDYJcqbpk8= X-Google-Smtp-Source: AA0mqf7TEt3V0ctMp7BDZotN3zP2NwWplY0UVFV+krZ35RKEA7G+RvEnH4iOhmgxcWMNbW01wggtmg== X-Received: by 2002:a5d:6f1d:0:b0:242:67f2:9af7 with SMTP id ay29-20020a5d6f1d000000b0024267f29af7mr30266200wrb.69.1671534813569; Tue, 20 Dec 2022 03:13:33 -0800 (PST) Received: from yavin4 ([2a01:e0a:1c8:8a40:2394:a743:1507:85ab]) by smtp.gmail.com with ESMTPSA id ck5-20020a5d5e85000000b00257795ffcc8sm12548352wrb.73.2022.12.20.03.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 03:13:32 -0800 (PST) From: "Antoine R. Dumont (@ardumont)" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Subject: Re: File search In-Reply-To: <87bknzccia.fsf@gnu.org> References: <87pmd1r8kt.fsf@gmail.com> <87mt85r7h8.fsf@gmail.com> <87lenonydz.fsf@gnu.org> <877cz7qg80.fsf@gmail.com> <878rjkn949.fsf@gnu.org> <87pmcsriwu.fsf@gmail.com> <87v8mi2q9t.fsf@gnu.org> <87pmck7g6y.fsf@gmail.com> <87bknzccia.fsf@gnu.org> Date: Tue, 20 Dec 2022 12:13:31 +0100 Message-ID: <87a63i72g4.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::435; envelope-from=antoine.romain.dumont@gmail.com; helo=mail-wr1-x435.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-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-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mFnnNHEY; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671535424; a=rsa-sha256; cv=none; b=Lro+lv1BEXcKQ0uogwvye1wchC4SAPq4RX/6NHIfdj/sAQfoDI47RDn5Aehm5SvCftnIpW EdUcbpBvlB6MPCCjx+L0bZzF3oxY8l4NIH2VTz0386D6auQ9KJOmZ5qul6HVfCgNNOFjnX 69S5fxEFSXr8U0UIsmtftpCgDPZ2rD88GOeUOy8oD5b4NfwR62TyYGhJNtr88xZ8bPKQeA ArtrZ7snU1+pOe3dNGWdZrJ3qxrpkfrO0IAQZuzNlVZRri7jFvbFYD9HVHBBmF2a4Pscnv cumLZOjXLFUnkczc63nDzLFd8/C99vWUoPLnXLGVbZRFH1VLbQCVmz+0u93VuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671535424; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=yGd05g6wjODy2q0iggHp2Y888WjaoTWVBfumIDF+cvI=; b=MLLTbYLOFRylOD9uH+XhfjS6oJYgTu3F4lYxEXQxf6EQme4eThyg4qS6QZ38V7OnyVtK1Z HObSth3+Pt4QLen4J/9l2dSw6trjWAk16NPDa4S+0sts8KL0u6suNhpJmljENqtMeAujLP 0mX7/W0LQ5ACDeNvC2ARs9bwkbxItdMLZQnmyMB+bGlOtQSYZGneA8uJKWQ/fpAoBon8vj 2eAR5C5H6hD8YtUJWvwj04h5HqKlokfC4OKZk1SdL0UDpcsjykjd9/8TEHH9FgQYqxjktq 9o3XdohQeRJy+FlDDSeF63Kg1mScK43SZMGh1Dg8HNR7CzPcEVs7sSvbdg+rjA== X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mFnnNHEY; 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"; dmarc=pass (policy=none) header.from=gmail.com X-Migadu-Spam-Score: -9.42 X-Spam-Score: -9.42 X-Migadu-Queue-Id: 935781AB74 X-TUID: 7Hk3HwU7zvIp --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Guix, Thanks for the feedback! Note: @civodul, assuming you are subscribed to the ml, I currently kept you as a `To:` recipient but I can drop you from it, right? I'm "also" subscribed to the ml so you may drop me from the `To:` too (if i'm not mistaken). Ludovic Court=C3=A8s writes: > Hi Antoine! > "Antoine R. Dumont (@ardumont)" > skribis: > >> Here is the rough changelog: >> >> - The local db cache is now versioned. Migration will transparently >> happen for users at each index command calls (if need be). > > Perfect! > >> - The cli parsing got rewritten to be more flexible (inspired from >> existing code from guix, notably `guix home`). >> >> - We can now choose the indexation method using the >> `--with-method=3D{store|manifests}` flag. The "manifests" method is the >> default, seel the help message for more details). > > Excellent. (I think we can call it =E2=80=98--method=E2=80=99, without = =E2=80=9Cwith=E2=80=9D.) sure. >> - Finally, the indexation methods are displayed using a progress bar. > > Yay, I love progress bars. :-) I have some work to improve the implementation to have more details in the messages (typically make the "prefix" parameter of `progress-report/bar` be a callable/function [1]...). If that's of some interest, i'll push forward (in another patch maybe?). I stopped at the moment 'cause i had some strange issues with my env (where i could not make guile see the changes for some reasons...). Anyway, that's of lesser priority than the rest so... [1] or whatever the name is in guile context ;) >> Heads up, I did not yet address the "output" part. Thanks @zimoun for >> the clarification btw ;) > > Future work. ;-) ok! If i'm getting out of all the modifications i need to do, and if I have some energy left, I might attend to it too ;) >>> In the package case, the number of packages is known ahead. >> >> @civodul For the index 'store' implementation, ^ I did not find that >> information. > > (length (all-packages)) gives you the total number of packages you=E2=80= =99re > going to traverse. =E2=80=98all-packages=E2=80=99 is not instantaneous, = but as a good > approximation the time spent in =E2=80=98all-packages=E2=80=99 can be ign= ored. ok. I missed that. Although, the current call to `fold-packages` does some package filtering first. So, I guess that's why you call `(length (all-packages))` an approximation (no filtering on that call), right? >> So, as a costly implementation detail, I'm folding over all packages >> first to know the total number of packages (for the progress bar). And >> then another round trip to actually do the insert. > > You could build up the package list just once and call =E2=80=98length=E2= =80=99 on it. I explained myself wrongly. That's what it is doing currenly. It does that ^ folding and keep the packages list, then do a `length` call on it to have the exact number of entries. And then does the actual loop on that list to insert them in the db cache. I naively thought that the `length` call on the list would cost one round trip O(n), isn't it so? Or is there some memoization somewhere? >> Hope you'll find it mostly to your taste! > > I do! \o/ >> Note: I gather we'll rework the commits at some point (when it's ready) >> so I did not bother too much right now. > > I think at this point we could consider integration in Guix proper, > under =E2=80=98guix/scripts=E2=80=99. For that we could dismiss commit h= istory. Fine with me. I'll do the adaptations to make it a script then. > That=E2=80=99ll entail extra work (d=E2=80=99oh!) such as fine-tuning, wr= iting tests, > and writing a section for the manual. Yes, i'm fine with that. FWIW, I tried to have a look at how current unit tests were written last week. I did not grok it entirely yet. I saw some script tests generate some guile and I got lost there ;) I'll have to double check. I'll probalby need some help for testing and documentation. I guess asking questions on irc is fine for that part, right? > The other option, if you prefer, would be to keep it in a separate repo > as an extension that people can install. To me that would be more of a > temporary solution because I think it=E2=80=99s a useful feature that oug= ht to > be provided by Guix proper eventually. > WDYT? :-) If it's temporary then i'm fine with trying to do the extra work to merge the work with proper Guix ;). Although, zimoun, down thread has some interesting remarks too. I'll let you discuss those. I have another extension idea [1] that might help anyway. So we'll have another opportunity to entertain the guix extensions features (if the idea is interesting to proper Guix). [1] `guix bug-report [--with-uname|--with-version|...]` > Ludo=E2=80=99. 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+FiEEvwAgPXQaydVGqL4HUuLphA0Qw7gFAmOhmNsgHGFudG9pbmUu cm9tYWluLmR1bW9udEBnbWFpbC5jb20ACgkQUuLphA0Qw7hfQg//VDYwXJC90GGQ cJnfII28+elyvpJoORVr5ZVaq9iXnVH2WcP6eRcC/IC5LEx8+mPUygRHaiUTbzzm Bd6woNSS0vNlqCalSOJVOS1d6TuVz057inGZ39aszf/1lI85ZFuI99bWDZhNdl3h TcYQC7++HAeq5kmuRzFmw33KBaGIfwwiBzxJIkRwGe/l8SouJMto3ku+TCLLh6HW s/KUYURODsXa1PQCD9hS+tqwMMr6xh7xBS1WTcXc2d03E/crHrOcCnyEPwMk2ef7 ++zox5PxBTxKyuS/oMqRuzXPoUx68Z5c6MIiTxxFASTsN/z6rH0EWrJMNj7rfEpR q5eKU+ry7+QVfnRpHDfOv75xMhmxlMmj6j/LXB9m7VOuCv4LkINO+b3tx+MLde4G DoAAhn7NZZH1A7Dhssd44NTbMcFiFtQiTFmKnxiFwFIpuP92PYdbFFrqYTN9sxG+ ZsU4AgW6u4lk1n/YneFzk018Isz+YPc6Xw+MIZly/wyN2UKvIXeIe1o/geXcwzh6 C4XClrnrmgjNgD8qBDynn+2JQk7C62Ym17kwLshPoYyIZ7HvXjN6SbtK3A3qlzgD QtyyoqjYxG65ShKzi4QLsbynfCkFr56ZOGckQkEYDDbrYHEDCKH8UulsCGE3le85 tOvvKvNtajk4GwDI5M7nhihJG++JhyQ= =DLrq -----END PGP SIGNATURE----- --=-=-=--