Structure the build process so that we don't need an at_exit hook