Tracing dependency in nixpkgs

Someone tried to use a shell.nix I prepared for a project, on an M1 Mac. It gave the following error:

error: Package 'compiler-rt-5.0.2' in /nix/store/nd91gpdz8wf7y82a55v7l3sj0lqdrmaz-source/pkgs/development/compilers/llvm/5/compiler-rt/default.nix:92 is marked as broken, refusing to evaluate.

So, the compiler runtime for LLVM version 5 (! the current version is 13) is marked as broken. It turns out that it’s marked as broken on the Darwin/aarch64 architecture all the way up to and including version 10:

rg broken pkgs/development/compilers/llvm/**/compiler-rt/default.nix        
pkgs/development/compilers/llvm/9/compiler-rt/default.nix
107:    broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;

pkgs/development/compilers/llvm/8/compiler-rt/default.nix
108:    broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;

pkgs/development/compilers/llvm/7/compiler-rt/default.nix
108:    broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;

pkgs/development/compilers/llvm/6/compiler-rt/default.nix
105:    broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;

pkgs/development/compilers/llvm/5/compiler-rt/default.nix
104:    broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;

pkgs/development/compilers/llvm/11/compiler-rt/default.nix
117:    broken = stdenv.hostPlatform.isRiscV && stdenv.hostPlatform.is32bit && !stdenv.cc.isClang;

pkgs/development/compilers/llvm/10/compiler-rt/default.nix
107:    broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;

I’m assuming (hoping) that the use of this ancient version of LLVM is a mistake, and that some packages somewhere simply hasn’t been updated.

How can I find what introduces this dependency in my derivation, bearing in mind that I do not have direct access to the architecture on which the problem manifests itself?

You can use the nix-store --query command find a derivation’s dependencies or the parents of a derivation. I believe in this case you want this command:

nix-store --query --referrers /nix/store/nd91gpdz8wf7y82a55v7l3sj0lqdrmaz-source/pkgs/development/compilers/llvm/5/compiler-rt/default.nix

also, you can use nix why-depends. But not sure if helps with evaulation errors

I guess that any solution will fundamentally require access to the machine on which the command was attempted. That is to say, I assume there is no way to extract a dependency graph from the nixpkgs source itself. Is that correct?

… gives no output on the machine in question.