Skip to content

Determining file dependencies and rule provenance in Hadrian

The make build system has a few important introspection features which are invaluable when working on the build system:

  • make -p allows one to easily dump the entire database, which can be useful in conjunction with grep to identify where rules are defined
  • make -n allows one to dump all of the commands necessary to build a particular file and its dependencies
  • make -nW makes it easy to determine which files a particular file would affect

I've been unable to work out how to accomplish any of this with hadrian. Ideally we would like to have a hadrian mode to query the rulebase for which rule is responsible for building a particular target. This would include its source location and dependencies.

It's possible that these already exist but it's not clear from the help message in what form.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information