Interpreting output of exportReferencesGraph (is this a bug or?)

Hi! I’m trying to run exportReferencesGraph over a large number of dependencies. What I’m finding is some results that are at the very least, slightly inconsistent, but I’m not sure how to interpret it.

Essentially, I’m asking for among many other things, the references graph of gst_all_1.gstreamer.out.

If I ask for this on its own, I get back a file starting by talking about gstreamer.

Meanwhile, as a part of my long list of derivations, the file looks like:

/nix/store/0hhzvkw889bsybhqxy12ky4jx6a95p2d-python3-3.11.9

15
/nix/store/0hhzvkw889bsybhqxy12ky4jx6a95p2d-python3-3.11.9
/nix/store/5g9k8zyjv029pw87xf95pci414r8pw8j-zlib-1.3.1
/nix/store/60qp4q78hlg1fsvq4np6iv0gpqrl4v4p-bash-5.2p26
/nix/store/7rv4p19a6mrkr4142h154xm8275zg4p8-bzip2-1.0.8
/nix/store/azbd7lqllzqvq2p29yl3chf69zjg40id-expat-2.6.2
/nix/store/ck6wxnx8d8xqsf9vqydqf1i8ysy43yk5-sqlite-3.45.3
/nix/store/d2sfs3x3jarg11n14a40f61xvwgzjyyd-libffi-3.4.6
/nix/store/dhfrwrfj2ndhj5z4riy9wrz6mb1wnmvp-ncurses-6.4
/nix/store/dkmp2g1pykf2n5ygbqq7rw8h8rhyih8d-mailcap-2.1.53
/nix/store/h816n4a1bz4llxlva6wkv3lp5pbvfzsn-gdbm-1.23
/nix/store/i4h0ajcyq84jb7y6r5qqf8jpy3r6rsm0-libxcrypt-4.4.36
/nix/store/mbpfrzcjf85l7adghgd21r36d06rx01r-xz-5.4.6
/nix/store/mfsjqm3yrqlmamidd4xzf8rfxm397l1k-openssl-3.0.13
/nix/store/ssbc3j8hd9mf773ambrh45lsc3hmn4dn-readline-8.2p10
/nix/store/zj1x1n42l8wp29c72q3w1n7wang2g91j-tzdata-2024a
/nix/store/47xjr9ywrvg6vq3dzav316rfwqyg435i-libcxx-16.0.6

1
/nix/store/47xjr9ywrvg6vq3dzav316rfwqyg435i-libcxx-16.0.6
/nix/store/5g9k8zyjv029pw87xf95pci414r8pw8j-zlib-1.3.1

1
/nix/store/5g9k8zyjv029pw87xf95pci414r8pw8j-zlib-1.3.1
/nix/store/60qp4q78hlg1fsvq4np6iv0gpqrl4v4p-bash-5.2p26

While this file does reference gstreamer, it’s not obvious that it should, it references it as:

4
/nix/store/47xjr9ywrvg6vq3dzav316rfwqyg435i-libcxx-16.0.6
/nix/store/60qp4q78hlg1fsvq4np6iv0gpqrl4v4p-bash-5.2p26
/nix/store/nkzan2y3v2cbx424yl42il9ss1z66z8m-gettext-0.21.1
/nix/store/w99j5fqpc8dz0m732b40pk6kfdq4gsh1-libiconv-99
/nix/store/qfk6a21k05hmvz7d0jlj1zv39l24rfp6-gstreamer-1.24.2

which would seem to imply that libcxx has a dependency on gstreamer. What this is indicating to me is that I probably don’t understand the file format.

I can’t actually find a description of it anywhere? Does anyone know of any resources? It’s hard for me to figure out if I’m facing a bug or not.

It turns out that the file has no particular order, but crucially, is a sequence ofentries of the form

/nix/store/dependent

n_deps
/nix/store/depA
/nix/store/depB

so what this means is that in

4
/nix/store/47xjr9ywrvg6vq3dzav316rfwqyg435i-libcxx-16.0.6
/nix/store/60qp4q78hlg1fsvq4np6iv0gpqrl4v4p-bash-5.2p26
/nix/store/nkzan2y3v2cbx424yl42il9ss1z66z8m-gettext-0.21.1
/nix/store/w99j5fqpc8dz0m732b40pk6kfdq4gsh1-libiconv-99
/nix/store/qfk6a21k05hmvz7d0jlj1zv39l24rfp6-gstreamer-1.24.2

gstreamer represents the start of the next entry.