Make 'bundle exec rake' more stable or discourage its use for GDK Rake tasks
Overview
As seen in e.g. bundle exec rake setup_ai_gateway fails with "C... (#2675 - closed), the use of bundle exec rake is problematic because bundle exec pollutes GDK’s environment variables, leading to unrelated failures when spawning Ruby sub-processes in service directories that have different Bundler or Ruby versions.
Impacted categories
The following categories relate to this issue:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
Proposal
Either:
- Remove the
BUNDLER_SETUPvariable and Bundler setup argument from theRUBYOPTvariable- This would alleviate the core issue but might still result in a semi-polluted environment since Bundler sets other variables, such as
BUNDLE_GEMFILEorBUNDLE_BIN_PATH. The paths in these variables are Ruby-version specific and might cause other instabilities.
- This would alleviate the core issue but might still result in a semi-polluted environment since Bundler sets other variables, such as
- Add a
gdk rake [...]helper that acts just likebundle exec rake [...]- This would allow us to always go through the
GDK.mainfunction, setting up system-relevant environment variables - It would also keep the environment clean from any
BUNDLE*environment variables
- This would allow us to always go through the