For interoperability purposes, have the build API explicitly declare a current working directory. Revert to previous cwd on exit.