Add experimental build mode flag for env (#77089)
This is an alternative to the `generateOnlyEnv` config which moves it to
a build-mode flag instead for easier running. This also adds a log when
running in compile mode to make it clear the build isn't finalized and
saying next step since this is more important now that we don't inline
env during compile by default.