Added compile time exit code checking so we do not bundle failed compilations. Ported changes from forks over to build scripts