Skip to content

Commit b887a5b

Browse files
committed
Update 3.1.2 to 3.1.6, patching rake-compiler to build miniruby
This works around the problem described in https://bugs.ruby-lang.org/issues/19239
1 parent ff7a838 commit b887a5b

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

Dockerfile.jruby

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ RUN bash -c " \
5050
rbenv shell \$v && \
5151
gem install rake-compiler -v1.2.9 && \
5252
cd ${RBENV_ROOT}/versions/\$v/lib/ruby/gems/*/gems/rake-compiler-1.2.9 && \
53-
patch -p1 < /home/rubyuser/patches/rake-compiler-1.2.9/*.patch ; \
53+
for patch in /home/rubyuser/patches/rake-compiler-1.2.9/*.patch ; do \
54+
patch -p1 < \$patch ; \
55+
done \
5456
done \
5557
"
5658

Dockerfile.mri.erb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ RUN bash -c " \
9393
rbenv shell \$v && \
9494
gem install rake-compiler -v1.2.9 && \
9595
cd ${RBENV_ROOT}/versions/\$v/lib/ruby/gems/*/gems/rake-compiler-1.2.9 && \
96-
patch -p1 < /home/rubyuser/patches/rake-compiler-1.2.9/*.patch ; \
96+
for patch in /home/rubyuser/patches/rake-compiler-1.2.9/*.patch ; do \
97+
patch -p1 < \$patch ; \
98+
done \
9799
done \
98100
"
99101

@@ -113,7 +115,7 @@ RUN sudo mkdir -p /usr/local/rake-compiler && \
113115
xrubies_build_plan = if platform =~ /x64-mingw-ucrt/
114116
[
115117
# Rubyinstaller-3.1+ is platform x64-mingw-ucrt
116-
["3.4.1:3.3.5:3.2.6:3.1.2", "3.1.6"],
118+
["3.4.1:3.3.5:3.2.6:3.1.6", "3.1.6"],
117119
]
118120
elsif platform =~ /x64-mingw32/
119121
[
@@ -124,7 +126,7 @@ elsif platform =~ /x64-mingw32/
124126
else
125127
[
126128
["2.6.10:2.5.9:2.4.10", "2.5.9"],
127-
["3.4.1:3.3.5:3.2.6:3.1.2:3.0.7:2.7.8", "3.1.6"],
129+
["3.4.1:3.3.5:3.2.6:3.1.6:3.0.7:2.7.8", "3.1.6"],
128130
]
129131
end
130132

@@ -223,6 +225,6 @@ COPY build/sudoers /etc/sudoers.d/rake-compiler-dock
223225

224226
RUN bash -c "rbenv global 3.1.6"
225227

226-
ENV RUBY_CC_VERSION=3.4.1:3.3.5:3.2.6:3.1.2:3.0.7:2.7.8:2.6.10:2.5.9:2.4.10
228+
ENV RUBY_CC_VERSION=3.4.1:3.3.5:3.2.6:3.1.6:3.0.7:2.7.8:2.6.10:2.5.9:2.4.10
227229

228230
CMD bash
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
2+
index d37ab97b..0df44b30 100644
3+
--- a/tasks/bin/cross-ruby.rake
4+
+++ b/tasks/bin/cross-ruby.rake
5+
@@ -129,6 +129,12 @@
6+
7+
# make
8+
file "#{build_dir}/ruby.exe" => ["#{build_dir}/Makefile"] do |t|
9+
+ puts "MIKE: #{ruby_cc_version}: #{mingw_target}"
10+
+ if ruby_cc_version.start_with?("ruby-3.1") && mingw_target =~ /darwin/
11+
+ # for later 3.1.x releases, we need to explicitly build miniruby
12+
+ # see https://bugs.ruby-lang.org/issues/19239
13+
+ sh "#{MAKE} miniruby", chdir: File.dirname(t.prerequisites.first)
14+
+ end
15+
sh MAKE, chdir: File.dirname(t.prerequisites.first)
16+
end
17+

0 commit comments

Comments
 (0)