rake-compiler-dock 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3cfdfefd55e7a9101359d39e3aaed0e8a63c046b0a1952efe5d291032b582b37
4
- data.tar.gz: cc50befca4c133b28bc13834a1c619250bd1aa4d7743e95fcfef47cd62330082
3
+ metadata.gz: 7bbe8d21de2a30484e2ec2d877bf6e2e2538c7f02d207e924716d9bb99609fbf
4
+ data.tar.gz: 2069a049a2a9974a98f13bfd704f60f8e07dc5741f2e0f5d18a6c4f122358875
5
5
  SHA512:
6
- metadata.gz: 8ed46ae89b00549dba2a66a7b079e2d7977f4031fcf38658f4f030bf6923a1b7e49da02986635766f7d0bd86a1bf4ff7f6252ea2d6d79dba86c00488e2a928fe
7
- data.tar.gz: 193b8d63b2d747f652dd33e10b7c7c950ad92b46eff8067dfe14f11a18b126d90049dc7ea1ec57689f6fe3a38eb3358e8e3f8ffdf50dcbe3bdfb41b6d8db1886
6
+ metadata.gz: 197abac03aa2262d6893e4f79dcb9fa63bbf7018afa70d6ea7c189abc390074a36c7892b6745e8399ffbe4309686b5310c382d5227dfe9906d6bd875a561b5af
7
+ data.tar.gz: 184393bac4b1890e1c19567c7c80ecc3a015e78e8789232c4f00a28d7c2a6ba0209ae94e9c1ffa2dcbd58bcd9eb8a1875732c32263cdbd47499437bc0e3617aa
Binary file
Binary file
@@ -1,7 +1,7 @@
1
- FROM ubuntu:18.04
1
+ FROM ubuntu:20.04
2
2
 
3
3
  RUN apt-get -y update && \
