Skip to content

Commit 36b9577

Browse files
committed
doc: update README with GNU/Musl description.
1 parent 1baaf03 commit 36b9577

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,43 @@ This is kind of successor of [rake-compiler-dev-box](https://github.com/tjschuck
1010
It is wrapped as a gem for easier setup, usage and integration and is based on lightweight Docker containers.
1111
It is also more reliable, since the underlying docker images are versioned and immutable.
1212

13+
## Supported platforms
14+
15+
The following platforms are supported for cross-compilation by rake-compiler-dock:
16+
17+
- `aarch64-linux` and `aarch64-linux-gnu`
18+
- `aarch64-linux-musl`
19+
- `arm-linux` and `arm-linux-gnu`
20+
- `arm-linux-musl`
21+
- `arm64-darwin`
22+
- `jruby`
23+
- `x64-mingw-ucrt`
24+
- `x64-mingw32`
25+
- `x86-linux` and `x86-linux-gnu`
26+
- `x86-linux-musl`
27+
- `x86-mingw32`
28+
- `x86_64-darwin`
29+
- `x86_64-linux` and `x86_64-linux-gnu`
30+
- `x86_64-linux-musl`
31+
32+
### Windows
33+
34+
`x64-mingw-ucrt` should be used for Ruby 3.1 and later on windows. `x64-mingw32` should be used for Ruby 3.0 and earlier.
35+
36+
### GNU and Musl
37+
38+
Platform names with a `*-linux` suffix are aliases for `*-linux-gnu`, since the Rubygems default is to assume `gnu` if no libc is specified.
39+
40+
Some C extensions may not require separate GNU and Musl builds, in which case it's acceptable to ship a single `*-linux` gem to cover both platforms.
41+
42+
The `*-linux-gnu` and `*-linux-musl` platform name suffixes require Rubygems 3.3.22 or later (or Bundler 2.3.21 or later) at installation time. Ruby version 3.0 and later ship with a sufficient Rubygems version, but versions compatible with earlier Rubies are:
43+
44+
- ruby: "2.7", rubygems: "3.4.22"
45+
- ruby: "2.6", rubygems: "3.4.22"
46+
- ruby: "2.5", rubygems: "3.3.26"
47+
- ruby: "2.4", rubygems: "3.3.26"
48+
49+
1350
## Installation
1451

1552
Install docker [following the instructions on the docker website](https://docs.docker.com/engine/install/) ... or install [docker-toolbox for Windows and OSX](https://github.com/docker/toolbox/releases) or boot2docker on [Windows](https://github.com/boot2docker/windows-installer/releases) or [OS X](https://github.com/boot2docker/osx-installer/releases) .
@@ -33,10 +70,12 @@ Your Rakefile should enable cross compilation like so:
3370
```ruby
3471
exttask = Rake::ExtensionTask.new('my_extension', my_gem_spec) do |ext|
3572
ext.cross_compile = true
36-
ext.cross_platform = %w[x86-mingw32 x64-mingw-ucrt x64-mingw32 x86-linux-gnu x86_64-linux-gnu x86_64-darwin arm64-darwin]
73+
ext.cross_platform = %w[x86-mingw32 x64-mingw-ucrt x64-mingw32 x86-linux x86_64-linux x86_64-darwin arm64-darwin]
3774
end
3875
```
3976

77+
where you should choose your platforms from the list in the "Supported platforms" section.
78+
4079
See below, how to invoke cross builds in your Rakefile.
4180

4281
Additionally it may also be used to build ffi based binary gems like [libusb](https://github.com/larskanis/libusb), but currently doesn't provide any additional build helpers for this use case, beyond docker invocation and cross compilers.

0 commit comments

Comments
 (0)