only run setup_env if we need to