4
- apt-get install -y curl git-core xz-utils wget unzip sudo gpg dirmngr openjdk-11-jdk-headless && \
4
+ apt-get install -y curl git-core xz-utils wget unzip sudo gpg dirmngr openjdk-14-jdk-headless && \
5
5
  rm -rf /var/lib/apt/lists/*
6
6
 
7
7
  # Add "rvm" as system group, to avoid conflicts with host GIDs typically starting with 1000
@@ -26,7 +26,7 @@ ENV BASH_ENV /etc/rubybashrc
26
26
  # install rubies and fix permissions on
27
27
  RUN bash -c " \
28
28
  export CFLAGS='-s -O3 -fno-fast-math -fPIC' && \
29
- for v in jruby-9.2.9.0 ; do \
29
+ for v in jruby-9.2.14.0 ; do \
30
30
  rvm install --binary \$v --patch \$(echo ~/patches/ruby-\$v/* | tr ' ' ','); \
31
31
  done && \
32
32
  rvm cleanup all && \
@@ -46,8 +46,8 @@ RUN sudo mkdir -p /usr/local/rake-compiler && \
46
46
 
47
47
  USER root
48
48
 
49
- RUN bash -c "rvm alias create default jruby-9.2.9.0"
50
- RUN echo "rvm use jruby-9.2.9.0 > /dev/null" >> /etc/rubybashrc
49
+ RUN bash -c "rvm alias create default jruby-9.2.14.0"
50
+ RUN echo "rvm use jruby-9.2.14.0 > /dev/null" >> /etc/rubybashrc
51
51
 
52
52
  # Add rvm to the global bashrc
53
53
  RUN echo "source /etc/profile.d/rvm.sh" >> /etc/bash.bashrc
@@ -1,12 +1,34 @@
1
- FROM ubuntu:<%= platform=~/linux/ ? "16.04" : "18.04" %>
1
+ FROM <%=
2
+ case platform
3
+ when /x86_64-linux/ then "quay.io/pypa/manylinux2014_x86_64"
4
+ when /x86-linux/ then "quay.io/pypa/manylinux2014_i686"
5
+ else "ubuntu:20.04"
6
+ end %>
2
7
 
8
+ <% if platform=~/linux/ %>
9
+ # install packages which rvm will require
10
+ RUN yum install -y autoconf gcc-c++ libtool readline-devel sqlite-devel ruby openssl-devel xz cmake sudo less
11
+
12
+ # Prepare sudo and delete sudo as alias to gosu
13
+ RUN rm -f /usr/local/bin/sudo && \
14
+ groupadd -r sudo && \
15
+ echo "%sudo ALL=(ALL) ALL" >> /etc/sudoers
16
+ <% else %>
17
+ ENV DEBIAN_FRONTEND noninteractive
3
18
  RUN apt-get -y update && \
4
- apt-get install -y curl git-core xz-utils build-essential wget unzip sudo gnupg2 dirmngr && \
19
+ apt-get install -y curl git-core xz-utils build-essential zlib1g-dev libreadline-dev libssl-dev wget unzip sudo gnupg2 dirmngr cmake pkg-config && \
5
20
  rm -rf /var/lib/apt/lists/*
21
+ <% end %>
6
22
 
7
23
  # Add "rvm" as system group, to avoid conflicts with host GIDs typically starting with 1000
8
- RUN groupadd -r rvm && useradd -r -g rvm -G sudo -p "" --create-home rvm && \
9
- echo "source /etc/profile.d/rvm.sh" >> /etc/rubybashrc
24
+ RUN groupadd -r rvm && useradd -r -g rvm -G sudo -p "" --create-home rvm
25
+
26
+ # Make sure rvm and later settings are available in interactive and non-interactive shells
27
+ RUN echo "source /etc/profile.d/rvm.sh" >> /etc/rubybashrc && \
28
+ echo "source /etc/rubybashrc" >> /etc/bashrc && \
29
+ echo "source /etc/rubybashrc" >> /etc/bash.bashrc
30
+ ENV BASH_ENV /etc/rubybashrc
31
+
10
32
  USER rvm
11
33
 
12
34
  RUN mkdir ~/.gnupg && \
@@ -18,16 +40,17 @@ RUN gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A
18
40
  (curl -L http://get.rvm.io | sudo bash) && \
19
41
  bash -c " \
20
42
  source /etc/rubybashrc && \
43
+ rvm autolibs disable && \
21
44
  rvmsudo rvm cleanup all "
22
45
 
23
46
  # Import patch files for ruby and gems
24
47
  COPY build/patches /home/rvm/patches/
25
- ENV BASH_ENV /etc/rubybashrc
26
48
 
27
49
  # install rubies and fix permissions on
50
+ ENV RVM_RUBIES 2.5.8 3.0.0
28
51
  RUN bash -c " \
29
52
  export CFLAGS='-s -O3 -fno-fast-math -fPIC' && \
30
- for v in 2.5.7 ; do \
53
+ for v in ${RVM_RUBIES} ; do \
31
54
  rvm install \$v --patch \$(echo ~/patches/ruby-\$v/* | tr ' ' ','); \
32
55
  done && \
33
56
  rvm cleanup all && \
@@ -38,7 +61,7 @@ RUN bash -c " \
38
61
  RUN echo "gem: --no-ri --no-rdoc" >> ~/.gemrc && \
39
62
  bash -c " \
40
63
  rvm all do gem update --system --no-document && \
41
- rvm all do gem install --no-document bundler 'bundler:~>1.16' rake-compiler hoe mini_portile rubygems-tasks mini_portile2 && \
64
+ rvm all do gem install --no-document bundler 'bundler:~>1.16' 'rake-compiler:1.1.1' 'hoe:3.20.0' mini_portile rubygems-tasks mini_portile2 && \
42
65
  find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
43
66
 
44
67
  # Install rake-compiler's cross rubies in global dir instead of /root
@@ -48,15 +71,18 @@ RUN sudo mkdir -p /usr/local/rake-compiler && \
48
71
 
49
72
  # Add cross compilers for Windows and Linux
50
73
  USER root
74
+
75
+ <% if platform !~ /linux/ %>
51
76
  RUN apt-get -y update && \
52
- apt-get install -y moreutils <%
77
+ apt-get install -y <%
78
+ if platform=~/darwin/ %> clang python lzma-dev libxml2-dev libssl-dev libc++-10-dev <% end %><%
53
79
  if platform=~/x86-mingw32/ %> gcc-mingw-w64-i686 g++-mingw-w64-i686 <% end %><%
54
- if platform=~/x64-mingw32/ %> gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 <% end %><%
55
- if platform=~/x86-linux/ %> gcc-multilib g++-multilib <% end %> && \
80
+ if platform=~/x64-mingw32/ %> gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 <% end %> && \
56
81
  rm -rf /var/lib/apt/lists/*
82
+ <% end %>
57
83
 
58
84
  RUN bash -c " \
59
- rvm alias create default 2.5.7 && \
85
+ rvm alias create default 2.5.8 && \
60
86
  rvm use default "
61
87
 
62
88
  <% if platform=~/linux/ %>
@@ -66,46 +92,74 @@ RUN bash -c " \
66
92
  ruby /root/mk_i686.rb "
67
93
  <% end %>
68
94
 
69
- USER rvm
70
-
71
- COPY build/patches2 /home/rvm/patches/
72
- # Patch rake-compiler to build and install static libraries for Linux rubies
73
- RUN cd /usr/local/rvm/gems/ruby-2.5.7/gems/rake-compiler-1.1.0 && \
74
- ( git apply /home/rvm/patches/rake-compiler-1.1.0/*.patch || true )
75
- RUN cd /usr/local/rvm/gems/ruby-2.5.7/gems/hoe-3.20.0 && \
76
- ( git apply /home/rvm/patches/hoe-3.20.0/*.patch || true )
95
+ <% if platform=~/darwin/ %>
96
+ RUN git clone -q --depth=1 https://github.com/tpoechtrager/osxcross.git /opt/osxcross && rm -rf /opt/osxcross/.git && \
97
+ cd /opt/osxcross/tarballs && \
98
+ curl -L -o MacOSX11.1.sdk.tar.xz https://github.com/larskanis/MacOSX-SDKs/releases/download/11.1/MacOSX11.1.sdk.tar.xz && \
99
+ tar -xf MacOSX11.1.sdk.tar.xz -C . && \
100
+ cp -rf /usr/lib/llvm-10/include/c++ MacOSX11.1.sdk/usr/include/c++ && \
101
+ cp -rf /usr/include/x86_64-linux-gnu/c++/9/bits/ MacOSX11.1.sdk/usr/include/c++/v1/bits && \
102
+ tar -cJf MacOSX11.1.sdk.tar.xz MacOSX11.1.sdk && \
103
+ cd /opt/osxcross && \
104
+ UNATTENDED=1 SDK_VERSION=11.1 OSX_VERSION_MIN=10.13 USE_CLANG_AS=1 ./build.sh && \
105
+ rm -rf *~ build tarballs/*
106
+
107
+ RUN echo "export PATH=/opt/osxcross/target/bin:\$PATH" >> /etc/rubybashrc && \
108
+ echo "export MACOSX_DEPLOYMENT_TARGET=10.13" >> /etc/rubybashrc && \
109
+ echo "export OSXCROSS_MP_INC=1" >> /etc/rubybashrc
110
+
111
+ # Add links to build tools without target version kind of:
112
+ # arm64-apple-darwin-clang => arm64-apple-darwin20.1-clang
113
+ RUN rm /opt/osxcross/target/bin/*-apple-darwin-* ; \
114
+ find /opt/osxcross/target/bin/ -name '*-apple-darwin[0-9]*' | sort | while read f ; do d=`echo $f | sed s/darwin[0-9\.]*/darwin/`; echo $f '"$@"' | tee $d && chmod +x $d ; done
115
+
116
+ # There's no objdump in osxcross but we can use llvm's
117
+ RUN ln -s /usr/lib/llvm-10/bin/llvm-objdump /opt/osxcross/target/bin/x86_64-apple-darwin-objdump && \
118
+ ln -s /usr/lib/llvm-10/bin/llvm-objdump /opt/osxcross/target/bin/aarch64-apple-darwin-objdump
77
119
 
120
+ <% end %>
78
121
 
79
- # Patch ruby-2.7.0 for cross build
122
+ # Patch rake-compiler to build and install static libraries for Linux rubies
123
+ USER rvm
124
+ COPY build/patches2 /home/rvm/patches/
125
+ RUN bash -c " \
126
+ for v in ${RVM_RUBIES} ; do \
127
+ cd /usr/local/rvm/gems/ruby-\$v/gems/rake-compiler-1.1.1 && \
128
+ echo applying patches to ruby-\$v /home/rvm/patches/rake-compiler-1.1.1/*.patch && \
129
+ ( git apply /home/rvm/patches/rake-compiler-1.1.1/*.patch || true ) && \
130
+ cd /usr/local/rvm/gems/ruby-\$v/gems/hoe-3.20.0 && \
131
+ echo applying patches to ruby-\$v /home/rvm/patches/hoe-3.20.0/*.patch && \
132
+ ( git apply /home/rvm/patches/hoe-3.20.0/*.patch || true ) \
133
+ done "
134
+
135
+ # Patch rubies for cross build
80
136
  USER root
81
- RUN curl -SL http://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0.tar.xz | tar -xJC /root/ && \
82
- cd /root/ruby-2.7.0 && \
83
- git apply /home/rvm/patches/ruby-2.7.0/*.patch && \
84
- cd .. && \
85
- mkdir -p /usr/local/rake-compiler/sources/ && \
86
- tar cjf /usr/local/rake-compiler/sources/ruby-2.7.0.tar.bz2 ruby-2.7.0 && \
87
- chown rvm /usr/local/rake-compiler -R && \
88
- rm -rf /root/ruby-2.7.0
137
+ RUN bash -c " \
138
+ for v in 2.7.0 3.0.0 ; do \
139
+ curl -SL http://cache.ruby-lang.org/pub/ruby/\${v:0:3}/ruby-\$v.tar.xz | tar -xJC /root/ && \
140
+ cd /root/ruby-\$v && \
141
+ git apply /home/rvm/patches/ruby-\$v/*.patch && \
142
+ cd .. && \
143
+ mkdir -p /usr/local/rake-compiler/sources/ && \
144
+ tar cjf /usr/local/rake-compiler/sources/ruby-\$v.tar.bz2 ruby-\$v && \
145
+ chown rvm /usr/local/rake-compiler -R && \
146
+ rm -rf /root/ruby-\$v ; \
147
+ done "
89
148
  USER rvm
90
149
 
91
150
 
92
- ENV XRUBIES 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.2
151
+ ENV XRUBIES 3.0.0:2.7.0:2.6.0:2.5.0:2.4.0:2.3.0
93
152
 
94
- # First do downloads sequentially since they can not run in parallel
95
- # Then build all xruby versions in parallel
153
+ <% strip = '-s' if platform !~ /darwin/ %>
154
+ # Build all xruby versions in parallel
96
155
  # Then cleanup all build artifacts
97
- RUN for rv in $XRUBIES; do \
98
- bash -c "rake-compiler prepare-sources VERSION=$rv HOST=x86_64-linux"; \
99
- done; \
100
- for rv in $XRUBIES; do \
101
- for host in <%= target %>; do \
102
- echo -n "'env MAKE=\"make V=0\" rake-compiler cross-ruby VERSION=$rv HOST=$host' " >> ~/xbuild_rubies; \
103
- done; \
104
- done && \
105
- cat ~/xbuild_rubies; \
106
- bash -c " \
107
- export CFLAGS='-s -O1 -fno-omit-frame-pointer -fno-fast-math' && \
108
- parallel -- $( cat ~/xbuild_rubies ) && \
156
+ RUN bash -c " \
157
+ export CFLAGS='-O1 -fno-omit-frame-pointer -fno-fast-math -fstack-protector-strong <%= strip %>' && \
158
+ export LDFLAGS='-pipe <%= strip %>' && \
159
+ <%= "export LIBS='-l:libssp.a' &&" if platform =~ /mingw/ %> \
160
+ <%= "export CC=#{target}-clang &&" if platform =~ /darwin/ %> \
161
+ export MAKE='make V=1' && \
162
+ rake-compiler cross-ruby VERSION=$XRUBIES HOST=<%= target %> && \
109
163
  rm -rf ~/.rake-compiler/builds ~/.rake-compiler/sources && \
110
164
  find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
111
165
 
@@ -129,18 +183,9 @@ RUN find /usr/local/rake-compiler/ruby -name *msvcrt-ruby*.dll.a | while read f
129
183
 
130
184
  USER root
131
185
 
132
- # Add more libraries and tools to support cross build
133
- RUN <%
134
- if platform=~/x86-linux/ %> dpkg --add-architecture i386 && <% end %> \
135
- apt-get -y update && \
136
- apt-get install -y cmake <%
137
- if platform=~/x86-linux/ %> libc6-dev:i386 libudev-dev:i386 <% end %><%
138
- if platform=~/x86_64-linux/ %> libudev-dev <% end %> && \
139
- rm -rf /var/lib/apt/lists/*
186
+ # Fix paths in rake-compiler/config.yml
187
+ RUN sed -i -- "s:/root/.rake-compiler:/usr/local/rake-compiler:g" /usr/local/rake-compiler/config.yml
140
188
 
141
- # Fix paths in rake-compiler/config.yml and add rvm and mingw-tools to the global bashrc
142
- RUN sed -i -- "s:/root/.rake-compiler:/usr/local/rake-compiler:g" /usr/local/rake-compiler/config.yml && \
143
- echo "source /etc/profile.d/rvm.sh" >> /etc/bash.bashrc
144
189
 
145
190
  <% if platform=~/mingw/ %>
146
191
  # Install wrappers for strip commands as a workaround for "Protocol error" in boot2docker.
@@ -148,10 +193,6 @@ COPY build/strip_wrapper /root/
148
193
  RUN mv /usr/bin/<%= target %>-strip /usr/bin/<%= target %>-strip.bin && \
149
194
  ln /root/strip_wrapper /usr/bin/<%= target %>-strip
150
195
 
151
- # Don't link to winpthread.dll but link static, since the DLL is not distributed with RubyInstaller
152
- RUN find / -name libwinpthread.dll.a | xargs rm
153
- RUN find / -name libwinpthread-1.dll | xargs rm
154
-
155
196
  # Use posix pthread for mingw so that C++ standard library for thread could be
156
197
  # available such as std::thread, std::mutex, so on.
157
198
  # https://sourceware.org/pthreads-win32/
@@ -160,21 +201,31 @@ RUN printf "1\n" | update-alternatives --config <%= target %>-gcc && \
160
201
  <% end %>
161
202
 
162
203
  <% if platform=~/linux/ %>
163
- # Make the system to have GLIBC 2.12 instead of 2.23 so that
164
- # generated ruby package can run on CentOS 6 with GLIBC 2.12
165
- RUN sed -i 's/__GLIBC_MINOR__\t[0-9][0-9]/__GLIBC_MINOR__\t12/' /usr/include/features.h
204
+ # Enable modern compiler toolset of manylinux image
205
+ RUN echo "export PATH=\$DEVTOOLSET_ROOTPATH/usr/bin:\$PATH" >> /etc/rubybashrc
206
+
207
+ # Add prefixed versions of compiler tools
208
+ RUN for f in addr2line gcc gcov-tool ranlib ar dwp gcc-ranlib nm readelf as elfedit gcc-ar gprof objcopy size c++filt g++ gcov ld objdump strings cpp gcc-nm pkg-config strip ; do ln -sf $DEVTOOLSET_ROOTPATH/usr/bin/$f $DEVTOOLSET_ROOTPATH/usr/bin/<%= target %>-$f ; done
209
+
210
+ # ruby-2.5 links to libcrypt, which isn't necessary for extensions
211
+ RUN find /usr/local/rake-compiler/ruby -name rbconfig.rb | while read f ; do sed -i 's/-lcrypt//' $f ; done
212
+ <% end %>
213
+
214
+ <% if platform=~/arm64-darwin/ %>
215
+ # Add a arm64 darwin target as alternative to aarch64
216
+ RUN grep -E 'rbconfig-aarch64-darwin' /usr/local/rake-compiler/config.yml | sed 's/rbconfig-[a-z0-9_]*-darwin/rbconfig-<%= platform %>/' >> /usr/local/rake-compiler/config.yml
166
217
  <% end %>
167
218
 
168
219
  # Install SIGINT forwarder
169
220
  COPY build/sigfw.c /root/
170
- RUN gcc $HOME/sigfw.c -o /usr/local/bin/sigfw
221
+ RUN gcc $HOME/sigfw.c -o /usr/bin/sigfw
171
222
 
172
223
  # Install user mapper
173
- COPY build/runas /usr/local/bin/
224
+ COPY build/runas /usr/bin/
174
225
 
175
226
  # Install sudoers configuration
176
227
  COPY build/sudoers /etc/sudoers.d/rake-compiler-dock
177
228
 
178
- ENV RUBY_CC_VERSION 2.7.0:2.6.0:2.5.0:2.4.0:2.3.0:2.2.2
229
+ ENV RUBY_CC_VERSION 3.0.0:2.7.0:2.6.0:2.5.0:2.4.0:2.3.0
179
230
 
180
231
  CMD bash
data/History.md CHANGED
@@ -1,3 +1,18 @@
1
+ 1.1.0 / 2020-12-28
2
+ ------------------
3
+
4
+ * Use ManyLinux2014 as docker base image for linux targets.
5
+ That way compatibility to very old linux dists can be provided, while still using modern compilers.
6
+ * Add macOS cross build targets "x86_64-darwin" and "arm64-darwin".
7
+ They are based on MacOSX-SDK-11.1
8
+ * Add Ruby-3.0 as native rvm and cross ruby version.
9
+ * Remove Ruby-2.2 from RUBY_CC_VERSION and cross rubies.
10
+ * Update to Ubuntu-20.04 for Mingw and JRuby targets.
11
+ * Set `ExtensionTask#no_native=true` to fix issues with cross_compiling callback not being called.
12
+ See discussion here: https://github.com/rake-compiler/rake-compiler/pull/171
13
+ * Allow setting an alternative dockerhub user per `DOCKERHUB_USER`.
14
+
15
+
1
16
  1.0.1 / 2020-01-13
