rake-compiler-dock 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4bd88acec0b242f927021220f31a29ba3b6d2430684939cca547f166a2e4cbf
4
- data.tar.gz: 93bc3f64149ddde490bc346ada8fc8ad08d1a726d7a1d0a30e7fac53de796c35
3
+ metadata.gz: d8defac75bbfdcb50e87c34ae26c04eeac94d56144481a01ea096cffe70f33ac
4
+ data.tar.gz: 5fe13b2f51bea09bb8ed3f02c170ccf2984aa6fcd74bed05b74643d658a0d615
5
5
  SHA512:
6
- metadata.gz: 8a6cc4bab3dab8d51451f3a813252c37118c946d5de6d484ba3a352780c2303ea90c2db0dc4d8f9e67164a3ac4f47f5a8ca5f9198ff2c145b41811f374bff079
7
- data.tar.gz: c2feaa279b28ef3b4b058f86a6ac37df9dd7356d3f8c119bba279689460e981d008424af5272d5287064f8b4322b2fb7a7d9aba5cd66ccdd8fe855261cf13a78
6
+ metadata.gz: 94bb24cf349bc6099fc6dd07ffe860588a782ef0408af57c59001a4100a5be568489e7d8610a840949590086289a474c123be34da1193633c7ba6aaff733c2fb
7
+ data.tar.gz: 2123aa6ccb22c06ee123e58eb34e306a0f8e5b69e57fd6124b1bfe7cdd42a5f2a83a0b7c6ce63015e7c02f706f011bd46a1b0e56b823d86997a702fa7ab57525
@@ -144,7 +144,7 @@ jobs:
144
144
  fail-fast: false
145
145
  matrix:
146
146
  os: [ubuntu-latest]
