In order to have lock directories written into _build by default (as per #12097), we need to be able to treat these as targets.
This issue was created retroactively to track the work factored out of #11614, but which is now primarily being pursued in service of #12097.