2
17
  ------------------
3
18
 
data/Rakefile CHANGED
@@ -6,19 +6,24 @@ require_relative "build/parallel_docker_build"
6
6
 
7
7
  RakeCompilerDock::GemHelper.install_tasks
8
8
 
9
+ DOCKERHUB_USER = ENV['DOCKERHUB_USER'] || "larskanis"
10
+
9
11
  namespace :build do
10
12
  platforms = [
11
13
  ["x86-mingw32", "i686-w64-mingw32"],
12
14
  ["x64-mingw32", "x86_64-w64-mingw32"],
13
- ["x86-linux", "i686-linux-gnu"],
14
- ["x86_64-linux", "x86_64-linux-gnu"],
15
+ ["x86-linux", "i686-redhat-linux"],
16
+ ["x86_64-linux", "x86_64-redhat-linux"],
17
+ ["x86_64-darwin", "x86_64-apple-darwin"],
18
+ ["arm64-darwin", "aarch64-apple-darwin"],
15
19
  ]
16
20
  platforms.each do |platform, target|
17
21
  sdf = "Dockerfile.mri.#{platform}"
22
+
18
23
  desc "Build image for platform #{platform}"
19
24
  task platform => sdf
20
25
  task sdf do
21
- sh "docker build -t larskanis/rake-compiler-dock-mri-#{platform}:#{RakeCompilerDock::IMAGE_VERSION} -f Dockerfile.mri.#{platform} ."
26
+ sh "docker build -t #{DOCKERHUB_USER}/rake-compiler-dock-mri-#{platform}:#{RakeCompilerDock::IMAGE_VERSION} -f Dockerfile.mri.#{platform} ."
22
27
  end
