Subject: Re: [PATCH v2 0/3] Xapian for Guix package search

From: Ludovic Courtès <[email-masked]>
Date: Wed, 11 Mar 2020 14:50:51 +0100

Hello!

Arun Isaac <[email-masked]> skribis:

>> We could provide a substitute for users who use only the official 'guix
>> channel.  However, as soon as users combine multiple channels, they’ll
>> have to build the index locally.
>
> We could build a separate Xapian database for each channel. Xapian does
> support searching across multiple databases at once and will handle
> merging the results together appropriately.

Nice!

> If I understand correctly, this means we can provide substitutes for
> at least the official guix channel and let the user build the index
> locally for other channels. Is that correct?

I’m afraid not, or at least not trivially.

Currently, profile hooks such as ‘%channel-profile-hooks’, receive a
complete profile—in this case, the composition of all the channels the
user chose.

So if we want to achieve what you propose, we’d need to find another way
to hook database generation.

BTW, there’s also the problem of modules added dynamically with
$GUIX_PACKAGE_PATH or ‘-L’.  With the proposed scheme, it seems that
they could no longer be searched.  Is that correct?

(Conversely the package cache is optional: it’s only used when it’s
considered authoritative, see (gnu packages).  The API and behavior are
exactly the same whether or not the package cache is used.)

Thanks,
Ludo’.