Conversation
| ENV PATH="$BUNDLE_BIN:$PATH:$BUNDLE_PATH/bin" | ||
| RUN apt-add-repository ppa:brightbox/ruby-ng \ | ||
| && apt-get update \ | ||
| && apt-get install -y --no-install-recommends ruby2.7 ruby2.7-dev \ |
There was a problem hiding this comment.
I noticed we used to install ruby-dev which is a package with "header files for compiling extension modules for Ruby".
AFAIK RVM rbenv + ruby-build installs ruby as source for the machine so this might not be a concern?
We might also want to check if this change makes the Docker build take significantly longer in case we are actually building from source instead of pulling a binary
There was a problem hiding this comment.
I noticed we used to install ruby-dev which is a package with "header files for compiling extension modules for Ruby".
AFAIK RVM installs ruby as source for the machine so this might not be a concern?
The first commit (bcf435f), I messed up the PATH and ended up running whatever system Ruby was available. And CI failed when attempting to install native extensions because of those missing headers.
The next commit (b591c76) fixed the PATH and everything worked as expected. So I think we should be arlight.
We might also want to check if this change makes the Docker build take significantly longer in case we are actually building from source instead of pulling a binary
That shouldn't be as much of a concern on subsequent builds if the layer is cached. But yeah, it'll be interesting to see what difference that makes.
|
I'm totally in favor of going this route instead of keep using Ruby packaged by the OS 👍. Also, just to make sure, there's another popular software called ruby-install, but this PR intends to use ruby-build, correct? Finally, do we need |
|
Is there a plan for when this PR is going to be merged in please? And will it unblock #5030 ? Thanks! |
|
I did some more reading on this topic and it seems like what this PR proposes, using rbenv + ruby-build, covers all the bases for installing Ruby from source and changing the necessary paths for our Docker shell. So this approach seems fine to deploy and unblock #5030 There are a couple of alternatives to
One potential side effect we should check before deploying is that dependabot-core/bundler/helpers/v1/build Lines 23 to 27 in e102933 A couple notes:
|
|
@Nishnha Yes, it's true that chruby could be better since it doesn't use shims, but my idea was to avoid installing and using any ruby switcher at all since we don't really need to switch rubies. I'm happy to further investigate this idea. |
|
Thanks for sharing your thoughts, @Nishnha @deivid-rodriguez! I agree that the additional switching behavior of |
Related to #5031 (comment)
Currently, we use the Brightbox PPA to install Ruby with
apt. However, this limits our ability to update to a more recent patch release of Ruby 2.7 (or later, Ruby 3).This PR updates this step in
Dockerfileto instead use rbenv and ruby-install to install and manage ruby versions. I used Ruby 2.7.5 to match the version installed now. As a follow-up, we should upgrade to 2.7.6.