147
- ruby: ["3.4.0-rc1", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5", "2.4"]
147
+ ruby: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5", "2.4"]
148
148
  runs-on: ${{ matrix.os }}
149
149
  steps:
150
150
  - uses: actions/checkout@v4
@@ -169,7 +169,7 @@ jobs:
169
169
  fail-fast: false
170
170
  matrix:
171
171
  platform: [x86_64-linux, x86_64-linux-gnu]
172
- ruby: ["3.4.0-rc1", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5", "2.4"]
172
+ ruby: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5", "2.4"]
173
173
  include:
174
174
  # declare rubygems for each ruby version
175
175
  - { ruby: "3.0", rubygems: "3.5.23" }
@@ -187,9 +187,10 @@ jobs:
187
187
  uses: actions/download-artifact@v4
188
188
  with:
189
189
  name: gem-${{ matrix.platform }}
190
+ - if: matrix.rubygems
191
+ run: gem update --system ${{ matrix.rubygems }}
190
192
  - name: Test gem-${{ matrix.platform }}
191
193
  run: |
192
- gem update --system ${{ matrix.rubygems }}
193
194
  gem install --local *.gem --verbose
194
195
  cd test/rcd_test/
195
196
  bundle install
@@ -214,7 +215,7 @@ jobs:
214
215
  - x86_64-linux
215
216
  - x86_64-linux-gnu
216
217
  - x86_64-linux-musl
217
- ruby: ["3.4.0-rc1", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5", "2.4"]
218
+ ruby: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5", "2.4"]
218
219
  include:
219
220
  # declare rubygems for each ruby version
220
221
  - { ruby: "3.0", rubygems: "3.5.23" }
@@ -250,7 +251,7 @@ jobs:
250
251
  docker run --rm -v $PWD:/work -w /work \
251
252
  ${{ matrix.docker_platform}} ruby:${{ matrix.ruby }}${{ matrix.docker_tag }} \
252
253
  sh -c "
253
- gem update --system ${{ matrix.rubygems }} &&
254
+ if test -n '${{ matrix.rubygems }}' ; then gem update --system ${{ matrix.rubygems }} ; fi &&
254
255
  gem install --local *.gem --verbose &&
255
256
  cd test/rcd_test/ &&
256
257
  bundle install &&
@@ -264,7 +265,7 @@ jobs:
264
265
  fail-fast: false
265
266
  matrix:
266
267
  os: [macos-13, macos-14]
267
- ruby: ["3.4.0-rc1", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5", "2.4"]
268
+ ruby: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5", "2.4"]
268
269
  exclude:
269
270
  # setup-ruby does not provide ruby 2.4 or 2.5 on arm64-darwin as of 2024-05-01
270
271
  - os: macos-14
@@ -304,7 +305,7 @@ jobs:
304
305
  ruby: "3.3"
305
306
  platform: x64-mingw-ucrt
306
307
  - os: windows-latest
307
- ruby: "head" # "3.4.0-rc1" not available yet on windows
308
+ ruby: "3.4"
308
309
  platform: x64-mingw-ucrt
309
310
  runs-on: ${{ matrix.os }}
310
311
  steps:
@@ -359,7 +360,7 @@ jobs:
359
360
  ruby: "3.3"
360
361
  platform: x64-mingw-ucrt
361
362
  - os: windows-latest
362
- ruby: "head" # "3.4.0-rc1" not available yet on windows
363
+ ruby: "3.4"
363
364
  platform: x64-mingw-ucrt
364
365
  runs-on: ${{ matrix.os }}
365
366
  steps:
@@ -39,7 +39,7 @@ jobs:
39
39
  ${{runner.os}}-${{matrix.platform}}-buildx
40
40
  - uses: ruby/setup-ruby@v1
41
41
  with:
42
- ruby-version: "3.1"
42
+ ruby-version: "3.3"
43
43
  bundler-cache: true
44
44
  - name: Generate docker image names
45
45
  id: rcd_config
@@ -0,0 +1,87 @@
1
+ name: Release docker images to GHCR
2
+ concurrency:
3
+ group: "${{github.workflow}}-${{github.ref}}"
4
+ cancel-in-progress: true
5
+
6
+ #
7
+ # This workflow assumes the maintainer has chosen the appropriate tag in the workflow dispatch UI.
8
+ #
9
+ on:
10
+ workflow_dispatch:
11
+ inputs:
12
+ tag:
13
+ description: "Tag name to release"
14
+ required: true
15
+
16
+ jobs:
17
+ build:
18
+ name: "build ${{ inputs.tag }} ${{ matrix.platform }}"
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ platform:
23
+ - aarch64-linux-gnu
24
+ - aarch64-linux-musl
25
+ - arm-linux-gnu
26
+ - arm-linux-musl
27
+ - arm64-darwin
28
+ - jruby
29
+ - x64-mingw-ucrt
30
+ - x64-mingw32
31
+ - x86-linux-gnu
32
+ - x86-linux-musl
33
+ - x86-mingw32
34
+ - x86_64-darwin
35
+ - x86_64-linux-gnu
36
+ - x86_64-linux-musl
37
+ runs-on: ubuntu-latest
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+ with:
41
+ ref: ${{ inputs.tag }}
42
+ - name: Use cache from primary pipeline
43
+ uses: actions/cache@v4
44
+ with:
45
+ path: tmp/build-cache
46
+ key: ${{runner.os}}-${{matrix.platform}}-buildx-${{github.sha}}
47
+ restore-keys: |
48
+ ${{runner.os}}-${{matrix.platform}}-buildx
49
+ - uses: ruby/setup-ruby@v1
50
+ with:
51
+ ruby-version: "3.3"
52
+ bundler-cache: true
53
+ - name: Generate docker image names
54
+ id: rcd_config
55
+ run: |
56
+ bundle exec ruby -e ' \
57
+ require "rake_compiler_dock"; \
58
+ print "image_name="; \
59
+ puts RakeCompilerDock::Starter.container_image_name(:platform => %q(${{matrix.platform}})); \
60
+ if %q(${{matrix.platform}}).end_with?("-gnu"); \
61
+ print "generic_linux_image_name="; \
62
+ puts RakeCompilerDock::Starter.container_image_name(:platform => %q(${{matrix.platform}})).chomp("-gnu"); \
63
+ end \
64
+ ' | tee -a $GITHUB_OUTPUT
65
+ - name: Build docker image
66
+ env:
67
+ RCD_DOCKER_BUILD: docker buildx build --cache-from=type=local,src=tmp/build-cache --cache-to=type=local,dest=tmp/build-cache-new --load
68
+ run: |
69
+ docker buildx create --driver docker-container --use
70
+ bundle exec rake build:${{matrix.platform}}
71
+ # move build cache and remove outdated layers
72
+ rm -rf tmp/build-cache
73
+ mv tmp/build-cache-new tmp/build-cache
74
+ - uses: docker/login-action@v3
75
+ with:
76
+ registry: ghcr.io
77
+ username: ${{github.actor}}
78
+ password: ${{secrets.GITHUB_TOKEN}}
79
+ - name: Push the docker image
80
+ run: |
81
+ docker images
82
+ docker push ${{steps.rcd_config.outputs.image_name}}
83
+ - name: Push a generic linux image
84
+ if: ${{ steps.rcd_config.outputs.generic_linux_image_name }}
85
+ run: |
86
+ docker tag ${{steps.rcd_config.outputs.image_name}} ${{steps.rcd_config.outputs.generic_linux_image_name}}
87
+ docker push ${{steps.rcd_config.outputs.generic_linux_image_name}}
data/CONTRIBUTING.md CHANGED
@@ -7,17 +7,28 @@ This document is intended for the rake-compiler-dock contributors.
7
7
  - prep
8
8
  - [ ] make sure CI is green!
9
9
  - [ ] update `History.md` and `lib/rake_compiler_dock/version.rb`
10
- - build
11
- - [ ] run the steps below to generate the images locally
12
- - [ ] run `gem build rake-compiler-dock`
13
- - [ ] create a git tag
14
- - push
15
- - [ ] run `bundle exec rake release:images`
16
- - [ ] run `gem push pkg/rake-compiler-dock*gem`
17
- - [ ] run `git push && git push --tags`
10
+ - [ ] commit and create a git tag
11
+ - option 1: build locally
12
+ - build
13
+ - [ ] run the steps below to generate the images locally
14
+ - [ ] run `gem build rake-compiler-dock`
15
+ - push
16
+ - [ ] run `bundle exec rake release:images`
17
+ - [ ] run `gem push pkg/rake-compiler-dock*gem`
18
+ - [ ] run `git push && git push --tags`
19
+ - option 2: build with github actions
20
+ - build and push images from github actions
21
+ - [ ] run `git push && git push --tags`
22
+ - [ ] wait for CI to go green on the tag
23
+ - [ ] go to the [release-images pipeline][] and run the workflow on the tag
24
+ - build the gem locally and push it
25
+ - [ ] locally, run `gem build rake-compiler-dock`
26
+ - [ ] run `gem push pkg/rake-compiler-dock*gem`
18
27
  - announce
19
28
  - [ ] create a release at https://github.com/rake-compiler/rake-compiler-dock/releases
20
29
 
30
+ [release-images pipeline]: https://github.com/rake-compiler/rake-compiler-dock/actions/workflows/release-images.yml
31
+
21
32
 
22
33
  ## Building a versioned image
23
34
 
data/Dockerfile.jruby CHANGED
@@ -44,13 +44,15 @@ RUN bash -c " \
44
44
  "
45
45
 
46
46
  # Install rake-compiler and patch it to build and install static libraries for Linux rubies
47
- COPY build/patches2 /home/rubyuser/patches
47
+ COPY build/patches /home/rubyuser/patches
48
48
  RUN bash -c " \
49
49
  for v in ${RBENV_RUBIES} ; do \
50
50
  rbenv shell \$v && \
51
- gem install rake-compiler -v1.2.5 && \
52
- cd ${RBENV_ROOT}/versions/\$v/lib/ruby/gems/*/gems/rake-compiler-1.2.5 && \
53
- patch -p1 < /home/rubyuser/patches/rake-compiler-1.2.5/*.patch ; \
51
+ gem install rake-compiler -v1.2.9 && \
52
+ cd ${RBENV_ROOT}/versions/\$v/lib/ruby/gems/*/gems/rake-compiler-1.2.9 && \
53
+ for patch in /home/rubyuser/patches/rake-compiler-1.2.9/*.patch ; do \
54
+ patch -p1 < \$patch ; \
55
+ done \
54
56
  done \
55
57
  "
56
58
 
data/Dockerfile.mri.erb CHANGED
@@ -10,39 +10,17 @@ RUN apt-get -y update && \
10
10
  apt-get install -y autoconf cmake pkg-config zlib1g-dev libreadline-dev libsqlite0-dev libssl-dev libyaml-dev libffi-dev && \
11
11
  rm -rf /var/lib/apt/lists/*
12
12
 
13
- ##
14
- ## install rbenv and ruby-build
15
- ##
16
- RUN groupadd -r rubyuser && useradd -r -g rubyuser -G sudo -p "" --create-home rubyuser
17
-
18
- ENV RBENV_ROOT=/usr/local/rbenv RBENV_RUBIES="2.5.9 3.1.3"
19
-
20
- # chown after running `rbenv init` because that command creates some subdirectories
21
- RUN git clone https://github.com/rbenv/rbenv.git ${RBENV_ROOT} && \
22
- git clone https://github.com/rbenv/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build && \
23
- \
24
- echo "export RBENV_ROOT=/usr/local/rbenv" >> /etc/rubybashrc && \
25
- echo "export PATH=$RBENV_ROOT/bin:\$PATH" >> /etc/rubybashrc && \
26
- $RBENV_ROOT/bin/rbenv init - --no-rehash bash >> /etc/rubybashrc && \
27
- echo "source /etc/rubybashrc" >> /etc/bashrc && \
28
- echo "source /etc/rubybashrc" >> /etc/bash.bashrc && \
29
- \
30
- chown -R rubyuser:rubyuser ${RBENV_ROOT} && \
31
- find ${RBENV_ROOT} -type d -print0 | sudo xargs -0 chmod g+sw
32
- ENV BASH_ENV=/etc/rubybashrc
33
-
34
-
35
13
  ##
36
14
  ## Install cross compilers
37
15
  ##
38
16
  <% if platform =~ /x64-mingw-ucrt/ %>
39
17
  COPY --from=larskanis/mingw64-ucrt:20.04 \
40
- /build/binutils-mingw-w64-x86-64_2.34-6ubuntu1.3+8.8_amd64.deb \
41
- /build/g++-mingw-w64-x86-64_9.3.0-17ubuntu1~20.04+22~exp1ubuntu4_amd64.deb \
42
- /build/gcc-mingw-w64-base_9.3.0-17ubuntu1~20.04+22~exp1ubuntu4_amd64.deb \
43
- /build/gcc-mingw-w64-x86-64_9.3.0-17ubuntu1~20.04+22~exp1ubuntu4_amd64.deb \
44
- /build/mingw-w64-common_7.0.0-2_all.deb \
45
- /build/mingw-w64-x86-64-dev_7.0.0-2_all.deb \
18
+ /build/binutils-mingw-w64-x86-64_*.deb \
19
+ /build/g++-mingw-w64-x86-64_*.deb \
20
+ /build/gcc-mingw-w64-base_*.deb \
21
+ /build/gcc-mingw-w64-x86-64_*.deb \
22
+ /build/mingw-w64-common_*.deb \
23
+ /build/mingw-w64-x86-64-dev_*.deb \
46
24
  /debs/
47
25
  RUN dpkg -i /debs/*.deb
48
26
 
@@ -57,6 +35,7 @@ if platform =~ /darwin/ %> clang python lzma-dev libxml2-dev libssl-d
57
35
  if platform =~ /aarch64-linux-gnu/ %> gcc-aarch64-linux-gnu g++-aarch64-linux-gnu <% end %><%
58
36
  if platform =~ /arm-linux-gnu/ %> gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf <% end %><%
59
37
  if platform =~ /x86-linux-gnu/ %> gcc-i686-linux-gnu g++-i686-linux-gnu <% end %><%
38
+ if platform =~ /x86_64-linux-gnu/ %> gcc-x86-64-linux-gnu g++-x86-64-linux-gnu <% end %><%
60
39
  if platform =~ /x86-mingw32/ %> gcc-mingw-w64-i686 g++-mingw-w64-i686 <% end %><%
61
40
  if platform =~ /x64-mingw32/ %> gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 <% end %> && \
62
41
  rm -rf /var/lib/apt/lists/*
@@ -68,11 +47,35 @@ RUN /tmp/mk_osxcross.sh
68
47
  <% end %>
69
48
 
70
49
 
50
+ ##
51
+ ## install rbenv and ruby-build
52
+ ##
53
+ RUN groupadd -r rubyuser && useradd -r -g rubyuser -G sudo -p "" --create-home rubyuser
54
+
55
+ ENV RBENV_ROOT=/usr/local/rbenv
56
+
57
+ # chown after running `rbenv init` because that command creates some subdirectories
58
+ RUN git clone https://github.com/rbenv/rbenv.git ${RBENV_ROOT} && \
59
+ git clone https://github.com/rbenv/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build && \
60
+ \
61
+ echo "export RBENV_ROOT=/usr/local/rbenv" >> /etc/rubybashrc && \
62
+ echo "export PATH=$RBENV_ROOT/bin:\$PATH" >> /etc/rubybashrc && \
63
+ $RBENV_ROOT/bin/rbenv init - --no-rehash bash >> /etc/rubybashrc && \
64
+ echo "source /etc/rubybashrc" >> /etc/bashrc && \
65
+ echo "source /etc/rubybashrc" >> /etc/bash.bashrc && \
66
+ \
67
+ chown -R rubyuser:rubyuser ${RBENV_ROOT} && \
68
+ find ${RBENV_ROOT} -type d -print0 | sudo xargs -0 chmod g+sw
69
+ ENV BASH_ENV=/etc/rubybashrc
70
+
71
+
71
72
  ##
72
73
  ## set up rake-compiler and install bootstrap rubies
73
74
  ##
74
75
  USER rubyuser
75
76
 
77
+ ENV RBENV_RUBIES="2.5.9 3.1.6"
78
+
76
79
  # Install the bootstrap rubies
77
80
  RUN bash -c " \
78
81
  echo 'gem: --no-ri --no-rdoc --no-document' >> ~/.gemrc && \
@@ -84,13 +87,15 @@ RUN bash -c " \
84
87
  "
85
88
 
86
89
  # Install rake-compiler and patch it to build and install static libraries for Linux rubies
87
- COPY build/patches2 /home/rubyuser/patches
90
+ COPY build/patches /home/rubyuser/patches
88
91
  RUN bash -c " \
89
92
  for v in ${RBENV_RUBIES} ; do \
90
93
  rbenv shell \$v && \
91
- gem install rake-compiler -v1.2.5 && \
92
- cd ${RBENV_ROOT}/versions/\$v/lib/ruby/gems/*/gems/rake-compiler-1.2.5 && \
93
- patch -p1 < /home/rubyuser/patches/rake-compiler-1.2.5/*.patch ; \
94
+ gem install rake-compiler -v1.2.9 && \
95
+ cd ${RBENV_ROOT}/versions/\$v/lib/ruby/gems/*/gems/rake-compiler-1.2.9 && \
96
+ for patch in /home/rubyuser/patches/rake-compiler-1.2.9/*.patch ; do \
97
+ patch -p1 < \$patch ; \
98
+ done \
94
99
  done \
95
100
  "
96
101
 
@@ -109,19 +114,19 @@ RUN sudo mkdir -p /usr/local/rake-compiler && \
109
114
  #
110
115
  xrubies_build_plan = if platform =~ /x64-mingw-ucrt/
111
116
  [
112
- # Rubyinstaller-3.1.0+ is platform x64-mingw-ucrt
113
- ["3.4.0:3.3.5:3.2.0:3.1.0", "3.1.3"],
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"],
114
119
  ]
115
120
  elsif platform =~ /x64-mingw32/
116
121
  [
117
- # Rubyinstaller prior to 3.1.0 is platform x64-mingw32
118
- ["2.6.0:2.5.0:2.4.0", "2.5.9"],
119
- ["3.0.0:2.7.0", "3.1.3"],
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"],
120
125
  ]
121
126
  else
122
127
  [
123
- ["2.6.0:2.5.0:2.4.0", "2.5.9"],
124
- ["3.4.0:3.3.5:3.2.0:3.1.0:3.0.0:2.7.0", "3.1.3"],
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"],
125
130
  ]
126
131
  end
127
132
 
@@ -148,7 +153,7 @@ RUN bash -c " \
148
153
  RUN find /usr/local/rake-compiler/ruby/*linux*/ -name libruby.so | xargs rm
149
154
  RUN find /usr/local/rake-compiler/ruby/*linux*/ -name libruby-static.a | while read f ; do cp $f `echo $f | sed s/-static//` ; done
150
155
  RUN find /usr/local/rake-compiler/ruby/*linux*/ -name libruby.a | while read f ; do ar t $f | xargs ar d $f ; done
151
- 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_64/ %> -lcrypt <% if platform !~ /musl/ %> -lz <% end %> <% end %>/' $f ; done
156
+ 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/' $f ; done
152
157
  <% end %>
153
158
 
154
159
  <% if platform =~ /mingw/ %>
@@ -164,12 +169,15 @@ RUN find /usr/local/rake-compiler/ruby -name lib*-ruby*.dll.a | while read f ; d
164
169
  RUN find /usr/local/rake-compiler/ruby -name rbconfig.rb | while read f ; do sed -i 's/-lcrypt//' $f ; done
165
170
 
166
171
  <% if platform =~ /darwin/ %>
167
- # ruby-3.2+ on darwin links with `-bundle_loader`,
168
- # - see https://github.com/rake-compiler/rake-compiler-dock/issues/87
169
- # - note that we do this for "3.[2-9].0" to match rubies 3.2 and later
170
- # - and we add a "*" on the end for "3.[2-9].0*" to match prereleases like "3.3.0+0"
171
- RUN find /usr/local/rake-compiler/ruby/*/*/lib/ruby/3.[2-9].0* -name rbconfig.rb | \
172
- 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
173
181
  <% end %>
174
182
 
175
183
 
@@ -215,8 +223,8 @@ RUN echo 'source /etc/profile.d/rcd-env.sh' >> /etc/rubybashrc
215
223
  # Install sudoers configuration
216
224
  COPY build/sudoers /etc/sudoers.d/rake-compiler-dock
217
225
 
218
- RUN bash -c "rbenv global 3.1.3"
226
+ RUN bash -c "rbenv global 3.1.6"
219
227
 
220
- ENV RUBY_CC_VERSION=3.4.0: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
221
229
 
222
230
  CMD bash
data/History.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # `rake-compiler/rake-compiler-dock` Changelog
2
2
 
3
+ ## v1.8.0 / 2025-01-05
4
+
5
+ ### Notable changes
6
+
7
+ All versions of Ruby in the build containers are the latest patch version. #135 @flavorjones
8
+ - `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`
9
+
10
+ ### Other changes
11
+
12
+ - Base ruby updated to v3.1.6 (from v3.1.3), which is now the default `rbenv` ruby.
13
+ - (Darwin) Set `OSXCROSS_PKG_CONFIG_USE_NATIVE_VARIABLES=1` to successfully build the 3.0 series.
14
+ - (Darwin) The linker flags include `-Wl,-flat_namespace` for 2.7, 3.0, 3.1, 3.2, 3.3, and 3.4 rubies. Previously this was only needed for 3.2+, but code backported to 2.7.7, 3.0.5, and 3.1.3 required it for those versions as well.
15
+
16
+
17
+ ## v1.7.1 / 2025-01-03
18
+
19
+ - Bump rake-compiler dependency to v1.2.9 (from v1.2.5).
20
+ - Bump Ruby to v3.4.1 (from v3.4.0) to address `ruby_abi_version` issues.
21
+
22
+
3
23
  ## v1.7.0 / 2024-12-25
4
24
 
5
25
  ### Ruby 3.4 support
data/build/mk_osxcross.sh CHANGED
@@ -13,7 +13,7 @@ set -x
13
13
  curl -L -o MacOSX11.1.sdk.tar.xz https://github.com/larskanis/MacOSX-SDKs/releases/download/11.1/MacOSX11.1.sdk.tar.xz
14
14
  tar -xf MacOSX11.1.sdk.tar.xz -C .
15
15
  cp -rf /usr/lib/llvm-10/include/c++ MacOSX11.1.sdk/usr/include/c++
16
- cp -rf /usr/include/x86_64-linux-gnu/c++/9/bits/ MacOSX11.1.sdk/usr/include/c++/v1/bits
16
+ cp -rf /usr/include/*-linux-gnu/c++/9/bits/ MacOSX11.1.sdk/usr/include/c++/v1/bits
17
17
  tar -cJf MacOSX11.1.sdk.tar.xz MacOSX11.1.sdk
18
18
 
19
19
  set +x
@@ -27,6 +27,8 @@ rm -rf *~ build tarballs/*
27
27
  echo "export PATH=/opt/osxcross/target/bin:\$PATH" >> /etc/rubybashrc
28
28
  echo "export MACOSX_DEPLOYMENT_TARGET=10.13" >> /etc/rubybashrc
29
29
  echo "export OSXCROSS_MP_INC=1" >> /etc/rubybashrc
30
+ echo "export OSXCROSS_PKG_CONFIG_USE_NATIVE_VARIABLES=1" >> /etc/rubybashrc
31
+
30
32
 
31
33
  # Add links to build tools without target version kind of:
32
34
  # arm64-apple-darwin-clang => arm64-apple-darwin20.1-clang
@@ -2,13 +2,16 @@ diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
2
2
  index 8317a2a3..8ed21718 100644
3
3
  --- a/tasks/bin/cross-ruby.rake
4
4
  +++ b/tasks/bin/cross-ruby.rake
5
- @@ -116,11 +116,27 @@
5
+ @@ -116,11 +116,30 @@
6
6
  "--host=#{mingw_host}",
7
7
  "--target=#{mingw_target}",
8
8
  "--build=#{RUBY_BUILD}",
9
9
  - '--enable-shared',
10
10
  + '--enable-install-static-library',
11
11
  + '--disable-jit-support',
12
+ + 'ac_cv_lib_z_uncompress=no',
13
+ + 'ac_cv_lib_crypt_crypt=no',
14
+ + 'ac_cv_func_crypt_r=no',
12
15
  '--disable-install-doc',
13
16
  '--with-ext=',
14
17
  ]
@@ -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
+
@@ -1,4 +1,4 @@
1
1
  module RakeCompilerDock
2
- VERSION = "1.7.0"
3
- IMAGE_VERSION = "1.7.0"
2
+ VERSION = "1.8.0"
3
+ IMAGE_VERSION = "1.8.0"
4
4
  end
@@ -32,7 +32,7 @@ RUN cd mingw-w64-* && \
32
32
 
33
33
  # Install UCRT enabled deb-packages
34
34
  RUN dpkg -i mingw-w64-common_7.0.0-2_all.deb \
35
- mingw-w64-tools_7.0.0-2_amd64.deb \
35
+ mingw-w64-tools_7.0.0-2_*.deb \
36
36
  mingw-w64-x86-64-dev_7.0.0-2_all.deb
37
37
 
38
38
  # Download gcc-binutils sources for mingw
@@ -52,6 +52,10 @@ RUN apt-get source gcc-mingw-w64 && \
52
52
  cd gcc-mingw-w64-* && \
53
53
  mk-build-deps -ir -t "apt-get -o Debug::pkgProblemResolver=yes -y --no-install-recommends"
54
54
 
55
+ # Add version based alias
56
+ RUN ln -s `which autoconf` `which autoconf`2.69 && \
57
+ ln -s `which autom4te` `which autom4te`2.69
58
+
55
59
  # Build gcc (only C and C++) based on UCRT headers and crt
56
60
  ADD gcc-mingw-w64-*.patch ./
57
61
  RUN cd gcc-mingw-w64-* && \
@@ -0,0 +1,58 @@
1
+ Docker image with compilers for ruby platform x64-mingw-ucrt
2
+ ------------------
3
+
4
+ This Dockerfile builds compilers for Windows UCRT target.
5
+ It takes the mingw compiler provided by Debian/Ubuntu and configures and compiles them for UCRT.
6
+ Outputs are *.deb files of binutils, gcc and g++.
7
+ Rake-compiler-dock reads them from this image as part of its build process for the x64-mingw-ucrt platform.
8
+
9
+ The image is provided for arm64 and amd64 architectures.
10
+ They are built by the following command:
11
+
12
+ ```sh
13
+ docker buildx build . -t larskanis/mingw64-ucrt:20.04 --platform linux/arm64,linux/amd64 --push
14
+ ```
15
+
16
+
17
+ Create builder instance for two architectures
18
+ ------------------
19
+
20
+ Building with qemu emulation fails currently with a segfault, so that it must be built by a builder instance with at least one remote node for the other architecture.
21
+ Building on native hardware is also much faster (~30 minutes) than on qemu.
22
+ A two-nodes builder requires obviously a ARM and a Intel/AMD device.
23
+ It can be created like this:
24
+
25
+ ```sh
26
+ # Make sure the remote instance can be connected
27
+ $ docker -H ssh://isa info
28
+
29
+ # Create a new builder with the local instance
30
+ $ docker buildx create --name isayoga
31
+
32
+ # Add the remote instance
33
+ $ docker buildx create --name isayoga --append ssh://isa
34
+
35
+ # They are inactive from the start
36
+ $ docker buildx ls
37
+ NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
38
+ isayoga docker-container
39
+ \_ isayoga0 \_ unix:///var/run/docker.sock inactive
40
+ \_ isayoga1 \_ ssh://isa inactive
41
+ default* docker
42
+ \_ default \_ default running v0.13.2 linux/arm64
43
+
44
+ # Bootstrap the instances
45
+ $ docker buildx inspect --bootstrap --builder isayoga
46
+
47
+ # Set the new builder as default
48
+ $ docker buildx use isayoga
49
+
50
+ # Now it should be default and in state "running"
51
+ $ docker buildx ls
52
+ NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
53
+ isayoga* docker-container
54
+ \_ isayoga0 \_ unix:///var/run/docker.sock running v0.18.2 linux/arm64
55
+ \_ isayoga1 \_ ssh://isa running v0.18.2 linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/386
56
+ default docker
57
+ \_ default \_ default running v0.13.2 linux/arm64
58
+ ```
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-compiler-dock
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Kanis
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-25 00:00:00.000000000 Z
10
+ date: 2025-01-06 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -71,6 +70,7 @@ files:
71
70
  - ".dockerignore"
72
71
  - ".github/workflows/ci.yml"
73
72
  - ".github/workflows/publish-images.yml"
73
+ - ".github/workflows/release-images.yml"
74
74
  - ".gitignore"
75
75
  - CONTRIBUTING.md
76
76
  - Dockerfile.jruby
@@ -87,7 +87,8 @@ files:
87
87
  - build/mk_osxcross.sh
88
88
  - build/mk_pkg_config.sh
89
89
  - build/parallel_docker_build.rb
90
- - build/patches2/rake-compiler-1.2.5/0004-Enable-build-of-static-libruby.patch
90
+ - build/patches/rake-compiler-1.2.9/0004-Enable-build-of-static-libruby.patch
91
+ - build/patches/rake-compiler-1.2.9/0005-build-miniruby-first.patch
91
92
  - build/rcd-env.sh
92
93
  - build/runas
93
94
  - build/sigfw.c
@@ -101,6 +102,7 @@ files:
101
102
  - lib/rake_compiler_dock/starter.rb
102
103
  - lib/rake_compiler_dock/version.rb
103
104
  - mingw64-ucrt/Dockerfile
105
+ - mingw64-ucrt/README.md
104
106
  - mingw64-ucrt/binutils-mingw-w64-ignore-check-errors.patch
105
107
  - mingw64-ucrt/gcc-mingw-w64-only-c-c++.patch
106
108
  - mingw64-ucrt/mingw-w64-enable-ucrt.patch
@@ -125,7 +127,6 @@ homepage: https://github.com/rake-compiler/rake-compiler-dock
125
127
  licenses:
126
128
  - MIT
127
129
  metadata: {}
128
- post_install_message:
129
130
  rdoc_options: []
130
131
  require_paths:
131
132
  - lib
@@ -140,8 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
141
  - !ruby/object:Gem::Version
141
142
  version: '0'
142
143
  requirements: []
143
- rubygems_version: 3.4.10
144
- signing_key:
144
+ rubygems_version: 3.6.2
145
145
  specification_version: 4
146
146
  summary: Easy to use and reliable cross compiler environment for building Windows
147
147
  and Linux binary gems.