rake-compiler-dock 1.1.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.github/workflows/ci.yml +240 -0
  4. data/.gitignore +11 -1
  5. data/Dockerfile.jruby +6 -5
  6. data/Dockerfile.mri.erb +91 -45
  7. data/History.md +34 -1
  8. data/README.md +92 -36
  9. data/Rakefile +39 -12
  10. data/build/math_h.patch +189 -0
  11. data/build/parallel_docker_build.rb +7 -3
  12. data/build/patches/{ruby-2.5.8 → ruby-2.5.9}/no_sendfile.patch +0 -0
  13. data/build/patches/{ruby-3.0.0 → ruby-3.1.0}/no_sendfile.patch +0 -0
  14. data/build/patches2/{rake-compiler-1.1.1 → rake-compiler-1.1.6}/0004-Enable-build-of-static-libruby.patch +3 -4
  15. data/build/rcd-env.sh +6 -0
  16. data/build/runas +1 -9
  17. data/lib/rake_compiler_dock/starter.rb +3 -2
  18. data/lib/rake_compiler_dock/version.rb +2 -2
  19. data/mingw64-ucrt/Dockerfile +62 -0
  20. data/mingw64-ucrt/binutils-mingw-w64-ignore-check-errors.patch +13 -0
  21. data/mingw64-ucrt/gcc-mingw-w64-only-c-c++.patch +13 -0
  22. data/mingw64-ucrt/mingw-w64-enable-ucrt.patch +22 -0
  23. data/rake-compiler-dock.gemspec +2 -2
  24. data/test/env/Dockerfile.alpine +17 -0
  25. data/test/env/Dockerfile.centos +22 -0
  26. data/test/env/Dockerfile.debian +24 -0
  27. data/test/rcd_test/Gemfile +11 -0
  28. data/test/rcd_test/Rakefile +76 -0
  29. data/test/rcd_test/ext/java/RcdTestExtService.java +19 -0
  30. data/test/rcd_test/ext/java/RubyRcdTest.java +16 -0
  31. data/test/rcd_test/ext/mri/extconf.rb +29 -0
  32. data/test/rcd_test/ext/mri/rcd_test_ext.c +51 -0
  33. data/test/rcd_test/ext/mri/rcd_test_ext.h +6 -0
  34. data/test/rcd_test/lib/rcd_test.rb +6 -0
  35. data/test/rcd_test/rcd_test.gemspec +27 -0
  36. data/test/rcd_test/test/test_basic.rb +31 -0
  37. data/test/test_environment_variables.rb +56 -31
  38. data/test/test_parallel_docker_build.rb +19 -6
  39. data.tar.gz.sig +0 -0
  40. metadata +75 -37
  41. metadata.gz.sig +2 -2
  42. data/build/patches2/hoe-3.20.0/0001-Load-encrypted-private-key-using-ENV-GEM_PRIVATE_KEY.patch +0 -32
  43. data/build/patches2/rake-compiler-1.1.1/0001-Fix-determining-of-ruby-versions-in-rake-native-gem.patch +0 -44
  44. data/build/patches2/rake-compiler-1.1.1/0003-Allow-building-of-cross-rubies-in-parallel.patch +0 -214
  45. data/build/patches2/rake-compiler-1.1.1/0005-Don-t-mask-out-build-env-vars-for-cross-ruby.patch +0 -30
  46. data/build/patches2/rake-compiler-1.1.1/0006-Use-RAKE_EXTENSION_TASK_NO_NATIVE-env-var-as-the-def.patch +0 -26
  47. data/build/patches2/ruby-2.7.0/ruby2_keywords.patch +0 -15
  48. data/build/patches2/ruby-3.0.0/ruby2_keywords.patch +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7bbe8d21de2a30484e2ec2d877bf6e2e2538c7f02d207e924716d9bb99609fbf
4
- data.tar.gz: 2069a049a2a9974a98f13bfd704f60f8e07dc5741f2e0f5d18a6c4f122358875
3
+ metadata.gz: 22fdbf0b0336450a55882dd000bea66c52a43325c6de59b0721ffbc6b5360576
4
+ data.tar.gz: 425f0ae751dfdcd3ff2936ff387c58b20d89e297d831c8c333ddd5738a9a92c2
5
5
  SHA512:
