How to track down what depends on a broken dependency?

For a few days now, I haven’t been able to rebuild because of:

cannot download pandas_ta-0.3.14b.tar.gz from any mirror

but I can’t figure out which derivation in my config (non-flakes, NixOS 26.05) depends on this. This is a current problem, but I’ve had similar situations before and so far I’ve mostly just gone with my gut; I haven’t found an “algorithmic” method to pinpoint it for sure. Is there one?

There should be more to the error message, for example

these 2 derivations will be built:
  /nix/store/cfnf0rcgzk28yqz397lxg2kl5j0a50m3-test-dependency.drv
  /nix/store/ksb6vid2jb79q2klpsih0abmdcllh9c4-test.drv
building '/nix/store/cfnf0rcgzk28yqz397lxg2kl5j0a50m3-test-dependency.drv'...
error: Cannot build '/nix/store/cfnf0rcgzk28yqz397lxg2kl5j0a50m3-test-dependency.drv'.
       Reason: builder failed with exit code 255.
       Output paths:
         /nix/store/sjx7yivl3vqqszc3dmvwq0ybxxdn4hvv-test-dependency
error: Cannot build '/nix/store/ksb6vid2jb79q2klpsih0abmdcllh9c4-test.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/jflyylay2ahs6ka6pp3cb2r8apq5qx84-test
error: Build failed due to failed dependency

What command are you using to build NixOS?

Try running your rebuild with --show-trace and the dependency chain should be printed. If you can’t figure it out, post it here and we’ll give you a hand.

2 Likes

--show-trace is for evaluation errors, though the posted snippet looks like it was a build error, way after evaluation has happened and succeeded.

Indeed I think there is more context to OPs error, that they didn’t paste.

I think Max is on the right track providing an example for the buildtrace, that appears after failed builds.

Sorry for the delay, here a partial maybe relevant paste Paste2.org - Viewing Paste 8WxLJIHb unfortunately I can’t figure out who create the error…

It’s indeed caused by the pandas download failing, which is probably down to your connection, given it’s persistent you’re probably geoblocked, or your ISP is censoring the domain. You could try a VPN, or a DoH DNS server.

That said, given:

trying https://developer.download.nvidia.com/compute/cuda/redist/libnvjitlink/linux-x86_64/libnvjitlink-linux-x86_64-12.9.86-archive.tar.xz

You’re only building this because you enabled CUDA for something. Pandas is a python data science library, it’ll be used in whatever application you enabled CUDA for.

That’s also causing all these rebuilds; enabling CUDA means you have to build a massive stack of software downstream. It took me two days to build the stack when I tried.

I’d recommend either not enabling CUDA, or using the CUDA cache: https://cache.nixos-cuda.org/

If you use the CUDA cache, you will just get a copy of a prebuilt pandas and won’t have to download the source yourself.

It’s failing because www.pandas-ta.com doesn’t exist (NXDOMAIN) and there’s nothing you can do to connect to it.

The package might need to be updated to use a different (maybe non www) URL.

1 Like

Even pandas-ta.com seems not existant on all DNS I could possibly reach. Actually adding the CUDA secondary cache does not change, but what I can’t track is which package ask for pandas-ta which is not Pandas but a small library on top of it. This is something I do not know how to track…

pandas-ta.dev not .com. But yes page is gone, github repo is gone. Maybe it would still build from pypi but not sure if that’s a good idea at that point.

I don’t see anything in nixpkgs that depends on pandas-ta.

what does

nix-store --query --referrers-closure /nix/store/ai6f8y8k129wwaa7sl2m3fcwg7yviinb-pandas_ta-0.3.14b.tar.gz.drv

have to say?

You can use nix-tree (3rd party tool) to inspect. e.g. nix-tree --derivation <path> will show a store path and what it depends on.

You can use @withakay’s command to identify the gcroot that points at this pandas-ta path.

Side note, on github basically the only things I could find that use it are some stock trading software (freqtrade, stock-trader) and some random devshells.

In nixpkgs the pkg used to fetch https://github.com/twopirllc/pandas-ta the pypi package also links that repo. The link now is a 404 page.

From the internet archive:

edit: Oh you mean consumers. Yeah ta is short for technical analysis so stock-trading stuff.

I’ve opened a PR to remove the package form nixpkgs btw pandas-ta: delete obsolete package by truh · Pull Request #542195 · NixOS/nixpkgs · GitHub

1 Like

Seems you have already found it, but for anyone else comming upon this thread, you can use nix why-depends. As described here: Nix: Why Does My System Depend on $PKG?

Eh, kinda, you still need to know the gcroot that pulls it in and the exact path of the dependency.

Hence, my suggestion of nix-tree as it lets you use search strings more easily once you know the gcroot.

Paste2.org - Viewing Paste AjEOVUUf but at least for my NixOS knowledge there is nothing I can track down to a single derivation in my config…

According to that, it’s part of the python env for xonsh, which you either manually added to environment.systemPackages or is added by a module you enabled.

Presumably you added it to your xonsh.extraPackages? Might also be added by another python package added to that list, I’m not certain python packages show up in referrers because they technically don’t contain literal references.