Skip to content

Commit 9a609e1

Browse files
committed
wip: change -linux to -linux-gnu everywhere
1 parent 1fa0b59 commit 9a609e1

File tree

10 files changed

+75
-50
lines changed

10 files changed

+75
-50
lines changed

.github/workflows/ci.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
platform:
28-
- x86-mingw32
28+
- aarch64-linux-gnu
29+
- arm-linux-gnu
30+
- arm64-darwin
31+
- jruby
2932
- x64-mingw-ucrt
3033
- x64-mingw32
31-
- x86-linux
32-
- x86_64-linux
34+
- x86-linux-gnu
35+
- x86-mingw32
3336
- x86_64-darwin
34-
- arm64-darwin
35-
- arm-linux
36-
- aarch64-linux
37-
- jruby
37+
- x86_64-linux-gnu
3838

3939
runs-on: ubuntu-latest
4040
env:
@@ -171,7 +171,7 @@ jobs:
171171
- os: macos
172172
platform: x86_64-darwin
173173
- os: ubuntu
174-
platform: x86_64-linux
174+
platform: x86_64-linux-gnu
175175
- os: ubuntu
176176
ruby: jruby-head
177177
platform: jruby
@@ -278,12 +278,12 @@ jobs:
278278
fail-fast: false
279279
matrix:
280280
include:
281-
- {platform: aarch64-linux, dockerfile: debian, from_image: arm64v8/ubuntu }
282-
- {platform: arm-linux, dockerfile: alpine, from_image: arm32v6/alpine }
283-
- {platform: arm-linux, dockerfile: debian, from_image: navikey/raspbian-bullseye }
284-
- {platform: x86-linux, dockerfile: alpine, from_image: i386/alpine }
285-
- {platform: x86_64-linux, dockerfile: alpine, from_image: alpine }
286-
- {platform: x86_64-linux, dockerfile: centos, from_image: amd64/centos }
281+
- {platform: aarch64-linux-gnu, dockerfile: debian, from_image: arm64v8/ubuntu }
282+
- {platform: arm-linux-gnu, dockerfile: alpine, from_image: arm32v6/alpine }
283+
- {platform: arm-linux-gnu, dockerfile: debian, from_image: navikey/raspbian-bullseye }
284+
- {platform: x86-linux-gnu, dockerfile: alpine, from_image: i386/alpine }
285+
- {platform: x86_64-linux-gnu, dockerfile: alpine, from_image: alpine }
286+
- {platform: x86_64-linux-gnu, dockerfile: centos, from_image: amd64/centos }
287287
runs-on: ubuntu-latest
288288
steps:
289289
- uses: actions/checkout@v3

.github/workflows/publish-images.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
platform:
16-
- x86-mingw32
16+
- aarch64-linux-gnu
17+
- arm-linux-gnu
18+
- arm64-darwin
1719
- x64-mingw-ucrt
1820
- x64-mingw32
19-
- x86-linux
20-
- x86_64-linux
21+
- x86-linux-gnu
22+
- x86-mingw32
2123
- x86_64-darwin
22-
- arm64-darwin
23-
- arm-linux
24-
- aarch64-linux
24+
- x86_64-linux-gnu
2525
- jruby
2626
runs-on: ubuntu-latest
2727
steps:

.gitignore

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
/.bundle/
22
/.yardoc
3-
/Dockerfile.mri.aarch64-linux
4-
/Dockerfile.mri.arm-linux
3+
/Dockerfile.mri.aarch64-linux-gnu
4+
/Dockerfile.mri.arm-linux-gnu
55
/Dockerfile.mri.arm64-darwin
6-
/Dockerfile.mri.arm64-linux
76
/Dockerfile.mri.x64-mingw-ucrt
87
/Dockerfile.mri.x64-mingw32
9-
/Dockerfile.mri.x86-linux
8+
/Dockerfile.mri.x86-linux-gnu
109
/Dockerfile.mri.x86-mingw32
1110
/Dockerfile.mri.x86_64-darwin
12-
/Dockerfile.mri.x86_64-linux
11+
/Dockerfile.mri.x86_64-linux-gnu
1312
/Gemfile.lock
1413
/_yardoc/
1514
/cache/

