From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: Re: Inverted index to accelerate guix package search Date: Tue, 21 Jan 2020 11:46:31 +0100 Message-ID: <871rrtf5o8.fsf@gnu.org> References: <87a76r68u6.fsf@ambrevar.xyz> <87sgkgxwir.fsf@elephly.net> <87a76ncvg0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:37497) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itr3O-0004PZ-Ms for guix-devel@gnu.org; Tue, 21 Jan 2020 05:46:39 -0500 In-Reply-To: (Arun Isaac's message of "Sat, 18 Jan 2020 00:59:05 +0530") 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-mx.org@gnu.org Sender: "Guix-devel" To: Arun Isaac Cc: Guix Devel Hello! Arun Isaac skribis: >> What is not clear to me right now in both implementations are. >> >> 1. >> How to update the index. >> Give a look at the "pull" code and the ~/.cache/guix folder. > > We don't "update" the index. At every guix pull we create it > anew. Currently, generate-package-cache in gnu/packages.scm does > this. generate-package-cache is called by package-cache-file in > guix/channels.scm. package-cache-file is a channel profile hook listed > under %channel-profile-hooks. Indeed. To build the search index, you could add another hook in there. But note that it would have to be either fast or substitutable (the latter is tricky because people can have arbitrary sets of channels). > Now, what I am unclear about is how to test my sqlite index building > code without actually pushing to master and running a guix pull. I will > go through the various tests in Guix and see if I can figure something > out, but any pointers would be much appreciated. You could write a hook similar to =E2=80=98generate-package-cache=E2=80=99 = and commit it locally. Then you can run: ./pre-inst-env guix pull --url=3D$PWD --branch=3Dthe-right-branch -p /tmp= /test (You need ./pre-inst-env so that the hook actually runs.) Thanks to both of you for working on it! Ludo=E2=80=99.