Skip to content

Commit f83b50d

Browse files
authored
Merge pull request #135 from rake-compiler/flavorjones-bump-rubies
dep: bump all rubies' patch level
2 parents ea08d3e + b887a5b commit f83b50d

File tree

4 files changed

+42
-16
lines changed

4 files changed

+42
-16
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: 20 additions & 15 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

@@ -112,19 +114,19 @@ RUN sudo mkdir -p /usr/local/rake-compiler && \
112114
#
113115
xrubies_build_plan = if platform =~ /x64-mingw-ucrt/
114116
[
115-
# Rubyinstaller-3.1.0+ is platform x64-mingw-ucrt
116-
["3.4.1:3.3.5:3.2.0:3.1.0", "3.1.6"],
117+
# Rubyinstaller-3.1+ is platform x64-mingw-ucrt
118+
["3.4.1:3.3.5:3.2.6:3.1.6", "3.1.6"],
117119
]
118120
elsif platform =~ /x64-mingw32/
119121
[
120-
# Rubyinstaller prior to 3.1.0 is platform x64-mingw32
121-
["2.6.0:2.5.0:2.4.0", "2.5.9"],
122-
["3.0.0:2.7.0", "3.1.6"],
122+
# Rubyinstaller prior to 3.1 is platform x64-mingw32
123+
["2.6.10:2.5.9:2.4.10", "2.5.9"],
124+
["3.0.7:2.7.8", "3.1.6"],
123125
]
124126
else
125127
[
126-
["2.6.0:2.5.0:2.4.0", "2.5.9"],
127-
["3.4.1:3.3.5:3.2.0:3.1.0:3.0.0:2.7.0", "3.1.6"],
128+
["2.6.10:2.5.9:2.4.10", "2.5.9"],
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

@@ -167,12 +169,15 @@ RUN find /usr/local/rake-compiler/ruby -name lib*-ruby*.dll.a | while read f ; d
167169
RUN find /usr/local/rake-compiler/ruby -name rbconfig.rb | while read f ; do sed -i 's/-lcrypt//' $f ; done
168170

169171
<% if platform =~ /darwin/ %>
170-
# ruby-3.2+ on darwin links with `-bundle_loader`,
171-
# - see https://github.com/rake-compiler/rake-compiler-dock/issues/87
172-
# - note that we do this for "3.[2-9].*" to match rubies 3.2 and later
173-
# - and we use a "*" on the end instead of a digit to match prereleases like "3.3.0+0"
174-
RUN find /usr/local/rake-compiler/ruby/*/*/lib/ruby/3.[2-9].* -name rbconfig.rb | \
175-
while read f ; do sed -i 's/\["EXTDLDFLAGS"\] = "/&-Wl,-flat_namespace /' $f ; done
172+
# for rubies which use `-bundle_loader` on darwin
173+
# - the upstream change: https://github.com/ruby/ruby/pull/6193
174+
# - how we got to this solution: https://github.com/rake-compiler/rake-compiler-dock/issues/87
175+
#
176+
# note that ruby/ruby#6193 was backported to 2.7.7, 3.0.5, and 3.1.3
177+
# - see https://github.com/rake-compiler/rake-compiler-dock/issues/134 for more notes
178+
RUN find /usr/local/rake-compiler/ruby/*/*/lib/ruby -name rbconfig.rb | while read f ; do \
179+
sed -E -i 's/(\["EXTDLDFLAGS"\] = ".*)(-bundle_loader)/\1-Wl,-flat_namespace \2/' $f ; \
180+
done
176181
<% end %>
177182
178183
@@ -220,6 +225,6 @@ COPY build/sudoers /etc/sudoers.d/rake-compiler-dock
220225

221226
RUN bash -c "rbenv global 3.1.6"
222227

223-
ENV RUBY_CC_VERSION=3.4.1:3.3.5:3.2.0:3.1.0:3.0.0:2.7.0:2.6.0:2.5.0:2.4.0
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
224229

225230
CMD bash

build/mk_osxcross.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ rm -rf *~ build tarballs/*
2727
echo "export PATH=/opt/osxcross/target/bin:\$PATH" >> /etc/rubybashrc
2828
echo "export MACOSX_DEPLOYMENT_TARGET=10.13" >> /etc/rubybashrc
2929
echo "export OSXCROSS_MP_INC=1" >> /etc/rubybashrc
30+
echo "export OSXCROSS_PKG_CONFIG_USE_NATIVE_VARIABLES=1" >> /etc/rubybashrc
31+
3032

3133
# Add links to build tools without target version kind of:
3234
# arm64-apple-darwin-clang => arm64-apple-darwin20.1-clang
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)