6
- metadata.gz: 197abac03aa2262d6893e4f79dcb9fa63bbf7018afa70d6ea7c189abc390074a36c7892b6745e8399ffbe4309686b5310c382d5227dfe9906d6bd875a561b5af
7
- data.tar.gz: 184393bac4b1890e1c19567c7c80ecc3a015e78e8789232c4f00a28d7c2a6ba0209ae94e9c1ffa2dcbd58bcd9eb8a1875732c32263cdbd47499437bc0e3617aa
6
+ metadata.gz: 290f60e3969979b7830ab2a69c8989c484dbdf116fc76d9424a5efb71e5a1a4ab0bb834bc6504b3db3b383b76fbdb35ea070566d5118420ebfcf8b454a85a0a3
7
+ data.tar.gz: ab7a5180be028e305798032e35fc2070bce0ad882ace282ec21700b74552d35bf8a80dd2b660f9c66a8247605c11277eaf79c9ee338430b8ef4511bc945f1dfc
checksums.yaml.gz.sig CHANGED
Binary file
@@ -0,0 +1,240 @@
1
+ name: Build docker images
2
+ concurrency:
3
+ group: "${{github.workflow}}-${{github.ref}}"
4
+ cancel-in-progress: true
5
+ on:
6
+ workflow_dispatch:
7
+ push:
8
+ branches:
9
+ - main
10
+ tags:
11
+ - "*.*.*"
12
+ pull_request:
13
+ types: [opened, synchronize]
14
+ branches:
15
+ - "*"
16
+
17
+ jobs:
18
+ # These jobs use Buildx layer caching
19
+ docker_build:
20
+ name: Build
21
+
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ platform:
26
+ - x86-mingw32
27
+ - x64-mingw-ucrt
28
+ - x64-mingw32
29
+ - x86-linux
30
+ - x86_64-linux
31
+ - x86_64-darwin
32
+ - arm64-darwin
33
+ - arm-linux
34
+ - aarch64-linux
35
+ - jruby
36
+
37
+ runs-on: ubuntu-latest
38
+ env:
39
+ PLATFORM: ${{ matrix.platform }}
40
+ steps:
41
+ - uses: actions/checkout@v2
42
+
43
+ - name: Cache Docker layers
44
+ uses: actions/cache@v2
45
+ with:
46
+ path: tmp/build-cache
47
+ key: ${{ runner.os }}-${{ matrix.platform }}-buildx-${{ github.sha }}
48
+ restore-keys: |
49
+ ${{ runner.os }}-${{ matrix.platform }}-buildx
50
+
51
+ - uses: ruby/setup-ruby@v1
52
+ with:
53
+ ruby-version: "3.0"
54
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
55
+
56
+ - name: Build docker image
57
+ run: |
58
+ docker buildx create --driver docker-container --use
59
+ bundle exec rake build:${PLATFORM} RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,src=tmp/build-cache --cache-to=type=local,dest=tmp/build-cache-new --load"
60
+
61
+ - name: Move build cache and remove outdated layers
62
+ run: |
63
+ rm -rf tmp/build-cache
64
+ mv tmp/build-cache-new tmp/build-cache
65
+
66
+ - name: Build rcd_test.gem
67
+ run: |
68
+ gem build rake-compiler-dock.gemspec
69
+ gem install -l rake-compiler-dock-*.gem
70
+ cd test/rcd_test/
71
+ bundle install
72
+ bundle exec rake clean clobber
73
+ bundle exec rake gem:${PLATFORM}
74
+
75
+ - name: Upload binary gem
76
+ uses: actions/upload-artifact@v2
77
+ with:
78
+ name: gem-${{ matrix.platform }}
79
+ path: test/rcd_test/pkg/*-*-*.gem
80
+
81
+ - if: matrix.platform == 'jruby'
82
+ name: Upload source gem
83
+ uses: actions/upload-artifact@v2
84
+ with:
85
+ name: gem-ruby
86
+ path: test/rcd_test/pkg/*-?.?.?.gem
87
+
88
+ - if: contains(matrix.platform, 'x64-mingw')
89
+ name: Build static rcd_test.gem
90
+ env:
91
+ RCD_TEST_CONFIG: "--link-static"
92
+ run: |
93
+ gem build rake-compiler-dock.gemspec
94
+ gem install -l rake-compiler-dock-*.gem
95
+ cd test/rcd_test/
96
+ bundle install
97
+ bundle exec rake clean clobber
98
+ bundle exec rake gem:${PLATFORM}
99
+
100
+ - if: contains(matrix.platform, 'x64-mingw')
101
+ name: Upload static binary gem
102
+ uses: actions/upload-artifact@v2
103
+ with:
104
+ name: gem-${{ matrix.platform }}-static
105
+ path: test/rcd_test/pkg/*-*-*.gem
106
+
107
+ job_test_native:
108
+ name: Test (${{matrix.ruby}}, ${{matrix.platform}})
109
+ needs: docker_build
110
+ strategy:
111
+ fail-fast: false
112
+ matrix:
113
+ os:
114
+ - windows
115
+ - macos
116
+ - ubuntu
117
+ ruby:
118
+ - "3.1"
119
+ - "3.0"
120
+ - "2.7"
121
+ - "2.6"
122
+ - "2.5"
123
+ - "2.4"
124
+ include:
125
+ - os: windows
126
+ platform: x64-mingw32
127
+ - os: macos
128
+ platform: x86_64-darwin
129
+ - os: ubuntu
130
+ platform: x86_64-linux
131
+ - os: ubuntu
132
+ platform: ruby
133
+ - os: ubuntu
134
+ ruby: jruby-head
135
+ platform: jruby
136
+ - os: windows
137
+ ruby: "3.1"
138
+ platform: x64-mingw-ucrt
139
+ exclude:
140
+ - os: windows
141
+ ruby: "3.1"
142
+
143
+ runs-on: ${{ matrix.os }}-latest
144
+ steps:
145
+ - uses: actions/checkout@v2
146
+ - uses: ruby/setup-ruby@v1
147
+ with:
148
+ ruby-version: ${{ matrix.ruby }}
149
+ - run: ruby --version
150
+ - name: Download gem-${{matrix.platform}}
151
+ uses: actions/download-artifact@v2
152
+ with:
153
+ name: gem-${{ matrix.platform }}
154
+ - name: Install gem-${{matrix.platform}}
155
+ run: gem install --local *.gem --verbose
156
+ - name: Run tests
157
+ run: |
158
+ cd test/rcd_test/
159
+ bundle install
160
+ ruby -rrcd_test -S rake test
161
+
162
+ job_test_native_static:
163
+ name: Test static (${{matrix.ruby}}, ${{matrix.platform}})
164
+ needs: docker_build
165
+ strategy:
166
+ fail-fast: false
167
+ matrix:
168
+ os:
169
+ - windows
170
+ ruby:
171
+ - "3.1"
172
+ - "3.0"
173
+ - "2.7"
174
+ - "2.6"
175
+ - "2.5"
176
+ - "2.4"
177
+ include:
178
+ - os: windows
179
+ platform: x64-mingw32
180
+ - os: windows
181
+ ruby: "3.1"
182
+ platform: x64-mingw-ucrt
183
+ exclude:
184
+ - os: windows
185
+ ruby: "3.1"
186
+
187
+ runs-on: ${{ matrix.os }}-latest
188
+ steps:
189
+ - uses: actions/checkout@v2
190
+ - uses: ruby/setup-ruby@v1
191
+ with:
192
+ ruby-version: ${{ matrix.ruby }}
193
+ - run: ruby --version
194
+ - name: Download gem-${{matrix.platform}}-static
195
+ uses: actions/download-artifact@v2
196
+ with:
197
+ name: gem-${{ matrix.platform }}-static
198
+ - name: Install gem-${{matrix.platform}}-static
199
+ run: gem install --local *.gem --verbose
200
+ - name: Run tests
201
+ run: |
202
+ cd test/rcd_test/
203
+ bundle install
204
+ ruby -rrcd_test -S rake test
205
+
206
+ job_test_multiarch:
207
+ name: Test ${{matrix.platform}} on ${{matrix.from_image}}
208
+ needs: docker_build
209
+ strategy:
210
+ fail-fast: false
211
+ matrix:
212
+ include:
213
+ - from_image: amd64/centos
214
+ platform: x86_64-linux
215
+ dockerfile: centos
216
+ - from_image: navikey/raspbian-bullseye
217
+ platform: arm-linux
218
+ dockerfile: debian
219
+ - from_image: arm64v8/ubuntu
220
+ platform: aarch64-linux
221
+ dockerfile: debian
222
+ - from_image: i386/alpine
223
+ platform: x86-linux
224
+ dockerfile: alpine
225
+ - from_image: arm32v6/alpine
226
+ platform: arm-linux
227
+ dockerfile: alpine
228
+
229
+ runs-on: ubuntu-latest
230
+ steps:
231
+ - uses: actions/checkout@v2
232
+ - name: Download gem-${{matrix.platform}}
233
+ uses: actions/download-artifact@v2
234
+ with:
235
+ name: gem-${{ matrix.platform }}
236
+ - name: Build image and Run tests
237
+ run: |
238
+ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
239
+ docker build --rm --build-arg from_image=${{matrix.from_image}} -t ruby-test -f test/env/Dockerfile.${{matrix.dockerfile}} .
240
+ docker run --rm -t --network=host -v `pwd`:/build ruby-test
data/.gitignore CHANGED
@@ -1,9 +1,14 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
+ /Dockerfile.mri.aarch64-linux
4
+ /Dockerfile.mri.arm-linux
5
+ /Dockerfile.mri.arm64-darwin
6
+ /Dockerfile.mri.arm64-linux
7
+ /Dockerfile.mri.x64-mingw32
3
8
  /Dockerfile.mri.x86-linux
4
9
  /Dockerfile.mri.x86-mingw32
10
+ /Dockerfile.mri.x86_64-darwin
5
11
  /Dockerfile.mri.x86_64-linux
6
- /Dockerfile.mri.x64-mingw32
7
12
  /Gemfile.lock
8
13
  /_yardoc/
9
14
  /coverage/
@@ -16,3 +21,8 @@
16
21
  *.o
17
22
  *.a
18
23
  mkmf.log
24
+ .byebug_history
25
+ test/rcd_test/Gemfile.lock
26
+ test/rcd_test/pkg/
27
+ test/rcd_test/tmp/
28
+ test/rcd_test/vendor/
data/Dockerfile.jruby CHANGED
@@ -1,7 +1,8 @@
1
1
  FROM ubuntu:20.04
2
2
 
3
+ ENV DEBIAN_FRONTEND noninteractive
3
4
  RUN apt-get -y update && \
4
- apt-get install -y curl git-core xz-utils wget unzip sudo gpg dirmngr openjdk-14-jdk-headless && \
5
+ apt-get install -y curl git-core xz-utils wget unzip sudo gpg dirmngr openjdk-11-jdk-headless maven && \
5
6
  rm -rf /var/lib/apt/lists/*
6
7
 
7
8
  # Add "rvm" as system group, to avoid conflicts with host GIDs typically starting with 1000
@@ -13,7 +14,7 @@ RUN mkdir ~/.gnupg && \
13
14
  echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf
14
15
 
15
16
  # install rvm, RVM 1.26.0+ has signed releases, source rvm for usage outside of package scripts
16
- RUN gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \
17
+ RUN gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \
17
18
  (curl -L http://get.rvm.io | sudo bash) && \
18
19
  bash -c " \
19
20
  source /etc/rubybashrc && \
@@ -26,7 +27,7 @@ ENV BASH_ENV /etc/rubybashrc
26
27
  # install rubies and fix permissions on
27
28
  RUN bash -c " \
28
29
  export CFLAGS='-s -O3 -fno-fast-math -fPIC' && \
29
- for v in jruby-9.2.14.0 ; do \
30
+ for v in jruby-9.3.2.0 ; do \
30
31
  rvm install --binary \$v --patch \$(echo ~/patches/ruby-\$v/* | tr ' ' ','); \
31
32
  done && \
32
33
  rvm cleanup all && \
@@ -46,8 +47,8 @@ RUN sudo mkdir -p /usr/local/rake-compiler && \
46
47
 
47
48
  USER root
48
49
 
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
50
+ RUN bash -c "rvm alias create default jruby-9.3.2.0"
51
+ RUN echo "rvm use jruby-9.3.2.0 > /dev/null" >> /etc/rubybashrc
51
52
 
52
53
  # Add rvm to the global bashrc
53
54
  RUN echo "source /etc/profile.d/rvm.sh" >> /etc/bash.bashrc
data/Dockerfile.mri.erb CHANGED
@@ -1,13 +1,16 @@
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 %>
7
-
8
- <% if platform=~/linux/ %>
1
+ <%
2
+ image = 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
7
+ manylinux = !!(image =~ /manylinux/)
8
+ %>
9
+ FROM <%= image %>
10
+
11
+ <% if manylinux %>
9
12
  # 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
13
+ RUN yum install -y autoconf gcc-c++ libtool readline-devel sqlite-devel ruby openssl-devel xz cmake sudo less libffi-devel git wget
11
14
 
12
15
  # Prepare sudo and delete sudo as alias to gosu
13
16
  RUN rm -f /usr/local/bin/sudo && \
@@ -36,7 +39,7 @@ RUN mkdir ~/.gnupg && \
36
39
  echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf
37
40
 
38
41
  # install rvm, RVM 1.26.0+ has signed releases, source rvm for usage outside of package scripts
39
- RUN gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \
42
+ RUN gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \
40
43
  (curl -L http://get.rvm.io | sudo bash) && \
41
44
  bash -c " \
42
45
  source /etc/rubybashrc && \
@@ -47,7 +50,7 @@ RUN gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A
47
50
  COPY build/patches /home/rvm/patches/
48
51
 
49
52
  # install rubies and fix permissions on
50
- ENV RVM_RUBIES 2.5.8 3.0.0
53
+ ENV RVM_RUBIES 2.5.9 3.1.0
51
54
  RUN bash -c " \
52
55
  export CFLAGS='-s -O3 -fno-fast-math -fPIC' && \
53
56
  for v in ${RVM_RUBIES} ; do \
@@ -61,7 +64,7 @@ RUN bash -c " \
61
64
  RUN echo "gem: --no-ri --no-rdoc" >> ~/.gemrc && \
62
65
  bash -c " \
63
66
  rvm all do gem update --system --no-document && \
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 && \
67
+ rvm all do gem install --no-document bundler 'bundler:~>1.16' 'rake-compiler:1.1.6' hoe mini_portile rubygems-tasks mini_portile2 && \
65
68
  find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
66
69
 
67
70
  # Install rake-compiler's cross rubies in global dir instead of /root
@@ -72,20 +75,33 @@ RUN sudo mkdir -p /usr/local/rake-compiler && \
72
75
  # Add cross compilers for Windows and Linux
73
76
  USER root
74
77
 
75
- <% if platform !~ /linux/ %>
78
+ <% if platform=~/x64-mingw-ucrt/ %>
79
+ COPY --from=larskanis/mingw64-ucrt:20.04 \
80
+ /build/binutils-mingw-w64-x86-64_2.34-6ubuntu1.3+8.8_amd64.deb \
81
+ /build/g++-mingw-w64-x86-64_9.3.0-17ubuntu1~20.04+22~exp1ubuntu4_amd64.deb \
82
+ /build/gcc-mingw-w64-base_9.3.0-17ubuntu1~20.04+22~exp1ubuntu4_amd64.deb \
83
+ /build/gcc-mingw-w64-x86-64_9.3.0-17ubuntu1~20.04+22~exp1ubuntu4_amd64.deb \
84
+ /build/mingw-w64-common_7.0.0-2_all.deb \
85
+ /build/mingw-w64-x86-64-dev_7.0.0-2_all.deb \
86
+ /debs/
87
+ RUN dpkg -i /debs/*.deb
88
+
89
+ <% elsif !manylinux %>
76
90
  RUN apt-get -y update && \
77
91
  apt-get install -y <%
78
- if platform=~/darwin/ %> clang python lzma-dev libxml2-dev libssl-dev libc++-10-dev <% end %><%
92
+ if platform=~/darwin/ %> clang python lzma-dev libxml2-dev libssl-dev libc++-10-dev <% end %><%
93
+ if platform=~/aarch64-linux/ %> gcc-aarch64-linux-gnu g++-aarch64-linux-gnu <% end %><%
94
+ if platform=~/arm-linux/ %> gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf <% end %><%
79
95
  if platform=~/x86-mingw32/ %> gcc-mingw-w64-i686 g++-mingw-w64-i686 <% end %><%
80
- if platform=~/x64-mingw32/ %> gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 <% end %> && \
96
+ if platform=~/x64-mingw32/ %> gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 <% end %> && \
81
97
  rm -rf /var/lib/apt/lists/*
82
98
  <% end %>
83
99
 
84
100
  RUN bash -c " \
85
- rvm alias create default 2.5.8 && \
101
+ rvm alias create default 3.1.0 && \
86
102
  rvm use default "
87
103
 
88
- <% if platform=~/linux/ %>
104
+ <% if manylinux %>
89
105
  # Create dev tools x86-linux-*
90
106
  COPY build/mk_i686.rb /root/
91
107
  RUN bash -c " \
@@ -102,6 +118,8 @@ RUN git clone -q --depth=1 https://github.com/tpoechtrager/osxcross.git /opt/osx
102
118
  tar -cJf MacOSX11.1.sdk.tar.xz MacOSX11.1.sdk && \
103
119
  cd /opt/osxcross && \
104
120
  UNATTENDED=1 SDK_VERSION=11.1 OSX_VERSION_MIN=10.13 USE_CLANG_AS=1 ./build.sh && \
121
+ ln -s /usr/bin/llvm-config-10 /usr/bin/llvm-config && \
122
+ ENABLE_COMPILER_RT_INSTALL=1 SDK_VERSION=11.1 ./build_compiler_rt.sh && \
105
123
  rm -rf *~ build tarballs/*
106
124
 
107
125
  RUN echo "export PATH=/opt/osxcross/target/bin:\$PATH" >> /etc/rubybashrc && \
@@ -124,44 +142,65 @@ USER rvm
124
142
  COPY build/patches2 /home/rvm/patches/
125
143
  RUN bash -c " \
126
144
  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 ) \
145
+ cd /usr/local/rvm/gems/ruby-\$v/gems/rake-compiler-1.1.6 && \
146
+ echo applying patches to ruby-\$v /home/rvm/patches/rake-compiler-1.1.6/*.patch && \
147
+ ( git apply /home/rvm/patches/rake-compiler-1.1.6/*.patch || true ) \
133
148
  done "
134
149
 
135
150
  # Patch rubies for cross build
136
- USER root
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 "
148
- USER rvm
149
-
150
-
151
- ENV XRUBIES 3.0.0:2.7.0:2.6.0:2.5.0:2.4.0:2.3.0
151
+ #USER root
152
+ #RUN bash -c " \
153
+ # for v in 2.7.0 3.0.0 3.1.0 ; do \
154
+ # curl -SL http://cache.ruby-lang.org/pub/ruby/\${v:0:3}/ruby-\$v.tar.xz | tar -xJC /root/ && \
155
+ # cd /root/ruby-\$v && \
156
+ # git apply /home/rvm/patches/ruby-\$v/*.patch && \
157
+ # cd .. && \
158
+ # mkdir -p /usr/local/rake-compiler/sources/ && \
159
+ # tar cjf /usr/local/rake-compiler/sources/ruby-\$v.tar.bz2 ruby-\$v && \
160
+ # chown rvm /usr/local/rake-compiler -R && \
161
+ # rm -rf /root/ruby-\$v ; \
162
+ # done "
163
+ #USER rvm
164
+
165
+ <%
166
+ axrubies = if platform =~ /x64-mingw-ucrt/
167
+ [
168
+ # Rubyinstaller-3.1.0+ is platform x64-mingw-ucrt
169
+ ["3.1.0", "3.1.0", true],
170
+ ]
171
+ elsif platform =~ /x64-mingw32/
172
+ [
173
+ # Rubyinstaller prior to 3.1.0 is platform x64-mingw32
174
+ ["2.6.0:2.5.0:2.4.0", "2.5.9", false],
175
+ ["3.0.0:2.7.0", "3.1.0", true],
176
+ ]
177
+ else
178
+ [
179
+ # Build xruby versions prior ruby2_keywords in parallel using ruby-2.5
180
+ ["2.6.0:2.5.0:2.4.0", "2.5.9", false],
181
+ # Build xruby versions with ruby2_keywords in parallel using ruby-3.x
182
+ ["3.1.0:3.0.0:2.7.0", "3.1.0", true],
183
+ ]
184
+ end
185
+
186
+ axrubies.each do |xrubies, rvm, parallel| %>
187
+ ENV XRUBIES <%= xrubies %>
152
188
 
153
189
  <% strip = '-s' if platform !~ /darwin/ %>
154
- # Build all xruby versions in parallel
190
+ # Build xruby versions in parallel
155
191
  # Then cleanup all build artifacts
156
192
  RUN bash -c " \
193
+ rvm use <%= rvm %> && \
194
+ export CPPFLAGS='<%= "-D__USE_MINGW_ANSI_STDIO=1" if platform=~/x64-mingw-ucrt/ %>' && \
157
195
  export CFLAGS='-O1 -fno-omit-frame-pointer -fno-fast-math -fstack-protector-strong <%= strip %>' && \
158
196
  export LDFLAGS='-pipe <%= strip %>' && \
159
197
  <%= "export LIBS='-l:libssp.a' &&" if platform =~ /mingw/ %> \
160
198
  <%= "export CC=#{target}-clang &&" if platform =~ /darwin/ %> \
161
- export MAKE='make V=1' && \
199
+ export MAKE='make V=1 <%= "-j`nproc`" if parallel %>' && \
162
200
  rake-compiler cross-ruby VERSION=$XRUBIES HOST=<%= target %> && \
163
201
  rm -rf ~/.rake-compiler/builds ~/.rake-compiler/sources && \
164
202
  find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
203
+ <% end %>
165
204
 
166
205
  <% if platform=~/linux/ %>
167
206
  # Avoid linking against libruby shared object.
@@ -169,7 +208,7 @@ RUN bash -c " \
169
208
  RUN find /usr/local/rake-compiler/ruby/*linux*/ -name libruby.so | xargs rm