23
28
 
24
29
  df = ERB.new(File.read("Dockerfile.mri.erb")).result(binding)
@@ -29,11 +34,14 @@ namespace :build do
29
34
  desc "Build image for JRuby"
30
35
  task :jruby => "Dockerfile.jruby"
31
36
  task "Dockerfile.jruby" do
32
- sh "docker build -t larskanis/rake-compiler-dock-jruby:#{RakeCompilerDock::IMAGE_VERSION} -f Dockerfile.jruby ."
37
+ sh "docker build -t #{DOCKERHUB_USER}/rake-compiler-dock-jruby:#{RakeCompilerDock::IMAGE_VERSION} -f Dockerfile.jruby ."
33
38
  end
34
39
 
35
40
  RakeCompilerDock::ParallelDockerBuild.new(platforms.map{|pl, _| "Dockerfile.mri.#{pl}" } + ["Dockerfile.jruby"], workdir: "tmp/docker")
36
41
 
42
+ desc "Build images for all MRI platforms in parallel"
43
+ multitask :mri => platforms.map(&:first)
44
+
37
45
  desc "Build images for all platforms in parallel"
38
46
  multitask :all => platforms.map(&:first) + ["jruby"]
39
47
  end
@@ -11,14 +11,14 @@ index ebe3d8c..a336b73 100755
11
11
 
12
12
  fi
13
13
  diff --git a/io.c b/io.c
14
- index 82c5940538..a8d3661ec8 100644
14
+ index 48592ac51a..2635ac8ec6 100644
15
15
  --- a/io.c
16
16
  +++ b/io.c
17
- @@ -10721,7 +10721,6 @@ nogvl_copy_stream_wait_write(struct copy_stream_struct *stp)
17
+ @@ -11111,6 +11111,7 @@ nogvl_copy_stream_wait_write(struct copy_stream_struct *stp)
18
+ return 0;
18
19
  }
19
20
 
20
- #if defined HAVE_COPY_FILE_RANGE || (defined __linux__ && defined __NR_copy_file_range)
21
- -# define USE_COPY_FILE_RANGE
22
- #endif
23
-
21
+ +#undef USE_COPY_FILE_RANGE
24
22
  #ifdef USE_COPY_FILE_RANGE
