-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[rb] keep rbenv and RubyMine and bazel in sync with ruby version #16459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
PR Code Suggestions ✨Explore these optional code suggestions:
|
I was really hoping this would make it easy to switch versions, but, well... jruby |
User description
💥 What does this PR do?
I got tired of my ruby versions being out of sync, and I kept forgetting where bazel was hiding the ruby binary.
Now, when you run
./go rb:local_dev
, in addition to building the gems and the grid, if you have rbenv installed, it will create a symlink to the bazel installed ruby and call itselenium-ruby
If you also have direnv installed, it will execute off of the new
.envrc
to set$RBENV_VERSION
toselenium-ruby
to override what is in.ruby-version
file. There is a conditional in.envrc
that says not to do anything if the rbenv symlink isn't there, so it shouldn't get in anyone's way.You still need to select this in Rubymine, but you can go from the rbenv directory symlink instead of bazel nested confusion.
So far this seems to work pretty well for me, but it may be overkill. What do you think?
PR Type
Enhancement
Description
Automates Ruby version synchronization between rbenv, RubyMine, and Bazel
Creates symlink to Bazel-built Ruby in rbenv versions directory
Adds
.envrc
configuration for direnv integration with RBENV_VERSIONSimplifies local development setup by eliminating manual version management
Diagram Walkthrough
File Walkthrough
Rakefile
Add Ruby version management automation
Rakefile
manage_selenium_ruby!
method to automate Ruby version setupRBENV_VERSION
environment variable.envrc
Add direnv configuration for Ruby environment
rb/.envrc
RBENV_VERSION
toselenium-ruby
when symlink is available