170
209
  RUN find /usr/local/rake-compiler/ruby/*linux*/ -name libruby-static.a | while read f ; do cp $f `echo $f | sed s/-static//` ; done
171
210
  RUN find /usr/local/rake-compiler/ruby/*linux*/ -name libruby.a | while read f ; do ar t $f | xargs ar d $f ; done
172
- RUN find /usr/local/rake-compiler/ruby/*linux*/ -name mkmf.rb | while read f ; do sed -i ':a;N;$!ba;s/TRY_LINK = [^\n]*\n[^\n]*\n[^\n]*LOCAL_LIBS)/& -lruby-static/' $f ; done
211
+ RUN find /usr/local/rake-compiler/ruby/*linux*/ -name mkmf.rb | while read f ; do sed -i ':a;N;$!ba;s/TRY_LINK = [^\n]*\n[^\n]*\n[^\n]*LOCAL_LIBS)/& -lruby-static -lpthread -lrt -ldl <% if platform=~/x86/ %> -lcrypt <% end %>/' $f ; done
173
212
  <% end %>
174
213
 
175
214
  <% if platform=~/mingw/ %>
@@ -178,7 +217,7 @@ RUN find /usr/local/rake-compiler/ruby/*mingw*/ -name rbconfig.rb | while read f
178
217
  # Raise Windows-API to Vista (affects ruby < 2.6 only)
