From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:41722) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS5G3-0002Y8-Mg for guix-patches@gnu.org; Fri, 24 Apr 2020 16:49:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jS5Fv-0001YG-9M for guix-patches@gnu.org; Fri, 24 Apr 2020 16:49:11 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46532) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jS5Fu-0001W6-Tl for guix-patches@gnu.org; Fri, 24 Apr 2020 16:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jS5Fu-0000si-RS for guix-patches@gnu.org; Fri, 24 Apr 2020 16:49:02 -0400 Subject: [bug#39258] [PATCH v3 1/3] guix: Generate package metadata cache. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200327162654.18785-1-arunisaac@systemreboot.net> <20200327162654.18785-2-arunisaac@systemreboot.net> Date: Fri, 24 Apr 2020 22:48:36 +0200 In-Reply-To: <20200327162654.18785-2-arunisaac@systemreboot.net> (Arun Isaac's message of "Fri, 27 Mar 2020 21:56:52 +0530") Message-ID: <87h7x8haor.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Arun Isaac Cc: mail@ambrevar.xyz, 39258@debbugs.gnu.org, zimon.toutoune@gmail.com Hi Arun, Arun Isaac skribis: > * gnu/packages.scm (%package-metadata-cache-file): New variable. > (generate-package-metadata-cache): New function. > * guix/channels.scm (package-metadata-cache-file): New function. > (%channel-profile-hooks): Add package-metadata-cache-file. This is short and sweet, nice! > + (define (expand-cache package result) > + (cons `#(,(package-name package) > + ,(package-version package) > + ,(delete-duplicates > + (map package-full-name > + (sort (filter package? (package-direct-inputs packag= e)) > + package + ,(package-outputs package) > + ,(package-supported-systems package) > + ,(package-synopsis package) > + ,(package-description package) > + ,(package-home-page package) > + ,(let ((location (package-location package))) > + (list (location-file location) > + (location-line location) > + (location-column location)))) I was wondering if we could omit inputs, which are not that useful. Apart from that it LGTM. Note that this is probably the place where we could eventually add the computation of an inverted index like zimoun suggested in . > + #:properties '((type . profile-hook) > + (hook . package-cache)) =E2=80=98package-metadata-cache=E2=80=99, even (it=E2=80=99s for UI purpose= s). Nitpick: I=E2=80=99d use =E2=80=9Cpackages:=E2=80=9D as the prefix in the s= ubject line. Thanks, Ludo=E2=80=99.