BUILD_DIR should expand before writing to file