`nix-copy-closure` copies things that `nix why-depends` cannot explain

Using nix-copy-closure, I see things being copied like

copying path '/nix/store/k75qmf2w9dzn2f2fwbgkh1igmp9rcbcn-gfortran-13.2.0-lib' to 'ssh://bitbop-proxy-arm'...
copying path '/nix/store/lhk6rl8y3p84rn1brdmsw86jli64nq7k-openblas-0.3.26' to 'ssh://bitbop-proxy-arm'...
copying path '/nix/store/2zkparvg1jghsbrimgv6ibq18k40sipw-blas-3' to 'ssh://bitbop-proxy-arm'...
copying path '/nix/store/4if38k0acmz0sz490pjsasa0njglq3ni-blas-3-dev' to 'ssh://bitbop-proxy-arm'...

This strikes me as odd since I’m not using any fortran or linear algebra packages AFAIK.

But looking at nix why-depends,

root@b62e2017d34d:/workspaces/bitbop# nix why-depends .#charge_usage nixpkgs#openblas
warning: Git tree '/workspaces/bitbop' is dirty
these 9 paths will be fetched (12.95 MiB download, 80.83 MiB unpacked):
  /nix/store/k0cqy1zwwzjxqcn4fgbjrclr32nbl263-gcc-13.2.0-lib
  /nix/store/0x7jwnqfz1d9sciz7nxff0c6hxrcn61m-gcc-13.2.0-libgcc
  /nix/store/cdjrj110qqv5zh529pb4wjxhndc6rxab-gfortran-13.2.0-lib
  /nix/store/y1w1w8562cbdigw67zniwah6h0midw6g-gfortran-13.2.0-libgcc
  /nix/store/i69jll18a0an6z14dq71b49xdl8kcqhk-glibc-2.39-5
  /nix/store/2awvl0nmhp8w51nvvw9f9s9qpndv43hw-libidn2-2.3.7
  /nix/store/a452c6dwig1biaya9c8x8qbn59hsl3sp-libunistring-1.1
  /nix/store/4rhdcv6yj1qxm7nh3j48ckxgg5ywnb8q-openblas-0.3.26
  /nix/store/c7lp1frzvsa603v9gj97i5alyxslf927-xgcc-13.2.0-libgcc
'git+file:///workspaces/bitbop#charge_usage' does not depend on 'flake:nixpkgs#openblas'

Notably the packages have different hashes… How can I figure out why this dependency exists? Why doesn’t nix why-depends handle this case as expected?

1 Like

Try doing the same command with raw store paths, just to rule out its nix-copy-closure vs nix why-depends treating the CLI arguments differently.

1 Like

Thanks so much @Ericson2314!

root@b62e2017d34d:/workspaces/bitbop# nix why-depends .#charge_usage /nix/store/lhk6rl8y3p84rn1brdmsw86jli64nq7k-openblas-0.3.26
/nix/store/hj9rsvkr3ygdind7q7pnlcbnsj2qs80b-charge_usage
└───/nix/store/j8jgbpygkj4hhbhwqx03blpmn5s7kkgk-charge_usage-inner
    └───/nix/store/3yf6cikm3lajxk6a3zg2yhbax2cgl5ci-charge_usage-inner
        └───/nix/store/jj6h6jnjyndcfjb5vm9xz0sv7x5pba5p-python3-3.11.8-env
            └───/nix/store/xpik0iayxm3y673ybflk46gf117kvwq9-python3.11-numpy-1.26.4
                └───/nix/store/2zkparvg1jghsbrimgv6ibq18k40sipw-blas-3
                    └───/nix/store/lhk6rl8y3p84rn1brdmsw86jli64nq7k-openblas-0.3.26

did the trick for me!

Oddly, I am not requesting a dependency on numpy anywhere in my derivation, but I guess nix squashes all transitive python dependencies into a single python3-3.11.8-env.

1 Like