On heroku compiles are done without environment variables. Why?
If you compile the same source code you will ge the exact same compiled app output every time.
This is determinisim. The app build is deterministic.
If you allow environment variables at build time, the output of the app is no-longer deterministic based soley on the code. You can deploy the same code and get different results.
If you are using user-env-compile your app builds are now non-deterministic.
Why is this bad?
It is harder to troubleshoot and reproduce problems. It means if you change your config, you techinally need to recompile your app every time.
Addon providers are allowed to change your environment variables (vendor prefixed for safety). But changing the variable does not trigger a new deploy. If you're app doesn't need user env compile this isn't a problem. Otherwise who knows.
Not only are you enabling your Heroku config to be availalble at compile/build/deploy time, you could be affecting internal environment variables as well like $PATH or $GEM_HOME, and if you mess those up, there isn't much we can do to fix them.
In short: Best practice is to not use user-env-compile.
Is
user-env-compile
required for altering BUNDLE_WITHOUT? Seems to be:https://blog.heroku.com/archives/2011/2/15/using-bundler-groups-on-heroku