I’ve written a flake with a derivation in it that, in the end, fails with:
/nix/store/kw5l1yhyym7h6skkfjy6qzmdkhhk0q70-zstd-1.5.7/lib/libzstd.a(zstdmt_compress.c.o):function ZSTDMT_compressionJob:(.text+0xbee): error: undefined reference to 'pthread_cond_broadcast'
Clearly, zstd is somewhere in the package’s closure. How do I find out where it comes from? I tried
nix why-depends --derivation .#my-derivation nixpkgs#zstd
But that tells me it’s not in the closure.
Edit: If you want to test: https://github.com/pmiddend/plugui/tree/static-linking-like-hbt - the derivation is .#static-build.