guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File search


From: Ludovic Courtès
Subject: Re: File search
Date: Mon, 19 Dec 2022 22:25:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Hi Antoine!

"Antoine R. Dumont (@ardumont)" <antoine.romain.dumont@gmail.com>
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={store|manifests}` flag. The "manifests" method is the
>   default, seel the help message for more details).

Excellent.  (I think we can call it ‘--method’, without “with”.)

> - Finally, the indexation methods are displayed using a progress bar.

Yay, I love progress bars.  :-)

> Heads up, I did not yet address the "output" part. Thanks @zimoun for
> the clarification btw ;)

Future work.  ;-)

>> 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’re
going to traverse.  ‘all-packages’ is not instantaneous, but as a good
approximation the time spent in ‘all-packages’ can be ignored.

> 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 ‘length’ on it.

> Hope you'll find it mostly to your taste!

I do!

> 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 ‘guix/scripts’.  For that we could dismiss commit history.

That’ll entail extra work (d’oh!) such as fine-tuning, writing tests,
and writing a section for the manual.

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’s a useful feature that ought to
be provided by Guix proper eventually.

WDYT?  :-)

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]