Amr Stite <[email protected]> writes: > Hi everyone, > > I wrapped up a three-month internship at Inria Bordeaux's SED a month ago, > under Ludovic Courtès and Sergio Pastor Perez. > > The project: a Guix command built on top of the Data Service, to > answer two things. First, which commits had a given version of a given > package. Second, and more generally, which commits had several > specific package versions available at the same time, not limited to > two packages. > > https://codeberg.org/guix-extensions/package-version-history > > I've attached the internship report, which walks through the approach, > the choices made along the way, and a data consistency quirk I ran > into with coexisting package definitions during version transitions. > > Ludovic thought this might be worth posting here given how > little-known the Data Service still seems to be outside the people who > built it. Feedback and questions welcome.
Hi Amr, It's great to see the information in data.guix.gnu.org being used more. I can see this being really useful for people who want specific versions of packages, or to find out when they've been available. Some tips from my struggles writing reliable Guile code: - Use suspendable ports https://doc.guix.gnu.org/guile/latest/en/html_node/Non_002dBlocking-I_002fO.html This means when the operations with the network hang, you can do something about it from Guile, rather than the read or write syscall just not returning. - Use non-blocking sockets, just enabling suspendable ports doesn't make the I/O on a port non-blocking, there's an extra step. I've got some useful changes to Guix that'll I'll push to master soon https://codeberg.org/guix/guix/pulls/11110 and once they're in, using open-connection-for-uri from (guix build download) with #:non-blocking? #t is what you want (inside of the open-data-service procedure). - Use suspendable ports for timeouts https://codeberg.org/guix/build-coordinator/src/branch/trunk/guix-build-coordinator/utils/timeout.scm As demonstrated by this code in the Guix Build Coordinator (it should probably be in Guile or at least Guix, but you can copy it in to the package-version-history repository for use there). One final tip is to move where the connection to the data service is opened. You want that to happen when the command is run, rather than when the module is evaluated, since at the moment if you run "guix package-version-history" or "guix package-version-history --help", it opens a redundant connection to the data service, slowing it down. Do let me know if you have any feedback regarding the Guix Data Service in general and data.guix.gnu.org. I've been doing quite a bit on the data service recently, but there's still so much more to do. Thanks again, Chris
signature.asc
Description: PGP signature