Dockerfile.mri.erb

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<%
22
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"
3+
when /x86_64-linux-gnu/ then "quay.io/pypa/manylinux2014_x86_64"
4+
when /x86-linux-gnu/ then "quay.io/pypa/manylinux2014_i686"
55
else "ubuntu:20.04"
66
end
77
manylinux = !!(image =~ /manylinux/)
@@ -68,8 +68,8 @@ RUN dpkg -i /debs/*.deb
6868
RUN apt-get -y update && \
6969
apt-get install -y <%
7070
if platform =~ /darwin/ %> clang python lzma-dev libxml2-dev libssl-dev libc++-10-dev <% end %><%
71-
if platform =~ /aarch64-linux/ %> gcc-aarch64-linux-gnu g++-aarch64-linux-gnu <% end %><%
72-
if platform =~ /arm-linux/ %> gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf <% end %><%
71+
if platform =~ /aarch64-linux-gnu/ %> gcc-aarch64-linux-gnu g++-aarch64-linux-gnu <% end %><%
72+
if platform =~ /arm-linux-gnu/ %> gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf <% end %><%
7373
if platform =~ /x86-mingw32/ %> gcc-mingw-w64-i686 g++-mingw-w64-i686 <% end %><%
7474
if platform =~ /x64-mingw32/ %> gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 <% end %> && \
7575
rm -rf /var/lib/apt/lists/*

History.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
next / unreleased
22
-----------------
33

4+
* Linux builds and their images are now fully qualified with the libc flavor. So, `x86_64-linux`
5+
should now be referred to as `x86_64-linux-gnu`, and the generated files are also named with the
6+
libc name.
47
* Replace `rvm` with `rbenv` and `ruby-build`
58
- `rvm` has been replaced by `rbenv` and `ruby-build`
69
- no longer applying sendfile patches to bootstrap rubies

README.md

+22-11
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Your Rakefile should enable cross compilation like so:
3333
```ruby
3434
exttask = Rake::ExtensionTask.new('my_extension', my_gem_spec) do |ext|
3535
ext.cross_compile = true
36-
ext.cross_platform = %w[x86-mingw32 x64-mingw-ucrt x64-mingw32 x86-linux x86_64-linux x86_64-darwin arm64-darwin]
36+
ext.cross_platform = %w[x86-mingw32 x64-mingw-ucrt x64-mingw32 x86-linux-gnu x86_64-linux-gnu x86_64-darwin arm64-darwin]
3737
end
3838
```
3939

@@ -44,7 +44,7 @@ Additionally it may also be used to build ffi based binary gems like [libusb](ht
4444
### Interactive Usage
4545

4646
Rake-compiler-dock offers the shell command `rake-compiler-dock` and a [ruby API](http://www.rubydoc.info/gems/rake-compiler-dock/RakeCompilerDock) for issuing commands within the docker image, described below.
47-
There are dedicated images for `x86-mingw32`, `x64-mingw-ucrt`, `x64-mingw32`, `x86-linux`, `x86_64-linux`, `x86_64-darwin`, `arm64-darwin` and `jruby` targets.
47+
There are dedicated images for targets: `aarch64-linux-gnu`, `arm-linux-gnu`, `arm64-darwin`, `x64-mingw-ucrt`, `x64-mingw32`, `x86-linux-gnu`, `x86-mingw32`, `x86_64-darwin`, `x86_64-linux-gnu`, and `jruby`.
4848
The images contain all supported cross ruby versions, with the exception of `x64-mingw32`, which has versions before 3.1 only, and `x64-mingw-ucrt`, which has only ruby-3.1+.
4949
This is to match the [changed platform of RubyInstaller-3.1](https://rubyinstaller.org/2021/12/31/rubyinstaller-3.1.0-1-released.html).
5050

@@ -68,12 +68,12 @@ To build x86 Windows and x86_64 Linux binary gems interactively, it can be calle
6868
user@host:$ ls pkg/*.gem
6969
your-gem-1.0.0.gem your-gem-1.0.0-x86-mingw32.gem
7070

71-
user@host:$ RCD_PLATFORM=x86_64-linux rake-compiler-dock # this enters a container for amd64 Linux target
71+
user@host:$ RCD_PLATFORM=x86_64-linux-gnu rake-compiler-dock # this enters a container for amd64 Linux target
7272
user@adc55b2b92a9:$ bundle
7373
user@adc55b2b92a9:$ rake cross native gem
7474
user@adc55b2b92a9:$ exit
7575
user@host:$ ls pkg/*.gem
76-
your-gem-1.0.0.gem your-gem-1.0.0-x86_64-linux.gem
76+
your-gem-1.0.0.gem your-gem-1.0.0-x86_64-linux-gnu.gem
7777

7878
Or non-interactive:
7979

@@ -118,10 +118,21 @@ To make the build process reproducible for other parties, it is recommended to a
118118
This can be done like this:
119119

120120
```ruby
121+
PLATFORMS = %w[
122+
aarch64-linux-gnu
123+
arm-linux-gnu
124+
arm64-darwin
125+
x64-mingw-ucrt
126+
x64-mingw32
127+
x86-linux-gnu
128+
x86-mingw32
129+
x86_64-darwin
130+
x86_64-linux-gnu
131+
]
121132
task 'gem:native' do
122133
require 'rake_compiler_dock'
123134
sh "bundle package --all" # Avoid repeated downloads of gems by using gem files from the host.
124-
%w[ x86-mingw32 x64-mingw-ucrt x64-mingw32 x86-linux x86_64-linux arm-linux aarch64-linux x86_64-darwin arm64-darwin ].each do |plat|
135+
PLATFORMS.each do |plat|
125136
RakeCompilerDock.sh "bundle --local && rake native:#{plat} gem", platform: plat
126137
end
127138
RakeCompilerDock.sh "bundle --local && rake java gem", rubyvm: :jruby
@@ -187,21 +198,21 @@ jobs:
187198
name: "native-gem"
188199
runs-on: ubuntu-latest
189200
container:
190-
image: "ghcr.io/rake-compiler/rake-compiler-dock-image:1.2.2-mri-x86_64-linux"
201+
image: "ghcr.io/rake-compiler/rake-compiler-dock-image:1.2.2-mri-x86_64-linux-gnu"
191202
steps:
192203
- uses: actions/checkout@v2
193-
- run: bundle install && bundle exec rake gem:x86_64-linux:rcd
204+
- run: bundle install && bundle exec rake gem:x86_64-linux-gnu:rcd
194205
- uses: actions/upload-artifact@v2
195206
with:
196207
name: native-gem
197208
path: gems
198209
retention-days: 1
199210
```
200211
201-
Where the referenced rake task might be defined by:
212+
Where the referenced rake task might be defined by something like:
202213
203214
``` ruby
204-
cross_platforms = ["x64-mingw32", "x86_64-linux", "x86_64-darwin", "arm64-darwin"]
215+
cross_platforms = ["x64-mingw32", "x86_64-linux-gnu", "x86_64-darwin", "arm64-darwin"]
205216

206217
namespace "gem" do
207218
cross_platforms.each do |platform|
@@ -223,7 +234,7 @@ For an example of rake tasks that support this style of invocation, visit https:
223234

224235
OCI images snapshotted from `main` are published weekly to Github Container Registry with the string "snapshot" in place of the version number in the tag name, e.g.:
225236

226-
- `ghcr.io/rake-compiler/rake-compiler-dock-image:snapshot-mri-x86_64-linux`
237+
- `ghcr.io/rake-compiler/rake-compiler-dock-image:snapshot-mri-x86_64-linux-gnu`
227238

228239
These images are intended for integration testing. They may not work properly and should not be considered production ready.
229240

@@ -237,7 +248,7 @@ The following variables are recognized by rake-compiler-dock:
237248
* `RCD_RUBYVM` - The ruby VM and toolchain to be used.
238249
Must be one of `mri`, `jruby`.
239250
* `RCD_PLATFORM` - The target rubygems platform.
240-
Must be a space separated list out of `x86-mingw32`, `x64-mingw-ucrt`, `x64-mingw32`, `x86-linux`, `x86_64-linux`, `arm-linux`, `aarch64-linux`, `x86_64-darwin` and `arm64-darwin`.
251+
Must be a space separated list out of `aarch64-linux-gnu`, `arm-linux-gnu`, `arm64-darwin`, `x64-mingw-ucrt`, `x64-mingw32`, `x86-linux-gnu`, `x86-mingw32`, `x86_64-darwin`, `x86_64-linux-gnu`.
241252
It is ignored when `rubyvm` is set to `:jruby`.
242253
* `RCD_IMAGE` - The docker image that is downloaded and started.
243254
Defaults to "ghcr.io/rake-compiler/rake-compiler-dock-image:IMAGE_VERSION-PLATFORM" with an image version that is determined by the gem version.

Rakefile

+8-7
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@ CLEAN.include("tmp")
99
RakeCompilerDock::GemHelper.install_tasks
1010

1111
platforms = [
12-
["x86-mingw32", "i686-w64-mingw32"],
13-
["x64-mingw32", "x86_64-w64-mingw32"],
12+
# tuple is [platform, target]
13+
["aarch64-linux-gnu", "aarch64-linux-gnu"],
14+
["arm-linux-gnu", "arm-linux-gnueabihf"],
15+
["arm64-darwin", "aarch64-apple-darwin"],
1416
["x64-mingw-ucrt", "x86_64-w64-mingw32"],
15-
["x86-linux", "i686-redhat-linux"],
16-
["x86_64-linux", "x86_64-redhat-linux"],
17+
["x64-mingw32", "x86_64-w64-mingw32"],
18+
["x86-linux-gnu", "i686-redhat-linux-gnu"],
19+
["x86-mingw32", "i686-w64-mingw32"],
1720
["x86_64-darwin", "x86_64-apple-darwin"],
18-
["arm64-darwin", "aarch64-apple-darwin"],
19-
["arm-linux", "arm-linux-gnueabihf"],
20-
["aarch64-linux", "aarch64-linux-gnu"],
21+
["x86_64-linux-gnu", "x86_64-redhat-linux-gnu"],
2122
]
2223

2324
namespace :build do

lib/rake_compiler_dock.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ module RakeCompilerDock
2626
#
2727
# Option +:platform+ can be set to a list of space separated values.
2828
# It selects the docker image(s) with an appropriate toolchain.
29-
# Allowed values are +:x86-mingw32+, +x64-mingw32+, +x86-linux+ or +x86_64-linux+.
29+
# Allowed values are +aarch64-linux-gnu+, +arm-linux-gnu+, +arm64-darwin+, +x64-mingw-ucrt+,
30+
# +x64-mingw32+, +x86-linux-gnu+, +x86-mingw32+, +x86_64-darwin+, +x86_64-linux-gnu+.
3031
# If the list contains multiple values, +cmd+ is consecutively executed in each of the docker images,
3132
# Option +:platform+ is ignored when +:rubyvm+ is set to +:jruby+.
3233
# Default is "x86-mingw32 x64-mingw32" .

test/rcd_test/Rakefile

+11-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@ else
1818
ext.ext_dir = 'ext/mri'
1919
ext.lib_dir = 'lib/rcd_test'
2020
ext.cross_compile = true
21-
ext.cross_platform = %w[x86-mingw32 x64-mingw-ucrt x64-mingw32 x86-linux x86_64-linux aarch64-linux arm-linux x86_64-darwin arm64-darwin]
21+
ext.cross_platform = %w[
22+
aarch64-linux-gnu
23+
arm-linux-gnu
24+
arm64-darwin
25+
x64-mingw-ucrt
26+
x64-mingw32
27+
x86-linux-gnu
28+
x86-mingw32
29+
x86_64-darwin
30+
x86_64-linux-gnu
31+
]
2232
end
2333
end
2434

test/test_starter.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def test_container_jrubyvm?
113113
assert(Starter.container_jrubyvm?({:rubyvm => "jruby"}))
114114
assert(Starter.container_jrubyvm?({:platform => "jruby"}))
115115
refute(Starter.container_jrubyvm?({:rubyvm => "mri"}))
116-
refute(Starter.container_jrubyvm?({:platform => "x86_64-linux"}))
116+
refute(Starter.container_jrubyvm?({:platform => "x86_64-linux-gnu"}))
117117
end
118118

119119
def test_platforms

0 commit comments

Comments
 (0)