179
218
  RUN find /usr/local/rake-compiler/ruby -name rbconfig.rb | while read f ; do sed -i 's/0x0501/0x0600/' $f ; done
180
219
  # Don't link to static libruby
181
- RUN find /usr/local/rake-compiler/ruby -name *msvcrt-ruby*.dll.a | while read f ; do n=`echo $f | sed s/.dll//` ; mv $f $n ; done
220
+ RUN find /usr/local/rake-compiler/ruby -name lib*-ruby*.dll.a | while read f ; do n=`echo $f | sed s/.dll//` ; mv $f $n ; done
182
221
  <% end %>
183
222
 
184
223
  USER root
@@ -200,7 +239,7 @@ RUN printf "1\n" | update-alternatives --config <%= target %>-gcc && \
200
239
  printf "1\n" | update-alternatives --config <%= target %>-g++
201
240
  <% end %>
202
241
 
203
- <% if platform=~/linux/ %>
242
+ <% if manylinux %>
204
243
  # Enable modern compiler toolset of manylinux image
205
244
  RUN echo "export PATH=\$DEVTOOLSET_ROOTPATH/usr/bin:\$PATH" >> /etc/rubybashrc
206
245
 
@@ -209,6 +248,11 @@ RUN for f in addr2line gcc gcov-tool ranlib ar dwp gcc-ranlib nm readelf as elfe
209
248
 
