After messing around with the GNU Guix system for a while, I end up with several "guile-3.0.9/" directory in my /gnu/store/
ls -p /gnu/store | grep 'guile-3.0.9/'
10p9mh0h11z2gs2z72lqnxq96ln6a5x7-guile-3.0.9/
4gvgcfdiz67wv04ihqfa8pqwzsb0qpv5-guile-3.0.9/
84rvhd3j7pfqrh7717cv7ddv2dc8xad5-guile-3.0.9/
g8p09w6r78hhkl2rv1747pcp9zbk6fxv-guile-3.0.9/
rabsjkkm22xhz1vr5dh7r4ai98zprywx-guile-3.0.9/
sg2csvgqqc8r6519pyaqk6c4l1plh40f-guile-3.0.9/
Since their base32 hash prefix are different, I guess they have different input when being built. I really want to know some particular information about those packages, like:
- when they were built,
- which one is newer,
- what are their build input,
- why they are in my store directory, etc.
Since I always use the substitute servers, I try to get the information from the "ci.guix.gnu.org"
website. I actually find the build output of https://ci.guix.gnu.org/build/2076542/details is "4gvgcfdiz67wv04ihqfa8pqwzsb0qpv5-guile-3.0.9". But I am not lucky for other items. It is very hard to find a particular store item from the CI website.
So my question is: if I have one gnu store item, how and where can I get associated information of it?
PS. I know some of the packages are just dead items, and will be garbage collected when I run guix gc
.
Most of the available information can be derived from the .drv files corresponding to a store item.
Correct, the hash prefix of a guix store item is derrived from the inputs to the derivation; so if those change, the prefix changes as well.
While the mtime timestamp of store items is set to 1 (00:00:01 1/1/1970 UTC), you could use e.g. ctime or the birth timestamp of a store item to determine it's age in most cases (assuming that these have been reliably set in this case):
For this to know you'll need to inspect the corresponding .drv file of a store item. If we want to look at the build inputs of the store item
/gnu/store/x4m56h5qkim0pnvx6vgvp541mrdwdrah-guile-3.0.9/
we could locate the corresponding .drv file:and then open it in e.g. a text editor or simply print it to STDOUT to inspect it. The .drv files in Guix use the ATerm format (see Chapter 1. The ATerm Programming Guide for further information on the format in particular).
If you want to compare store items or pretty-print their inputs for better readability, you could use the
(guix derivations)
guile modules for this.There's
read-derivation-from-file
to read a .drv file into a guile record (Records (Guile Reference Manual)); then the contents of the .drv file (or parts of it, e.g.derivation-inputs
if you only want to work with the inputs), can be pretty-printed:like this:
to get the difference in inputs of two derivations you could utilize
lset-difference
(srfi-1) on the build-inputs of two derivations:This is something you can inspect with
guix graph
(passing-t referrers
or-t references
) orguix gc
(passing--references
or--referrers
). You could graph the output ofguix graph
withxdot
to inspect the relationships of your store item with other store items:guix graph -t referrers /gnu/store/1gd9nsy4cps8fnrd1avkc9l01l7ywiai-guile-3.0.9 | guix shell xdot -- xdot -
to get a better idea of why they're in your store/which other package pulled them in as a dependency and so on.