CI: getting a list of affected attrnames

How would one get a list of all attribute names (in nixpkgs) that refer to a file?

Or alternatively, to avoid X-Y, the goal is to get a list of affected attrs given some list of changed files. Is this possible?

The naive way I can think of would be to filter the package list by meta.position, which sounds horribly jank and could potentially miss some packages where the file that was modified isn’t the same as the file where its meta information is stored.

We already have CI for (something like) this. “OfBorg eval” posts a link to a file with one (per-platform) attribute per line, listing everything that gets rebuilt by the pull request.

For example this PR posts

ofborg-eval — ^.^! Details

1 Like

Thanks, I’ll look into that further.

This script isn’t perfect at all, but it can give you almost the same locally:

Just beware that the computation is pretty expensive. Depending on settings, it needs several minutes and RAM on the order of 30G.

1 Like