210
249
  # ruby-2.5 links to libcrypt, which isn't necessary for extensions
211
250
  RUN find /usr/local/rake-compiler/ruby -name rbconfig.rb | while read f ; do sed -i 's/-lcrypt//' $f ; done
251
+
252
+ # Use builtin functions of newer gcc to avoid linker issues on Musl based Linux
253
+ COPY build/math_h.patch /root/
254
+ RUN cd /usr/include/ && \
255
+ patch -p1 < /root/math_h.patch
212
256
  <% end %>
213
257
 
214
258
  <% if platform=~/arm64-darwin/ %>
@@ -222,10 +266,12 @@ RUN gcc $HOME/sigfw.c -o /usr/bin/sigfw
222
266
 
223
267
  # Install user mapper
224
268
  COPY build/runas /usr/bin/
269
+ COPY build/rcd-env.sh /etc/profile.d/
270
+ RUN echo "source /etc/profile.d/rcd-env.sh" >> /etc/rubybashrc
225
271
 
226
272
  # Install sudoers configuration
227
273
  COPY build/sudoers /etc/sudoers.d/rake-compiler-dock
228
274
 
229
- ENV RUBY_CC_VERSION 3.0.0:2.7.0:2.6.0:2.5.0:2.4.0:2.3.0
275
+ ENV RUBY_CC_VERSION 3.1.0:3.0.0:2.7.0:2.6.0:2.5.0:2.4.0
230
276
 
