Skip to content

Commit

Permalink
split rubies out into separate image layers
Browse files Browse the repository at this point in the history
because running in batches is failing too often due to
https://bugs.ruby-lang.org/issues/18506. let's opt for simple and
debuggable.
  • Loading branch information
flavorjones committed Nov 25, 2023
1 parent de794f2 commit 635651c
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions Dockerfile.mri.erb
Original file line number Diff line number Diff line change
Expand Up @@ -132,32 +132,43 @@ RUN bash -c " \
"

<%
# Build xruby versions prior ruby2_keywords using ruby-2.5
# Build xruby versions with ruby2_keywords using ruby-3.x
# Note that parallel builds of ruby are often flaky, see https://bugs.ruby-lang.org/issues/18506
axrubies = if platform =~ /x64-mingw-ucrt/
[
# Rubyinstaller-3.1.0+ is platform x64-mingw-ucrt
["3.3.0-preview3:3.2.0:3.1.0", "3.1.3", true],
["3.1.0", "3.1.3", true],
["3.2.0", "3.1.3", true],
["3.3.0-preview3", "3.1.3", true],
]
elsif platform =~ /x64-mingw32/
[
# Rubyinstaller prior to 3.1.0 is platform x64-mingw32
["2.6.0:2.5.0:2.4.0", "2.5.9", false],
["3.0.0:2.7.0", "3.1.3", true],
["2.4.0", "2.5.9", true],
["2.5.0", "2.5.9", true],
["2.6.0", "2.5.9", true],
["2.7.0", "3.1.3", true],
["3.0.0", "3.1.3", true],
]
else
[
# Build xruby versions prior ruby2_keywords in parallel using ruby-2.5
["2.6.0:2.5.0:2.4.0", "2.5.9", false],
# Build xruby versions with ruby2_keywords in parallel using ruby-3.x
["3.3.0-preview3:3.2.0:3.1.0:3.0.0:2.7.0", "3.1.3", true],
["2.4.0", "2.5.9", true],
["2.5.0", "2.5.9", true],
["2.6.0", "2.5.9", true],
["2.7.0", "3.1.3", true],
["3.0.0", "3.1.3", true],
["3.1.0", "3.1.3", true],
["3.2.0", "3.1.3", true],
["3.3.0-preview3", "3.1.3", true],
]
end

axrubies.each do |xrubies, rvm, parallel| %>
ENV XRUBIES <%= xrubies %>
<% strip = '-s' if platform !~ /darwin/ %>
# Build xruby versions in parallel
# Then cleanup all build artifacts
# Build xruby versions, then cleanup all build artifacts
RUN bash -c " \
rvm use <%= rvm %> && \
export CPPFLAGS='<%= "-D__USE_MINGW_ANSI_STDIO=1" if platform=~/x64-mingw-ucrt/ %>' && \
Expand Down

0 comments on commit 635651c

Please sign in to comment.