23
+
24
+ static ssize_t
@@ -0,0 +1,214 @@
1
+ From 01fd7364bdcb37ac8709ffa48388b5cbe6478211 Mon Sep 17 00:00:00 2001
2
+ From: Lars Kanis <lars@greiz-reinsdorf.de>
3
+ Date: Fri, 10 Jan 2020 23:57:18 +0100
4
+ Subject: [PATCH] Allow building of cross rubies in parallel
5
+
6
+ Rubies can be build like so:
7
+ rake-compiler cross-ruby VERSION=2.7.0:2.6.0 HOST=x86_64-w64-mingw32:i686-w64-mingw32
8
+
9
+ This builds the cross product of all ":" separated ruby and host versions.
10
+ To force sequential builds add option "-j1".
11
+ ---
12
+ tasks/bin/cross-ruby.rake | 161 +++++++++++++++++++-------------------
13
+ 1 file changed, 80 insertions(+), 81 deletions(-)
14
+
15
+ diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
16
+ index 278541c..8b88025 100644
17
+ --- a/tasks/bin/cross-ruby.rake
18
+ +++ b/tasks/bin/cross-ruby.rake
19
+ @@ -41,106 +41,105 @@ end
20
+ require 'rake/extensioncompiler'
21
+
22
+ MAKE = ENV['MAKE'] || %w[gmake make].find { |c| system("#{c} -v > /dev/null 2>&1") }
23
+ -USER_HOME = File.expand_path("~/.rake-compiler")
24
+ -RUBY_CC_VERSION = "ruby-" << ENV.fetch("VERSION", "1.8.7-p371")
25
+ +USER_HOME = File.realpath(File.expand_path("~/.rake-compiler"))
26
+ RUBY_SOURCE = ENV['SOURCE']
27
+ RUBY_BUILD = RbConfig::CONFIG["host"]
28
+
29
+ -# grab the major "1.8" or "1.9" part of the version number
30
+ -MAJOR = RUBY_CC_VERSION.match(/.*-(\d.\d).\d/)[1]
31
+ -
32
+ -# Use Rake::ExtensionCompiler helpers to find the proper host
33
+ -MINGW_HOST = ENV['HOST'] || Rake::ExtensionCompiler.mingw_host
34
+ -MINGW_TARGET = MINGW_HOST.gsub('msvc', '')
35
+ -
36
+ # Unset any possible variable that might affect compilation
37
+ ["CC", "CXX", "CPPFLAGS", "LDFLAGS", "RUBYOPT"].each do |var|
38
+ ENV.delete(var)
39
+ end
40
+
41
+ -source_dir = "#{USER_HOME}/sources/#{RUBY_CC_VERSION}"
42
+ -build_dir = "#{USER_HOME}/builds/#{MINGW_HOST}/#{RUBY_CC_VERSION}"
43
+ -
44
+ -# define a location where sources will be stored
45
+ -directory source_dir
46
+ -directory build_dir
47
+ -
48
+ -# clean intermediate files and folders
49
+ -CLEAN.include(source_dir)
50
+ -CLEAN.include(build_dir)
51
+ -
52
+ -# remove the final products and sources
53
+ -CLOBBER.include("#{USER_HOME}/sources")
54
+ -CLOBBER.include("#{USER_HOME}/builds")
55
+ -CLOBBER.include("#{USER_HOME}/ruby/#{MINGW_HOST}/#{RUBY_CC_VERSION}")
56
+ -CLOBBER.include("#{USER_HOME}/config.yml")
57
+ +RUBY_CC_VERSIONS = ENV.fetch("VERSION", "1.8.7-p371")
58
+ +RUBY_CC_VERSIONS.split(":").each do |ruby_cc_version|
59
+ + ruby_cc_version = "ruby-" + ruby_cc_version
60
+ + # grab the major "1.8" or "1.9" part of the version number
61
+ + major = ruby_cc_version.match(/.*-(\d.\d).\d/)[1]
62
+ +
63
+ + # define a location where sources will be stored
64
+ + source_dir = "#{USER_HOME}/sources/#{ruby_cc_version}"
65
+ + directory source_dir
66
+ + # clean intermediate files and folders
67
+ + CLEAN.include(source_dir)
68
+ +
69
+ + # remove the final products and sources
70
+ + CLOBBER.include("#{USER_HOME}/sources")
71
+ + CLOBBER.include("#{USER_HOME}/builds")
72
+ + CLOBBER.include("#{USER_HOME}/config.yml")
73
+ +
74
+ + # Extract the sources
75
+ + source_file = RUBY_SOURCE ? RUBY_SOURCE.split('/').last : "#{ruby_cc_version}.tar.bz2"
76
+ + file source_dir => ["#{USER_HOME}/sources/#{source_file}"] do |t|
77
+ + t.prerequisites.each { |f| sh "tar xf #{File.basename(f)}", chdir: File.dirname(t.name) }
78
+ + end
79
+
80
+ -# ruby source file should be stored there
81
+ -file "#{USER_HOME}/sources/#{RUBY_CC_VERSION}.tar.bz2" => ["#{USER_HOME}/sources"] do |t|
82
+ - # download the source file using wget or curl
83
+ - chdir File.dirname(t.name) do
84
+ + # ruby source file should be stored there
85
+ + file "#{USER_HOME}/sources/#{ruby_cc_version}.tar.bz2" => ["#{USER_HOME}/sources"] do |t|
86
+ + # download the source file using wget or curl
87
+ if RUBY_SOURCE
88
+ url = RUBY_SOURCE
89
+ else
90
+ - url = "http://cache.ruby-lang.org/pub/ruby/#{MAJOR}/#{File.basename(t.name)}"
91
+ + url = "http://cache.ruby-lang.org/pub/ruby/#{major}/#{File.basename(t.name)}"
92
+ end
93
+ - sh "wget #{url} || curl -O #{url}"
94
+ + sh "wget #{url} || curl -O #{url}", chdir: File.dirname(t.name)
95
+ end
96
+ -end
97
+ -
98
+ -# Extract the sources
99
+ -source_file = RUBY_SOURCE ? RUBY_SOURCE.split('/').last : "#{RUBY_CC_VERSION}.tar.bz2"
100
+ -file source_dir => ["#{USER_HOME}/sources/#{source_file}"] do |t|
101
+ - chdir File.dirname(t.name) do
102
+ - t.prerequisites.each { |f| sh "tar xf #{File.basename(f)}" }
103
+ - end
104
+ -end
105
+
106
+ -task :mingw32 do
107
+ - unless MINGW_HOST then
108
+ - warn "You need to install mingw32 cross compile functionality to be able to continue."
109
+ - warn "Please refer to your distribution/package manager documentation about installation."
110
+ - fail
111
+ - end
112
+ -end
113
+ + # Create tasks for each host out of the ":" separated hosts list in the HOST variable.
114
+ + # These tasks are processed in parallel as dependencies to the "install" task.
115
+ + mingw_hosts = ENV['HOST'] || Rake::ExtensionCompiler.mingw_host
116
+ + mingw_hosts.split(":").each do |mingw_host|
117
+ +
118
+ + # Use Rake::ExtensionCompiler helpers to find the proper host
119
+ + mingw_target = mingw_host.gsub('msvc', '')
120
+ +
121
+ + # define a location where built files for each host will be stored
122
+ + build_dir = "#{USER_HOME}/builds/#{mingw_host}/#{ruby_cc_version}"
123
+ + directory build_dir
124
+ + install_dir = "#{USER_HOME}/ruby/#{mingw_host}/#{ruby_cc_version}"
125
+ +
126
+ + # clean intermediate files and folders
127
+ + CLEAN.include(build_dir)
128
+ + CLOBBER.include(install_dir)
129
+ +
130
+ + task :mingw32 do
131
+ + unless mingw_host then
132
+ + warn "You need to install mingw32 cross compile functionality to be able to continue."
133
+ + warn "Please refer to your distribution/package manager documentation about installation."
134
+ + fail
135
+ + end
136
+ + end
137
+
138
+ -# generate the makefile in a clean build location
139
+ -file "#{build_dir}/Makefile" => [build_dir, source_dir] do |t|
140
+ -
141
+ - options = [
142
+ - "--host=#{MINGW_HOST}",
143
+ - "--target=#{MINGW_TARGET}",
144
+ - "--build=#{RUBY_BUILD}",
145
+ - '--enable-shared',
146
+ - '--disable-install-doc',
147
+ - '--with-ext=',
148
+ - 'LDFLAGS=-pipe -s',
149
+ - ]
150
+ -
151
+ - # Force Winsock2 for Ruby 1.8, 1.9 defaults to it
152
+ - options << "--with-winsock2" if MAJOR == "1.8"
153
+ -
154
+ - chdir File.dirname(t.name) do
155
+ - prefix = File.expand_path("../../../ruby/#{MINGW_HOST}/#{RUBY_CC_VERSION}")
156
+ - options << "--prefix=#{prefix}"
157
+ - sh File.expand_path("../../../sources/#{RUBY_CC_VERSION}/configure"), *options
158
+ - end
159
+ -end
160
+ + # generate the makefile in a clean build location
161
+ + file "#{build_dir}/Makefile" => [build_dir, source_dir] do |t|
162
+ +
163
+ + options = [
164
+ + "--host=#{mingw_host}",
165
+ + "--target=#{mingw_target}",
166
+ + "--build=#{RUBY_BUILD}",
167
+ + '--enable-shared',
168
+ + '--disable-install-doc',
169
+ + '--with-ext=',
170
+ + 'LDFLAGS=-pipe -s',
171
+ + ]
172
+ +
173
+ + # Force Winsock2 for Ruby 1.8, 1.9 defaults to it
174
+ + options << "--with-winsock2" if major == "1.8"
175
+ + options << "--prefix=#{install_dir}"
176
+ + sh File.expand_path("#{USER_HOME}/sources/#{ruby_cc_version}/configure"), *options, chdir: File.dirname(t.name)
177
+ + end
178
+
179
+ -# make
180
+ -file "#{build_dir}/ruby.exe" => ["#{build_dir}/Makefile"] do |t|
181
+ - chdir File.dirname(t.prerequisites.first) do
182
+ - sh MAKE
183
+ - end
184
+ -end
185
+ + # make
186
+ + file "#{build_dir}/ruby.exe" => ["#{build_dir}/Makefile"] do |t|
187
+ + sh MAKE, chdir: File.dirname(t.prerequisites.first)
188
+ + end
189
+
190
+ -# make install
191
+ -file "#{USER_HOME}/ruby/#{MINGW_HOST}/#{RUBY_CC_VERSION}/bin/ruby.exe" => ["#{build_dir}/ruby.exe"] do |t|
192
+ - chdir File.dirname(t.prerequisites.first) do
193
+ - sh "#{MAKE} install"
194
+ + # make install
195
+ + file "#{USER_HOME}/ruby/#{mingw_host}/#{ruby_cc_version}/bin/ruby.exe" => ["#{build_dir}/ruby.exe"] do |t|
196
+ + sh "#{MAKE} install", chdir: File.dirname(t.prerequisites.first)
197
+ + end
198
+ + multitask :install => ["#{USER_HOME}/ruby/#{mingw_host}/#{ruby_cc_version}/bin/ruby.exe"]
199
+ end
200
+ end
201
+ -task :install => ["#{USER_HOME}/ruby/#{MINGW_HOST}/#{RUBY_CC_VERSION}/bin/ruby.exe"]
202
+
203
+ desc "Update rake-compiler list of installed Ruby versions"
204
+ task 'update-config' do
205
+ @@ -187,5 +186,5 @@ task :default do
206
+ Rake.application.display_tasks_and_comments
207
+ end
208
+
209
+ -desc "Build #{RUBY_CC_VERSION} suitable for cross-platform development."
210
+ +desc "Build rubies suitable for cross-platform development."
211
+ task 'cross-ruby' => [:mingw32, :install, 'update-config']
212
+ --
213
+ 2.20.1
214
+
@@ -0,0 +1,29 @@
1
+ diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
2
+ index 8edf5cd..5d25b82 100644
3
+ --- a/tasks/bin/cross-ruby.rake
4
+ +++ b/tasks/bin/cross-ruby.rake
5
+ @@ -116,11 +116,22 @@ RUBY_CC_VERSIONS.split(":").each do |ruby_cc_version|
6
+ "--host=#{mingw_host}",
7
+ "--target=#{mingw_target}",
8
+ "--build=#{RUBY_BUILD}",
9
+ - '--enable-shared',
10
+ + '--enable-install-static-library',
11
+ + '--disable-jit-support',
12
+ '--disable-install-doc',
13
+ '--with-ext=',
14
+ - 'LDFLAGS=-pipe -s',
15
+ ]
16
+ + if mingw_host=~/darwin/
17
+ + options += [
18
+ + '--enable-static',
19
+ + '--disable-shared',
20
+ + ]
21
+ + else
22
+ + options += [
23
+ + '--enable-static',
24
+ + '--enable-shared',
25
+ + ]
26
+ + end
27
+
28
+ # Force Winsock2 for Ruby 1.8, 1.9 defaults to it
29
+ options << "--with-winsock2" if major == "1.8"
@@ -0,0 +1,30 @@
1
+ From 783d3d380e6abf107e0747d229da0f5e001c623f Mon Sep 17 00:00:00 2001
2
+ From: Lars Kanis <lars@greiz-reinsdorf.de>
3
+ Date: Sun, 20 Dec 2020 19:08:22 +0100
4
+ Subject: [PATCH] Don't mask out build env vars for cross-ruby
5
+
6
+ This was introduced in commit a7c113e580c1565000166f9967da82ff2ecdaeaa to avoid interference with host build.
7
+ However it prohibits setting important flags for cross-build.
8
+
9
+ Also don't force 'LDFLAGS=-pipe -s' in configure, which doesn't work with clang targeting MacOS.
10
+ It can now be set externally.
11
+ ---
12
+ tasks/bin/cross-ruby.rake | 3 +--
13
+ 1 file changed, 1 insertion(+), 2 deletions(-)
14
+
15
+ diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
16
+ index 8edf5cd..8317a2a 100644
17
+ --- a/tasks/bin/cross-ruby.rake
18
+ +++ b/tasks/bin/cross-ruby.rake
19
+ @@ -46,7 +46,7 @@ RUBY_SOURCE = ENV['SOURCE']
20
+ RUBY_BUILD = RbConfig::CONFIG["host"]
21
+
22
+ # Unset any possible variable that might affect compilation
23
+ -["CC", "CXX", "CPPFLAGS", "LDFLAGS", "RUBYOPT"].each do |var|
24
+ +["RUBYOPT"].each do |var|
25
+ ENV.delete(var)
26
+ end
27
+
28
+ --
29
+ 2.27.0
30
+
@@ -0,0 +1,26 @@
1
+ From 15f630adc4325f9cafb762e15a051c2ec8bd21e2 Mon Sep 17 00:00:00 2001
2
+ From: Sutou Kouhei <kou@clear-code.com>
3
+ Date: Mon, 21 Dec 2020 04:30:44 +0900
4
+ Subject: [PATCH] Use RAKE_EXTENSION_TASK_NO_NATIVE env var as the default
5
+ value
6
+
7
+ ---
8
+ lib/rake/extensiontask.rb | 2 +-
9
+ 1 file changed, 1 insertion(+), 1 deletion(-)
10
+
11
+ diff --git a/lib/rake/extensiontask.rb b/lib/rake/extensiontask.rb
12
+ index b0ab88e..49d59da 100644
13
+ --- a/lib/rake/extensiontask.rb
14
+ +++ b/lib/rake/extensiontask.rb
15
+ @@ -23,7 +23,7 @@ module Rake
16
+ @cross_compile = false
17
+ @cross_config_options = []
18
+ @cross_compiling = nil
19
+ - @no_native = false
20
+ + @no_native = (ENV["RAKE_EXTENSION_TASK_NO_NATIVE"] == "true")
21
+ @config_includes = []
22
+ @ruby_versions_per_platform = {}
23
+ @make = nil
24
+ --
25
+ 2.27.0
26
+
@@ -0,0 +1,15 @@
1
+ diff --git a/template/fake.rb.in b/template/fake.rb.in
2
+ index f1da719ecb..e0b649fb28 100644
3
+ --- a/template/fake.rb.in
4
+ +++ b/template/fake.rb.in
5
+ @@ -27,6 +27,10 @@ case "$0" in /*) r=-r"$0";; *) r=-r"./$0";; esac
6
+ exec $ruby "$r" "$@"
7
+ =end
8
+ =baseruby
9
+ +<% if RUBY_VERSION < "2.7" %>
10
+ +def ruby2_keywords(*)
11
+ +end
12
+ +<% end %>
13
+ class Object
14
+ remove_const :CROSS_COMPILING if defined?(CROSS_COMPILING)
15
+ CROSS_COMPILING = RUBY_PLATFORM
@@ -9,6 +9,7 @@ ln -s /usr/local/rake-compiler "$HOME"/.rake-compiler
9
9
  mkdir -p "$HOME"/.gem
10
10
  chown "$USER" "$HOME"/.gem
11
11
 
12
- sudo -u "$USER" --set-home \
12
+ /usr/bin/sudo -u "$USER" -H \
13
13
  BASH_ENV=/etc/rubybashrc \
14
+ RAKE_EXTENSION_TASK_NO_NATIVE=true \
14
15
  -- "$@"
@@ -1 +1 @@
1
- Defaults env_keep += "http_proxy https_proxy ftp_proxy GEM_PRIVATE_KEY_PASSPHRASE RCD_HOST_RUBY_PLATFORM RCD_HOST_RUBY_VERSION RCD_IMAGE RUBY_CC_VERSION"
1
+ Defaults env_keep += "http_proxy https_proxy ftp_proxy GEM_PRIVATE_KEY_PASSPHRASE RCD_HOST_RUBY_PLATFORM RCD_HOST_RUBY_VERSION RCD_IMAGE RUBY_CC_VERSION LD_LIBRARY_PATH DEVTOOLSET_ROOTPATH"
@@ -1,4 +1,4 @@
1
1
  module RakeCompilerDock
2
- VERSION = "1.0.1"
3
- IMAGE_VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
+ IMAGE_VERSION = "1.1.0"
4
4
  end
metadata CHANGED
@@ -1,14 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-compiler-dock
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Kanis
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain: []
11
- date: 2020-01-13 00:00:00.000000000 Z
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDPDCCAiSgAwIBAgIBBTANBgkqhkiG9w0BAQsFADBEMQ0wCwYDVQQDDARsYXJz
14
+ MR8wHQYKCZImiZPyLGQBGRYPZ3JlaXotcmVpbnNkb3JmMRIwEAYKCZImiZPyLGQB
15
+ GRYCZGUwHhcNMjAxMjI2MTgzMzUyWhcNMjExMjI2MTgzMzUyWjBEMQ0wCwYDVQQD
16
+ DARsYXJzMR8wHQYKCZImiZPyLGQBGRYPZ3JlaXotcmVpbnNkb3JmMRIwEAYKCZIm
17
+ iZPyLGQBGRYCZGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZb4Uv
18
+ RFJfRu/VEWiy3psh2jinETjiuBrL0NeRFGf8H7iU9+gx/DI/FFhfHGLrDeIskrJx
19
+ YIWDMmEjVO10UUdj7wu4ZhmU++0Cd7Kq9/TyP/shIP3IjqHjVLCnJ3P6f1cl5rxZ
20
+ gqo+d3BAoDrmPk0rtaf6QopwUw9RBiF8V4HqvpiY+ruJotP5UQDP4/lVOKvA8PI9
21
+ P0GmVbFBrbc7Zt5h78N3UyOK0u+nvOC23BvyHXzCtcFsXCoEkt+Wwh0RFqVZdnjM
22
+ LMO2vULHKKHDdX54K/sbVCj9pN9h1aotNzrEyo55zxn0G9PHg/G3P8nMvAXPkUTe
23
+ brhXrfCwWRvOXA4TAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0G
24
+ A1UdDgQWBBRAHK81igrXodaDj8a8/BIKsaZrETANBgkqhkiG9w0BAQsFAAOCAQEA
25
+ DT6QoI7WEM1wivGn5BBHv3hJa2vGgmAxSPy7QM5iQX7U2ROfOeXYIHIRxsIv/cQl
26
+ +F568J6v3GAcFePi4Is9S7b8KWQkm+IjrPjL863hds6WVG8KyJZ758oczbviXNEV
27
+ vzna4S8Ra0m7LqGYGZW9B8ZIVdfhzKAF6V6iVlQtEFP7GQp17SjpNPd/gCbictIw
28
+ +jwual4DCn3p1X+Vgyl/AXPwU1NBAuuYUijOr7dVIoW2QNUh2d7jCwGe2mNi7Dbu
29
+ CqyDIUe+OuWLEpvgupYpVKQKx4+pa0s2ccLokMXYGFp1Z36heaYApV92yDjks8Sq
30
+ XtSi3zpLl4JPGBoeuZj97Q==
31
+ -----END CERTIFICATE-----
32
+ date: 2020-12-29 00:00:00.000000000 Z
12
33
  dependencies:
13
34
  - !ruby/object:Gem::Dependency
14
35
  name: bundler
@@ -74,15 +95,16 @@ files:
74
95
  - build/gem_helper.rb
75
96
  - build/mk_i686.rb
76
97
  - build/parallel_docker_build.rb
77
- - build/patches/ruby-2.5.7/no_sendfile.patch
78
- - build/patches/ruby-2.7.0/no_sendfile.patch
98
+ - build/patches/ruby-2.5.8/no_sendfile.patch
99
+ - build/patches/ruby-3.0.0/no_sendfile.patch
79
100
  - build/patches2/hoe-3.20.0/0001-Load-encrypted-private-key-using-ENV-GEM_PRIVATE_KEY.patch
80
- - build/patches2/rake-compiler-1.1.0/0001-Allow-parallel-builds-of-cross-rubies.patch
81
- - build/patches2/rake-compiler-1.1.0/0001-Enable-build-of-static-libruby.patch
82
- - build/patches2/rake-compiler-1.1.0/0001-Fix-determining-of-ruby-versions-in-rake-native-gem.patch
83
- - build/patches2/rake-compiler-1.1.0/0002-Extend-mingw-search-pattern-to-find-x86_64-gcc.patch
84
- - build/patches2/rake-compiler-1.1.0/0002-Strip-cross-built-shared-library-files-while-linking.patch
101
+ - build/patches2/rake-compiler-1.1.1/0001-Fix-determining-of-ruby-versions-in-rake-native-gem.patch
102
+ - build/patches2/rake-compiler-1.1.1/0003-Allow-building-of-cross-rubies-in-parallel.patch
103
+ - build/patches2/rake-compiler-1.1.1/0004-Enable-build-of-static-libruby.patch
104
+ - build/patches2/rake-compiler-1.1.1/0005-Don-t-mask-out-build-env-vars-for-cross-ruby.patch
105
+ - build/patches2/rake-compiler-1.1.1/0006-Use-RAKE_EXTENSION_TASK_NO_NATIVE-env-var-as-the-def.patch
85
106
  - build/patches2/ruby-2.7.0/ruby2_keywords.patch
107
+ - build/patches2/ruby-3.0.0/ruby2_keywords.patch
86
108
  - build/runas
87
109
  - build/sigfw.c
88
110
  - build/strip_wrapper
@@ -116,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
138
  - !ruby/object:Gem::Version
117
139
  version: '0'
118
140
  requirements: []
119
- rubygems_version: 3.0.6
141
+ rubygems_version: 3.1.4
120
142
  signing_key:
121
143
  specification_version: 4
122
144
  summary: Easy to use and reliable cross compiler environment for building Windows
@@ -0,0 +1,2 @@
1
+
2
+ � ;�&%$xu�Q�����G�A�Ơ�9r\ZA�'g
@@ -1,119 +0,0 @@
1
- From e0be66410b32a41591d27c34e2163ed587ae427b Mon Sep 17 00:00:00 2001
2
- From: Lars Kanis <lars@greiz-reinsdorf.de>
3
- Date: Sun, 22 Dec 2019 21:37:07 +0100
4
- Subject: [PATCH] Allow parallel builds of cross rubies
5
-
6
- Download and extraction of sources can not run in parallel, since the sources are used for multiple targets.
7
- Therefore this part can now be separately executed by
8
- rake-compiler prepare-sources RUBY_CC_VERSION=...
9
-
10
- Afterwards multiple cross rubies can be built in parallel by
11
- rake-compiler cross-ruby RUBY_CC_VERSION=... HOST=...
12
-
13
- Access to config.yml must be synchronized, when running in parallel, which is done per File#flock .
14
- ---
15
- lib/rake/extensiontask.rb | 5 +++-
16
- tasks/bin/cross-ruby.rake | 56 +++++++++++++++++++++------------------
17
- 2 files changed, 34 insertions(+), 27 deletions(-)
18
-
19
- diff --git a/lib/rake/extensiontask.rb b/lib/rake/extensiontask.rb
20
- index d85b1a3..89f2198 100644
21
- --- a/lib/rake/extensiontask.rb
22
- +++ b/lib/rake/extensiontask.rb
23
- @@ -376,7 +376,10 @@ Java extension should be preferred.
24
- return
25
- end
26
-
27
- - config_file = YAML.load_file(config_path)
28
- + config_file = File.open(config_path) do |fd|
29
- + fd.flock(File::LOCK_SH)
30
- + YAML.load(fd.read)
31
- + end
32
-
33
- # tmp_path
34
- tmp_path = "#{@tmp_dir}/#{for_platform}/#{@name}/#{ruby_ver}"
35
- diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
36
- index 37dd220..3fcfe1d 100644
37
- --- a/tasks/bin/cross-ruby.rake
38
- +++ b/tasks/bin/cross-ruby.rake
39
- @@ -126,6 +126,8 @@ file makefile_in => [makefile_in_bak] do |t|
40
- }
41
- end
42
-
43
- +task "prepare-sources" => makefile_in
44
- +
45
- task :mingw32 do
46
- unless MINGW_HOST then
47
- warn "You need to install mingw32 cross compile functionality to be able to continue."
48
- @@ -174,40 +176,42 @@ task :install => ["#{USER_HOME}/ruby/#{MINGW_HOST}/#{RUBY_CC_VERSION}/bin/ruby.e
49
- desc "Update rake-compiler list of installed Ruby versions"
50
- task 'update-config' do
51
- config_file = "#{USER_HOME}/config.yml"
52
- - if File.exist?(config_file) then
53
- - puts "Updating #{config_file}"
54
- - config = YAML.load_file(config_file)
55
- - else
56
- - puts "Generating #{config_file}"
57
- - config = {}
58
- - end
59
- + File.open(config_file, File::RDWR|File::CREAT) do |config_fd|
60
- + config_fd.flock(File::LOCK_EX)
61
- + config = YAML.load(config_fd.read)
62
- + if config
63
- + puts "Updating #{config_file}"
64
- + else
65
- + puts "Generating #{config_file}"
66
- + config = {}
67
- + end
68
-
69
- - files = Dir.glob("#{USER_HOME}/ruby/*/*/**/rbconfig.rb").sort
70
- + files = Dir.glob("#{USER_HOME}/ruby/*/*/**/rbconfig.rb").sort
71
-
72
- - files.each do |rbconfig|
73
- - version, platform = rbconfig.match(/.*-(\d.\d.\d).*\/([-\w]+)\/rbconfig/)[1,2]
74
- - platforms = [platform]
75
- + files.each do |rbconfig|
76
- + version, platform = rbconfig.match(/.*-(\d.\d.\d).*\/([-\w]+)\/rbconfig/)[1,2]
77
- + platforms = [platform]
78
-
79
- - # fake alternate (binary compatible) i386-mswin32-60 platform
80
- - platform == "i386-mingw32" and
81
- - platforms.push "i386-mswin32-60"
82
- + # fake alternate (binary compatible) i386-mswin32-60 platform
83
- + platform == "i386-mingw32" and
84
- + platforms.push "i386-mswin32-60"
85
-
86
- - platforms.each do |plat|
87
- - config["rbconfig-#{plat}-#{version}"] = rbconfig
88
- + platforms.each do |plat|
89
- + config["rbconfig-#{plat}-#{version}"] = rbconfig
90
-
91
- - # also store RubyGems-compatible version
92
- - gem_platform = Gem::Platform.new(plat)
93
- - config["rbconfig-#{gem_platform}-#{version}"] = rbconfig
94
- + # also store RubyGems-compatible version
95
- + gem_platform = Gem::Platform.new(plat)
96
- + config["rbconfig-#{gem_platform}-#{version}"] = rbconfig
97
- + end
98
- +
99
- + puts "Found Ruby version #{version} for platform #{platform} (#{rbconfig})"
100
- end
101
-
102
- - puts "Found Ruby version #{version} for platform #{platform} (#{rbconfig})"
103
- + when_writing("Saving changes into #{config_file}") {
104
- + config_fd.rewind
105
- + config_fd.puts config.to_yaml
106
- + }
107
- end
108
- -
109
- - when_writing("Saving changes into #{config_file}") {
110
- - File.open(config_file, 'w') do |f|
111
- - f.puts config.to_yaml
112
- - end
113
- - }
114
- end
115
-
116
- task :default do
117
- --
118
- 2.20.1
119
-
@@ -1,28 +0,0 @@
1
- From 0b929b7027eb592c0971a400184f1dfa5a0bce7c Mon Sep 17 00:00:00 2001
2
- From: Lars Kanis <lars@greiz-reinsdorf.de>
3
- Date: Thu, 26 Dec 2019 19:13:48 +0100
4
- Subject: [PATCH 1/2] Enable build of static libruby
5
-
6
- This is used in rake-compiler-dock for linux targets.
7
- The static libruby is postprocessed in a special way.
8
- See rake-compiler-dock's Dockerfile.
9
- ---
10
- tasks/bin/cross-ruby.rake | 2 ++
11
- 1 file changed, 2 insertions(+)
12
-
13
- diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
14
- index c9b0bbb..2a73be7 100644
15
- --- a/tasks/bin/cross-ruby.rake
16
- +++ b/tasks/bin/cross-ruby.rake
17
- @@ -108,6 +108,8 @@ end
18
- file "#{build_dir}/Makefile" => [build_dir, makefile_in] do |t|
19
-
20
- options = [
21
- + '--enable-static',
22
- + '--enable-install-static-library',
23
- "--host=#{MINGW_HOST}",
24
- "--target=#{MINGW_TARGET}",
25
- "--build=#{RUBY_BUILD}",
26
- --
27
- 2.20.1
28
-
@@ -1,26 +0,0 @@
1
- From 07b1a4909fa59324d309bb8a46867cacba97cafd Mon Sep 17 00:00:00 2001
2
- From: Lars Kanis <lars@greiz-reinsdorf.de>
3
- Date: Thu, 26 Dec 2019 18:31:25 +0100
4
- Subject: [PATCH] Extend mingw search pattern to find x86_64 gcc
5
-
6
- The previous pattern only recognized 32 bit compiler versions.
7
- ---
8
- lib/rake/extensioncompiler.rb | 2 +-
9
- 1 file changed, 1 insertion(+), 1 deletion(-)
10
-
11
- diff --git a/lib/rake/extensioncompiler.rb b/lib/rake/extensioncompiler.rb
12
- index b3d336b..75f4694 100644
13
- --- a/lib/rake/extensioncompiler.rb
14
- +++ b/lib/rake/extensioncompiler.rb
15
- @@ -37,7 +37,7 @@ module Rake
16
- paths = ENV['PATH'].split(File::PATH_SEPARATOR)
17
-
18
- # the pattern to look into (captures *nix and windows executables)
19
- - pattern = "{mingw32-,i?86*mingw*}gcc{,.*}"
20
- + pattern = "{mingw32-,i?86*mingw*,x86*mingw*}gcc{,.*}"
21
-
22
- @mingw_gcc_executable = paths.find do |path|
23
- # cleanup paths before globbing
24
- --
25
- 2.20.1
26
-
@@ -1,29 +0,0 @@
1
- From 13e33405d4e51a52402e1e37e7e2df7f1f32892d Mon Sep 17 00:00:00 2001
2
- From: Lars Kanis <lars@greiz-reinsdorf.de>
3
- Date: Thu, 26 Dec 2019 19:18:02 +0100
4
- Subject: [PATCH 2/2] Strip cross built shared library files while linking
5
-
6
- The .so files of extensions are often stripped after compilation per task in a Rakefile.
7
- However this can be omitted, if the cross ruby version is built with stripping enabled.
8
- Stripping the files a second time doesn't make a difference then.
9
- ---
10
- tasks/bin/cross-ruby.rake | 3 ++-
11
- 1 file changed, 2 insertions(+), 1 deletion(-)
12
-
13
- diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
14
- index 2a73be7..a9eb16b 100644
15
- --- a/tasks/bin/cross-ruby.rake
16
- +++ b/tasks/bin/cross-ruby.rake
17
- @@ -115,7 +115,8 @@ file "#{build_dir}/Makefile" => [build_dir, source_dir] do |t|
18
- "--build=#{RUBY_BUILD}",
19
- '--enable-shared',
20
- '--disable-install-doc',
21
- - '--with-ext='
22
- + '--with-ext=',
23
- + 'LDFLAGS=-pipe -s',
24
- ]
25
-
26
- # Force Winsock2 for Ruby 1.8, 1.9 defaults to it
27
- --
28
- 2.20.1
29
-