231
277
  CMD bash
data/History.md CHANGED
@@ -1,4 +1,37 @@
1
- 1.1.0 / 2020-12-28
1
+ 1.2.2 / 2022-06-27
2
+ ------------------
3
+
4
+ * Fix ucrt libruby file naming for static build. #69
5
+
6
+
7
+ 1.2.1 / 2022-03-17
8
+ ------------------
9
+
10
+ * Fix testing for ruby C-API functions in mkmf. #65, #67
11
+ * Use openjdk 11 to make maven work on ubuntu 20.04. #64
12
+ * Remove x86_64-w64-mingw32-pkg-config from the x64-mingw-ucrt image. #63
13
+ * Add a patch for math.h to use gcc builtins and to improve compat with musl based systems. #42
14
+
15
+
16
+ 1.2.0 / 2022-01-04
17
+ ------------------
18
+
19
+ * Add Ruby-3.1 as native rvm and cross ruby versions.
20
+ * Remove Ruby-2.2 and 2.3 from RUBY_CC_VERSION and cross rubies.
21
+ * Add Linux cross build targets "arm-linux" and "aarch64-linux".
22
+ * Add cross build target "x64-mingw-ucrt" for ruby-3.1 on Windows.
23
+ * Add `wget` and `git` to Linux image.
24
+ * Add `maven` to JRuby image.
25
+ * Update JRuby to 9.3.2.0
26
+ * Fix default value of platform for JRuby. #50
27
+ * Update openjdk version from 14 to 17
28
+ * Add a test gem and build and run it on all supported platforms on Github Actions.
29
+ * Allow alternative build command like `docker buildx build`
30
+ * Provide compiler-rt libraries for darwin builds. #60
31
+ * Extract build environment from `runas` into `rcd-env.sh` and loaded it in non-interactive non-login shells. #57
32
+
33
+
34
+ 1.1.0 / 2020-12-29
2
35
  ------------------
3
36
 
4
37
  * Use ManyLinux2014 as docker base image for linux targets.