rake-compiler-dock 1.2.1 → 1.2.2
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/ci.yml +110 -38
- data/Dockerfile.mri.erb +1 -1
- data/History.md +6 -0
- data/README.md +42 -45
- data/lib/rake_compiler_dock/version.rb +2 -2
- data/test/rcd_test/Rakefile +2 -1
- data/test/rcd_test/ext/mri/extconf.rb +6 -0
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 22fdbf0b0336450a55882dd000bea66c52a43325c6de59b0721ffbc6b5360576
|
|
4
|
+
data.tar.gz: 425f0ae751dfdcd3ff2936ff387c58b20d89e297d831c8c333ddd5738a9a92c2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 290f60e3969979b7830ab2a69c8989c484dbdf116fc76d9424a5efb71e5a1a4ab0bb834bc6504b3db3b383b76fbdb35ea070566d5118420ebfcf8b454a85a0a3
|
|
7
|
+
data.tar.gz: ab7a5180be028e305798032e35fc2070bce0ad882ace282ec21700b74552d35bf8a80dd2b660f9c66a8247605c11277eaf79c9ee338430b8ef4511bc945f1dfc
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -2,7 +2,17 @@ name: Build docker images
|
|
|
2
2
|
concurrency:
|
|
3
3
|
group: "${{github.workflow}}-${{github.ref}}"
|
|
4
4
|
cancel-in-progress: true
|
|
5
|
-
on:
|
|
5
|
+
on:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
tags:
|
|
11
|
+
- "*.*.*"
|
|
12
|
+
pull_request:
|
|
13
|
+
types: [opened, synchronize]
|
|
14
|
+
branches:
|
|
15
|
+
- "*"
|
|
6
16
|
|
|
7
17
|
jobs:
|
|
8
18
|
# These jobs use Buildx layer caching
|
|
@@ -12,17 +22,17 @@ jobs:
|
|
|
12
22
|
strategy:
|
|
13
23
|
fail-fast: false
|
|
14
24
|
matrix:
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
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
|
|
26
36
|
|
|
27
37
|
runs-on: ubuntu-latest
|
|
28
38
|
env:
|
|
@@ -59,6 +69,7 @@ jobs:
|
|
|
59
69
|
gem install -l rake-compiler-dock-*.gem
|
|
60
70
|
cd test/rcd_test/
|
|
61
71
|
bundle install
|
|
72
|
+
bundle exec rake clean clobber
|
|
62
73
|
bundle exec rake gem:${PLATFORM}
|
|
63
74
|
|
|
64
75
|
- name: Upload binary gem
|
|
@@ -67,63 +78,125 @@ jobs:
|
|
|
67
78
|
name: gem-${{ matrix.platform }}
|
|
68
79
|
path: test/rcd_test/pkg/*-*-*.gem
|
|
69
80
|
|
|
70
|
-
-
|
|
81
|
+
- if: matrix.platform == 'jruby'
|
|
82
|
+
name: Upload source gem
|
|
71
83
|
uses: actions/upload-artifact@v2
|
|
72
|
-
if: matrix.platform == 'jruby'
|
|
73
84
|
with:
|
|
74
85
|
name: gem-ruby
|
|
75
86
|
path: test/rcd_test/pkg/*-?.?.?.gem
|
|
76
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
|
|
77
106
|
|
|
78
107
|
job_test_native:
|
|
79
|
-
name: Test
|
|
108
|
+
name: Test (${{matrix.ruby}}, ${{matrix.platform}})
|
|
80
109
|
needs: docker_build
|
|
81
110
|
strategy:
|
|
82
111
|
fail-fast: false
|
|
83
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"
|
|
84
124
|
include:
|
|
85
125
|
- os: windows
|
|
86
|
-
ruby: "3.0"
|
|
87
|
-
platform: x64-mingw32
|
|
88
|
-
- os: windows
|
|
89
|
-
ruby: "2.4"
|
|
90
126
|
platform: x64-mingw32
|
|
91
127
|
- os: macos
|
|
92
|
-
ruby: "3.0"
|
|
93
|
-
platform: x86_64-darwin
|
|
94
|
-
- os: macos
|
|
95
|
-
ruby: "2.4"
|
|
96
128
|
platform: x86_64-darwin
|
|
97
129
|
- os: ubuntu
|
|
98
|
-
ruby: "3.0"
|
|
99
130
|
platform: x86_64-linux
|
|
100
131
|
- os: ubuntu
|
|
101
|
-
|
|
102
|
-
platform: x86_64-linux
|
|
132
|
+
platform: ruby
|
|
103
133
|
- os: ubuntu
|
|
104
134
|
ruby: jruby-head
|
|
105
135
|
platform: jruby
|
|
106
|
-
- os:
|
|
107
|
-
ruby: "3.
|
|
108
|
-
platform:
|
|
136
|
+
- os: windows
|
|
137
|
+
ruby: "3.1"
|
|
138
|
+
platform: x64-mingw-ucrt
|
|
139
|
+
exclude:
|
|
140
|
+
- os: windows
|
|
141
|
+
ruby: "3.1"
|
|
109
142
|
|
|
110
143
|
runs-on: ${{ matrix.os }}-latest
|
|
111
144
|
steps:
|
|
112
145
|
- uses: actions/checkout@v2
|
|
113
|
-
-
|
|
114
|
-
uses: ruby/setup-ruby@v1
|
|
146
|
+
- uses: ruby/setup-ruby@v1
|
|
115
147
|
with:
|
|
116
148
|
ruby-version: ${{ matrix.ruby }}
|
|
117
|
-
|
|
118
149
|
- run: ruby --version
|
|
119
|
-
|
|
120
|
-
- name: Download gem from build job
|
|
150
|
+
- name: Download gem-${{matrix.platform}}
|
|
121
151
|
uses: actions/download-artifact@v2
|
|
122
152
|
with:
|
|
123
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
|
|
124
161
|
|
|
125
|
-
|
|
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"
|
|
126
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
|
|
127
200
|
- name: Run tests
|
|
128
201
|
run: |
|
|
129
202
|
cd test/rcd_test/
|
|
@@ -131,7 +204,7 @@ jobs:
|
|
|
131
204
|
ruby -rrcd_test -S rake test
|
|
132
205
|
|
|
133
206
|
job_test_multiarch:
|
|
134
|
-
name: Test
|
|
207
|
+
name: Test ${{matrix.platform}} on ${{matrix.from_image}}
|
|
135
208
|
needs: docker_build
|
|
136
209
|
strategy:
|
|
137
210
|
fail-fast: false
|
|
@@ -156,11 +229,10 @@ jobs:
|
|
|
156
229
|
runs-on: ubuntu-latest
|
|
157
230
|
steps:
|
|
158
231
|
- uses: actions/checkout@v2
|
|
159
|
-
- name: Download gem
|
|
232
|
+
- name: Download gem-${{matrix.platform}}
|
|
160
233
|
uses: actions/download-artifact@v2
|
|
161
234
|
with:
|
|
162
235
|
name: gem-${{ matrix.platform }}
|
|
163
|
-
|
|
164
236
|
- name: Build image and Run tests
|
|
165
237
|
run: |
|
|
166
238
|
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
data/Dockerfile.mri.erb
CHANGED
|
@@ -217,7 +217,7 @@ RUN find /usr/local/rake-compiler/ruby/*mingw*/ -name rbconfig.rb | while read f
|
|
|
217
217
|
# Raise Windows-API to Vista (affects ruby < 2.6 only)
|
|
218
218
|
RUN find /usr/local/rake-compiler/ruby -name rbconfig.rb | while read f ; do sed -i 's/0x0501/0x0600/' $f ; done
|
|
219
219
|
# Don't link to static libruby
|
|
220
|
-
RUN find /usr/local/rake-compiler/ruby -name
|
|
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
|
|
221
221
|
<% end %>
|
|
222
222
|
|
|
223
223
|
USER root
|
data/History.md
CHANGED
data/README.md
CHANGED
|
@@ -95,51 +95,6 @@ For Linux:
|
|
|
95
95
|
You can also choose between different executable ruby versions by `rvm use <version>` .
|
|
96
96
|
The current default is 3.1.
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
### As a CI System Container
|
|
100
|
-
|
|
101
|
-
The OCI images provided by rake-compiler-dock can be used without the `rake-compiler-dock` gem or wrapper. This may be useful if your CI pipeline is building native gems.
|
|
102
|
-
|
|
103
|
-
For example, a Github Actions job might look like this:
|
|
104
|
-
|
|
105
|
-
``` yaml
|
|
106
|
-
jobs:
|
|
107
|
-
native-gem:
|
|
108
|
-
name: "native-gem"
|
|
109
|
-
runs-on: ubuntu-latest
|
|
110
|
-
container:
|
|
111
|
-
image: "larskanis/rake-compiler-dock-mri-x86_64-linux:1.2.1"
|
|
112
|
-
steps:
|
|
113
|
-
- uses: actions/checkout@v2
|
|
114
|
-
- run: bundle install && bundle exec rake gem:x86_64-linux:rcd
|
|
115
|
-
- uses: actions/upload-artifact@v2
|
|
116
|
-
with:
|
|
117
|
-
name: native-gem
|
|
118
|
-
path: gems
|
|
119
|
-
retention-days: 1
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
Where the referenced rake task might be defined by:
|
|
123
|
-
|
|
124
|
-
``` ruby
|
|
125
|
-
cross_platforms = ["x64-mingw32", "x86_64-linux", "x86_64-darwin", "arm64-darwin"]
|
|
126
|
-
|
|
127
|
-
namespace "gem" do
|
|
128
|
-
cross_platforms.each do |platform|
|
|
129
|
-
namespace platform do
|
|
130
|
-
task "rcd" do
|
|
131
|
-
Rake::Task["native:#{platform}"].invoke
|
|
132
|
-
Rake::Task["pkg/#{rcee_precompiled_spec.full_name}-#{Gem::Platform.new(platform)}.gem"].invoke
|
|
133
|
-
end
|
|
134
|
-
end
|
|
135
|
-
end
|
|
136
|
-
end
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
For an example of rake tasks that support this style of invocation, visit https://github.com/flavorjones/ruby-c-extensions-explained/tree/main/precompiled
|
|
141
|
-
|
|
142
|
-
|
|
143
98
|
### JRuby support
|
|
144
99
|
|
|
145
100
|
Rake-compiler-dock offers a dedicated docker image for JRuby.
|
|
@@ -220,6 +175,48 @@ gem 'rake-compiler-dock', '~> 1.2'
|
|
|
220
175
|
|
|
221
176
|
See [the wiki](https://github.com/rake-compiler/rake-compiler-dock/wiki/Projects-using-rake-compiler-dock) for projects which make use of rake-compiler-dock.
|
|
222
177
|
|
|
178
|
+
### As a CI System Container
|
|
179
|
+
|
|
180
|
+
The OCI images provided by rake-compiler-dock can be used without the `rake-compiler-dock` gem or wrapper. This may be useful if your CI pipeline is building native gems.
|
|
181
|
+
|
|
182
|
+
For example, a Github Actions job might look like this:
|
|
183
|
+
|
|
184
|
+
``` yaml
|
|
185
|
+
jobs:
|
|
186
|
+
native-gem:
|
|
187
|
+
name: "native-gem"
|
|
188
|
+
runs-on: ubuntu-latest
|
|
189
|
+
container:
|
|
190
|
+
image: "larskanis/rake-compiler-dock-mri-x86_64-linux:1.2.1"
|
|
191
|
+
steps:
|
|
192
|
+
- uses: actions/checkout@v2
|
|
193
|
+
- run: bundle install && bundle exec rake gem:x86_64-linux:rcd
|
|
194
|
+
- uses: actions/upload-artifact@v2
|
|
195
|
+
with:
|
|
196
|
+
name: native-gem
|
|
197
|
+
path: gems
|
|
198
|
+
retention-days: 1
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Where the referenced rake task might be defined by:
|
|
202
|
+
|
|
203
|
+
``` ruby
|
|
204
|
+
cross_platforms = ["x64-mingw32", "x86_64-linux", "x86_64-darwin", "arm64-darwin"]
|
|
205
|
+
|
|
206
|
+
namespace "gem" do
|
|
207
|
+
cross_platforms.each do |platform|
|
|
208
|
+
namespace platform do
|
|
209
|
+
task "rcd" do
|
|
210
|
+
Rake::Task["native:#{platform}"].invoke
|
|
211
|
+
Rake::Task["pkg/#{rcee_precompiled_spec.full_name}-#{Gem::Platform.new(platform)}.gem"].invoke
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
For an example of rake tasks that support this style of invocation, visit https://github.com/flavorjones/ruby-c-extensions-explained/tree/main/precompiled
|
|
223
220
|
|
|
224
221
|
## Environment Variables
|
|
225
222
|
|
data/test/rcd_test/Rakefile
CHANGED
|
@@ -41,11 +41,12 @@ namespace "gem" do
|
|
|
41
41
|
|
|
42
42
|
desc "Build the native gem for #{plat}"
|
|
43
43
|
task plat => 'prepare' do
|
|
44
|
+
config = "-- #{ENV['RCD_TEST_CONFIG']}"
|
|
44
45
|
# Set mountdir of the directory where .git resides, so that git ls-files in the gemspec works
|
|
45
46
|
RakeCompilerDock.sh <<-EOT, platform: plat, mountdir: Dir.pwd + "/../.."
|
|
46
47
|
(cp tmp/gem/gem-*.pem ~/.gem/ || true) &&
|
|
47
48
|
bundle --local &&
|
|
48
|
-
rake native:#{plat} pkg/#{exttask.gem_spec.full_name}-#{plat}.gem
|
|
49
|
+
rake native:#{plat} pkg/#{exttask.gem_spec.full_name}-#{plat}.gem #{config}
|
|
49
50
|
EOT
|
|
50
51
|
end
|
|
51
52
|
end
|
|
@@ -19,5 +19,11 @@ else
|
|
|
19
19
|
have_func('rb_thread_call_without_gvl', 'ruby/thread.h') ||
|
|
20
20
|
raise("rb_thread_call_without_gvl() not found")
|
|
21
21
|
|
|
22
|
+
if arg_config("--link-static", false)
|
|
23
|
+
# https://github.com/rake-compiler/rake-compiler-dock/issues/69
|
|
24
|
+
puts "Linking with '-static' flag"
|
|
25
|
+
$LDFLAGS << ' -static'
|
|
26
|
+
end
|
|
27
|
+
|
|
22
28
|
create_makefile("rcd_test/rcd_test_ext")
|
|
23
29
|
end
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rake-compiler-dock
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lars Kanis
|
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
|
35
35
|
oL1mUdzB8KrZL4/WbG5YNX6UTtJbIOu9qEFbBAy4/jtIkJX+dlNoFwd4GXQW1YNO
|
|
36
36
|
nA==
|
|
37
37
|
-----END CERTIFICATE-----
|
|
38
|
-
date: 2022-
|
|
38
|
+
date: 2022-06-27 00:00:00.000000000 Z
|
|
39
39
|
dependencies:
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: bundler
|
metadata.gz.sig
CHANGED
|
Binary file
|