Hello! Arun Isaac <arunis...@systemreboot.net> 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 ‘generate-package-cache’ and commit it locally. Then you can run: ./pre-inst-env guix pull --url=$PWD --branch=the-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’.