[Reviewer: Matt][From: Alex] Patch building code.

The build-infra portion of the patch building code. 

NOTE TO SELF - When this is merged update all repos that use it :-(