Topic/build infrastructure

Bring over the git build infrastructure fixes from master to v1.8.