mini_racer 0.7.0 → 0.8.0
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
- data/CHANGELOG +47 -102
- data/ext/mini_racer_extension/mini_racer_extension.cc +2 -2
- data/lib/mini_racer/version.rb +2 -2
- data/lib/mini_racer_extension.so +0 -0
- data/lib/mini_racer_loader.so +0 -0
- metadata +8 -15
- data/.dockerignore +0 -12
- data/.github/workflows/ci.yml +0 -118
- data/.gitignore +0 -13
- data/Dockerfile +0 -21
- data/Gemfile +0 -4
- data/Rakefile +0 -108
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/mini_racer.gemspec +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40b19f82c2a9392b14470ee4000477539f6415a3cfa06220f0cb8e3ae0a8542b
|
4
|
+
data.tar.gz: e6972a3b6190bf732bc8f8ba010e4c17b11316a3d3cf8d8870d085460a58fe55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da39c5527dcf390de270a21377555e7a6b3ea38c2214717a06a64e745b7d2321075484df859b8d00d374c2b6c3da400dc605459a302ddf8e7cd8e0d49092e0d9
|
7
|
+
data.tar.gz: 227c47a2db87cec7489fd45a3b4b6ddcb0168cda4c840391a7334175e01e3c3362ab7293931035326f64d2fed55438356a0ce9f9ee19288b073c5af18d473dcb
|
data/CHANGELOG
CHANGED
@@ -1,12 +1,16 @@
|
|
1
|
-
-
|
1
|
+
- 0.8.0 - 29-05-2022
|
2
2
|
|
3
|
-
- 0.
|
3
|
+
- Target Node to 18.16.0.0
|
4
4
|
|
5
|
-
|
5
|
+
- 0.7.0 - 29-05-2022
|
6
|
+
|
7
|
+
- Target Node to 17.9.1.0
|
6
8
|
|
7
|
-
-
|
9
|
+
- 0.6.4 - 25-05-2022
|
10
|
+
|
11
|
+
- Target Node 16.19.0.0
|
8
12
|
|
9
|
-
- 0.6.3
|
13
|
+
- 0.6.3 - 16-08-2022
|
10
14
|
|
11
15
|
- Truffle ruby support! Thanks to Brandon Fish and the truffle team
|
12
16
|
- Hide libv8 symbols on ELF targets
|
@@ -14,164 +18,130 @@
|
|
14
18
|
- Simplified timeout implementation
|
15
19
|
- Some stability fixes
|
16
20
|
|
17
|
-
- 17-01-2022
|
18
|
-
|
19
|
-
- 0.6.2
|
21
|
+
- 17-01-2022 - 0.6.2
|
20
22
|
|
21
23
|
- Fix support for compilation on 2.6, llvm compiles
|
22
24
|
- Stability patches to handle rare memory leaks
|
23
25
|
- Corrected re-raising of exceptions to support strings
|
24
26
|
- During early termination of context under certain conditions MiniRacer could crash
|
25
27
|
|
26
|
-
- 31-12-2021
|
27
|
-
|
28
|
-
- 0.6.1
|
28
|
+
- 0.6.1 - 31-12-2021
|
29
29
|
|
30
30
|
- Added support for single threaded platform: `MiniRacer::Platform.set_flags! :single_threaded`
|
31
31
|
must be called prior to booting ANY MiniRacer::Context
|
32
32
|
|
33
|
-
- 0.6.0
|
33
|
+
- 0.6.0 - 11-04-2021
|
34
34
|
|
35
35
|
- Ruby 3.1 support
|
36
36
|
- Fixes memory leak in heap snapshotting
|
37
37
|
- Improved compilation ergonomics in clang
|
38
38
|
- Migrated internal storage in c extension to TypedData
|
39
39
|
|
40
|
-
- 11-04-2021
|
41
40
|
|
42
41
|
- 0.5.0
|
42
|
+
|
43
43
|
- Fixes issues on aarch (Apple M1)
|
44
44
|
- Update to use libv8-node 16.x (#210) [Loic Nageleisen]
|
45
45
|
- FEATURE: Configurable max marshal stack depth (#202) [seanmakesgames]
|
46
46
|
- Ruby 2.3 and 2.4 are EOL, we no longer support them
|
47
47
|
|
48
|
-
- 0.4.0
|
48
|
+
- 0.4.0 - 08-04-2021
|
49
49
|
|
50
50
|
- FEATURE: upgrade to libv8 node 15.14.0 (v8 8.6.395.17)
|
51
51
|
- Promote 0.4.0.beta1 to release, using libv8-node release path
|
52
52
|
|
53
|
-
- 08-04-2021
|
54
53
|
|
55
|
-
- 0.4.0.beta1
|
54
|
+
- 0.4.0.beta1 - 23-07-2020
|
56
55
|
|
57
56
|
- FIX: on downgrade mkmf was picking the wrong version of libv8, this fix will correct future issues
|
58
57
|
- FEATURE: upgraded libv8 to use node libv8 build which supports M1 and various ARM builds v8 moved to (8.6.395.17)
|
59
58
|
|
60
|
-
- 23-07-2020
|
61
59
|
|
62
|
-
- 0.3.1
|
60
|
+
- 0.3.1 - 22-07-2020
|
63
61
|
|
64
62
|
- FIX: specify that libv8 must be larger than 8.4.255 but smaller than 8.5, this avoids issues going forward
|
65
63
|
|
66
|
-
-
|
67
|
-
|
68
|
-
- 0.3.0
|
64
|
+
- 0.3.0 - 29-06-2020
|
69
65
|
|
70
66
|
- FEATURE: upgraded to libv8 version 8.4.255.0
|
71
67
|
|
72
|
-
- 29-06-2020
|
73
68
|
|
74
|
-
- 0.2.15
|
69
|
+
- 0.2.15 - 15-05-2020
|
75
70
|
|
76
71
|
- FEATURE: basic wasm support via pump_message_loop
|
77
72
|
|
78
|
-
- 15-05-2020
|
79
73
|
|
80
|
-
- 0.2.14
|
74
|
+
- 0.2.14 - 15-05-2020
|
81
75
|
|
82
76
|
- FIX: ensure_gc_after_idle should take in milliseconds like the rest of the APIs not seconds
|
83
77
|
- FEATURE: strict params on MiniRacer::Context.new
|
84
78
|
|
85
|
-
- 15-05-2020
|
86
79
|
|
87
|
-
- 0.2.13
|
80
|
+
- 0.2.13 - 15-05-2020
|
88
81
|
|
89
82
|
- FIX: edge case around ensure_gc_after_idle possibly firing when context is not idle
|
90
83
|
|
91
|
-
- 15-05-2020
|
92
84
|
|
93
|
-
- 0.2.12
|
85
|
+
- 0.2.12 - 14-05-2020
|
94
86
|
|
95
87
|
- FEATURE: isolate.low_memory_notification which can force a full GC
|
96
88
|
- FEATURE: MiniRacer::Context.new(ensure_gc_after_idle: 2) - to force full GC 2 seconds after context is idle, this allows you to conserve memory on isolates
|
97
89
|
|
98
|
-
- 14-05-2020
|
99
90
|
|
100
91
|
- 0.2.11
|
101
92
|
|
102
93
|
- FIX: dumping heap snapshots was not flushing the file leading to corrupt snapshots
|
103
94
|
- FIX: a use-after-free shutdown crash
|
104
95
|
|
105
|
-
- 0.2.10
|
106
|
-
|
107
|
-
- 22-04-2020
|
108
|
-
|
96
|
+
- 0.2.10 - 22-04-2020
|
109
97
|
- FEATURE: memory softlimit support for nogvl_context_call
|
110
98
|
|
111
|
-
- 0.2.9
|
112
|
-
|
113
|
-
- 09-01-2020
|
99
|
+
- 0.2.9 - 09-01-2020
|
114
100
|
|
115
101
|
- FIX: correct segfault when JS returns a Symbol and properly cast to ruby symbol
|
116
102
|
|
117
|
-
- 0.2.8
|
103
|
+
- 0.2.8 - 11-11-2019
|
118
104
|
|
119
|
-
- 11-11-2019
|
120
105
|
|
121
106
|
- FIX: ensure thread live cycle is properly accounter for following file descriptor fix
|
122
107
|
|
123
|
-
- 0.2.7
|
124
|
-
|
125
|
-
- 11-11-2019
|
108
|
+
- 0.2.7 - 11-11-2019
|
126
109
|
|
127
110
|
- FIX: release the file descriptor for timeout pipe earlier (this avoids holding too many files open in Ruby 2.7)
|
128
111
|
|
129
|
-
- 14-05-2019
|
130
|
-
|
131
|
-
- 0.2.6
|
112
|
+
- 0.2.6 - 14-05-2019
|
132
113
|
|
133
114
|
- FEATURE: add support for write_heap_snapshot which helps you analyze memory
|
134
115
|
|
135
|
-
- 25-04-2019
|
136
|
-
|
137
|
-
- 0.2.5
|
116
|
+
- 0.2.5 - 25-04-2019
|
138
117
|
|
139
118
|
- FIX: Compatibility fixes for V8 7 and above @ignisf
|
140
119
|
- FIX: Memory leak in gc_callback @messense
|
141
120
|
- IMPROVEMENT: Added example of sourcemap support @ianks
|
142
121
|
- URGENT: you will need this release for latest version of libv8 to work
|
143
122
|
|
144
|
-
- 02-11-2018
|
145
|
-
|
146
|
-
- 0.2.4
|
123
|
+
- 0.2.4 - 02-11-2018
|
147
124
|
|
148
125
|
- FIX: deadlock releasing context when shared isolates are used
|
149
126
|
- FEATURE: include js backtrace when snapshots do not compile
|
150
127
|
|
151
|
-
- 28-09-2018
|
152
|
-
|
153
|
-
- 0.2.3
|
128
|
+
- 0.2.3 - 28-09-2018
|
154
129
|
|
155
130
|
- Drop all conditional logic from Mini Racer compilation for clang, always
|
156
131
|
rely on MacOS being High Sierra or up
|
157
132
|
|
158
|
-
- 26-09-2018
|
159
|
-
|
160
|
-
- 0.2.2
|
133
|
+
- 0.2.2 - 26-09-2018
|
161
134
|
|
162
135
|
- WORKAROUND: RUBY_PLATFORM is hardcoded on Ruby compile and can not be
|
163
136
|
trusted for feature detection, use a different technique when checking for
|
164
137
|
macOS Mojave
|
165
138
|
|
166
|
-
- 25-09-2018
|
167
|
-
|
168
|
-
- 0.2.1
|
139
|
+
- 0.2.1 - 25-09-2018
|
169
140
|
|
170
141
|
- FEATURE: Mojave macOS support
|
171
142
|
|
172
|
-
- 06-07-2018
|
143
|
+
- 0.2.0 - 06-07-2018
|
173
144
|
|
174
|
-
- 0.2.0
|
175
145
|
- FEATURE: context#call to allow for cheaper invocation of functions
|
176
146
|
- FIX: rare memory leak when terminating a long running attached function
|
177
147
|
- FIX: rare segfault when terminating a long running attached function
|
@@ -179,105 +149,80 @@
|
|
179
149
|
- Account for changes in the upstream V8 API @ignisf
|
180
150
|
- Support for libv8 6.7
|
181
151
|
|
182
|
-
23-08-2017
|
183
|
-
|
184
|
-
- 0.1.15
|
152
|
+
- 0.1.15 - 23-08-2017
|
185
153
|
|
186
154
|
- bump dependency of libv8 to 6.3
|
187
155
|
|
188
|
-
23-08-2017
|
189
|
-
|
190
|
-
- 0.1.14
|
156
|
+
- 0.1.14 - 23-08-2017
|
191
157
|
|
192
158
|
- libv8 erroneously bumped to beta, reverted change
|
193
159
|
|
194
|
-
23-08-2017
|
195
|
-
|
196
|
-
- 0.1.13
|
160
|
+
- 0.1.13 - 23-08-2017
|
197
161
|
|
198
162
|
- Fix: amend array buffer allocator to use v8 6.0 compatible allocator @ignisf
|
199
163
|
|
200
|
-
18-07-2017
|
201
|
-
|
202
|
-
- 0.1.12
|
164
|
+
- 0.1.12 - 18-07-2017
|
203
165
|
|
204
166
|
- Feature: upgrade libv8 to 5.9
|
205
167
|
- Fix: warning when running with ruby warnings enabled (missed @disposed initialize)
|
206
168
|
|
207
|
-
18-07-2017
|
208
|
-
|
209
|
-
- 0.1.11
|
169
|
+
- 0.1.11 - 18-07-2017
|
210
170
|
|
211
171
|
- Feature: upgrade libv8 to 5.7
|
212
172
|
|
213
|
-
13-07-2017
|
214
173
|
|
215
|
-
- 0.1.10
|
174
|
+
- 0.1.10 - 13-07-2017
|
216
175
|
|
217
176
|
- Fix leak: memory leak when disposing a context (20 bytes per context)
|
218
177
|
- Feature: added #heap_stats so you can get visibility from context to actual memory usage of isolate
|
219
178
|
- Feature: added #dispose so you reclaim all v8 memory right away as opposed to waiting for GC
|
220
179
|
- Feature: you can now specify filename in an eval eg: eval('a = 1', filename: 'my_awesome.js')
|
221
180
|
|
222
|
-
09-03-2017
|
223
181
|
|
224
|
-
- 0.1.9
|
182
|
+
- 0.1.9 - 09-03-2017
|
225
183
|
|
226
184
|
- Perf: speed up ruby/node boundary performance when moving large objects
|
227
185
|
|
228
|
-
06-02-2017
|
229
|
-
|
230
|
-
- 0.1.8
|
186
|
+
- 0.1.8 - 06-02-2017
|
231
187
|
|
232
188
|
- Fix: Include math.h to fix use of undeclared identifier floor with rbx. See #51
|
233
189
|
|
234
|
-
02-11-2016
|
235
|
-
|
236
|
-
- 0.1.7
|
190
|
+
- 0.1.7 - 02-11-2016
|
237
191
|
|
238
192
|
- Fix: if for some reason an isolate was forked don't free it and raise a warning instead to avoid hanging process
|
239
193
|
|
240
|
-
25-10-2016
|
241
|
-
|
242
|
-
- 0.1.6
|
194
|
+
- 0.1.6 - 25-10-2016
|
243
195
|
|
244
196
|
- Fix: timeout behavior was incorrect, in some cases stop could be called on already stopped contexts
|
245
197
|
|
246
|
-
10-10-2016
|
247
|
-
|
248
|
-
- 0.1.5
|
198
|
+
- 0.1.5 - 10-10-2016
|
249
199
|
|
250
200
|
- Support for snapshots, shared isolates, runtime flags thanks to @wk8
|
251
201
|
- Fix timeout behavior when it occurs in an attached Ruby method
|
252
202
|
|
253
|
-
19-05-2016
|
254
|
-
|
255
|
-
- 0.1.4
|
203
|
+
- 0.1.4 - 19-05-2016
|
256
204
|
|
257
205
|
- Set upper bound for libv8 inclusion @ignisf
|
258
206
|
- Support conversion of Date, Time and DateTime from Ruby to JS @seanmakesgames
|
259
207
|
- Support conversion of large numbers back from Ruby to JS @seanmakesgames
|
260
208
|
|
261
|
-
- 0.1.3
|
209
|
+
- 0.1.3 - 17-05-2016
|
262
210
|
|
263
211
|
- Support more conversions from Ruby back to JS (Hash, Symbol, Array)
|
264
212
|
- Support attaching nested objects
|
265
213
|
|
266
|
-
17-05-2016
|
267
214
|
|
268
|
-
- 0.1.2
|
215
|
+
- 0.1.2 - 17-05-2016
|
269
216
|
|
270
217
|
- Gemspec specifies minimal version of Ruby (2.0)
|
271
218
|
- Implement #load on Context to load files
|
272
219
|
|
273
|
-
17-05-2016
|
274
220
|
|
275
221
|
- 0.1.1
|
276
222
|
|
277
223
|
- Added unblock function so SIGINT does not lead to a crash
|
278
224
|
|
279
|
-
14-05-2016
|
280
225
|
|
281
|
-
- 0.1.1.beta.1
|
226
|
+
- 0.1.1.beta.1 - 14-05-2016
|
282
227
|
|
283
228
|
- First release
|
@@ -518,7 +518,7 @@ nogvl_context_eval(void* arg) {
|
|
518
518
|
MaybeLocal<Script> parsed_script;
|
519
519
|
|
520
520
|
if (eval_params->filename) {
|
521
|
-
origin = new v8::ScriptOrigin(*eval_params->filename);
|
521
|
+
origin = new v8::ScriptOrigin(isolate, *eval_params->filename);
|
522
522
|
}
|
523
523
|
|
524
524
|
parsed_script = Script::Compile(context, *eval_params->eval, origin);
|
@@ -791,7 +791,7 @@ static bool run_extra_code(Isolate *isolate, Local<v8::Context> context,
|
|
791
791
|
}
|
792
792
|
Local<String> resource_name =
|
793
793
|
String::NewFromUtf8(isolate, name).ToLocalChecked();
|
794
|
-
ScriptOrigin origin(resource_name);
|
794
|
+
ScriptOrigin origin(isolate, resource_name);
|
795
795
|
ScriptCompiler::Source source(source_string, origin);
|
796
796
|
Local<Script> script;
|
797
797
|
if (!ScriptCompiler::Compile(context, &source).ToLocal(&script))
|
data/lib/mini_racer/version.rb
CHANGED
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_racer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 18.16.0.0
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 18.16.0.0
|
97
97
|
description: Minimal embedded v8 engine for Ruby
|
98
98
|
email:
|
99
99
|
- sam.saffron@gmail.com
|
@@ -103,18 +103,10 @@ extensions:
|
|
103
103
|
- ext/mini_racer_extension/extconf.rb
|
104
104
|
extra_rdoc_files: []
|
105
105
|
files:
|
106
|
-
- ".dockerignore"
|
107
|
-
- ".github/workflows/ci.yml"
|
108
|
-
- ".gitignore"
|
109
106
|
- CHANGELOG
|
110
107
|
- CODE_OF_CONDUCT.md
|
111
|
-
- Dockerfile
|
112
|
-
- Gemfile
|
113
108
|
- LICENSE.txt
|
114
109
|
- README.md
|
115
|
-
- Rakefile
|
116
|
-
- bin/console
|
117
|
-
- bin/setup
|
118
110
|
- ext/mini_racer_extension/extconf.rb
|
119
111
|
- ext/mini_racer_extension/mini_racer_extension.cc
|
120
112
|
- ext/mini_racer_loader/extconf.rb
|
@@ -122,15 +114,16 @@ files:
|
|
122
114
|
- lib/mini_racer.rb
|
123
115
|
- lib/mini_racer/truffleruby.rb
|
124
116
|
- lib/mini_racer/version.rb
|
125
|
-
-
|
117
|
+
- lib/mini_racer_extension.so
|
118
|
+
- lib/mini_racer_loader.so
|
126
119
|
homepage: https://github.com/discourse/mini_racer
|
127
120
|
licenses:
|
128
121
|
- MIT
|
129
122
|
metadata:
|
130
123
|
bug_tracker_uri: https://github.com/discourse/mini_racer/issues
|
131
|
-
changelog_uri: https://github.com/discourse/mini_racer/blob/v0.
|
132
|
-
documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.
|
133
|
-
source_code_uri: https://github.com/discourse/mini_racer/tree/v0.
|
124
|
+
changelog_uri: https://github.com/discourse/mini_racer/blob/v0.8.0/CHANGELOG
|
125
|
+
documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.8.0
|
126
|
+
source_code_uri: https://github.com/discourse/mini_racer/tree/v0.8.0
|
134
127
|
post_install_message:
|
135
128
|
rdoc_options: []
|
136
129
|
require_paths:
|
data/.dockerignore
DELETED
data/.github/workflows/ci.yml
DELETED
@@ -1,118 +0,0 @@
|
|
1
|
-
name: Tests
|
2
|
-
|
3
|
-
on:
|
4
|
-
pull_request:
|
5
|
-
push:
|
6
|
-
branches:
|
7
|
-
- master
|
8
|
-
|
9
|
-
jobs:
|
10
|
-
test-truffleruby:
|
11
|
-
strategy:
|
12
|
-
fail-fast: false
|
13
|
-
matrix:
|
14
|
-
os:
|
15
|
-
- "macos-11"
|
16
|
-
- "macos-12"
|
17
|
-
- "ubuntu-20.04"
|
18
|
-
ruby:
|
19
|
-
- "truffleruby+graalvm-head"
|
20
|
-
|
21
|
-
name: ${{ matrix.os }} - ${{ matrix.ruby }}
|
22
|
-
runs-on: ${{ matrix.os }}
|
23
|
-
|
24
|
-
env:
|
25
|
-
TRUFFLERUBYOPT: "--jvm --polyglot"
|
26
|
-
|
27
|
-
steps:
|
28
|
-
- uses: actions/checkout@v3
|
29
|
-
- uses: ruby/setup-ruby@v1
|
30
|
-
with:
|
31
|
-
ruby-version: ${{ matrix.ruby }}
|
32
|
-
bundler-cache: true
|
33
|
-
- name: Install GraalVM JS component
|
34
|
-
run: gu install js
|
35
|
-
- name: Compile
|
36
|
-
run: bundle exec rake compile
|
37
|
-
- name: Test
|
38
|
-
run: bundle exec rake test
|
39
|
-
|
40
|
-
test-darwin:
|
41
|
-
strategy:
|
42
|
-
fail-fast: false
|
43
|
-
matrix:
|
44
|
-
os:
|
45
|
-
- "macos-11"
|
46
|
-
- "macos-12"
|
47
|
-
ruby:
|
48
|
-
- "ruby-3.0"
|
49
|
-
- "ruby-3.1"
|
50
|
-
- "ruby-3.2"
|
51
|
-
|
52
|
-
name: ${{ matrix.os }} - ${{ matrix.ruby }}
|
53
|
-
runs-on: ${{ matrix.os }}
|
54
|
-
|
55
|
-
steps:
|
56
|
-
- uses: actions/checkout@v3
|
57
|
-
- uses: ruby/setup-ruby@v1
|
58
|
-
with:
|
59
|
-
ruby-version: ${{ matrix.ruby }}
|
60
|
-
bundler-cache: true
|
61
|
-
- name: Compile
|
62
|
-
run: bundle exec rake compile
|
63
|
-
- name: Test
|
64
|
-
run: bundle exec rake test
|
65
|
-
|
66
|
-
test-linux:
|
67
|
-
strategy:
|
68
|
-
fail-fast: false
|
69
|
-
matrix:
|
70
|
-
ruby:
|
71
|
-
- "3.0"
|
72
|
-
- "3.1"
|
73
|
-
- "3.2"
|
74
|
-
platform:
|
75
|
-
- "amd64"
|
76
|
-
- "arm64"
|
77
|
-
libc:
|
78
|
-
- "gnu"
|
79
|
-
- "musl"
|
80
|
-
|
81
|
-
name: linux-${{ matrix.platform }} - ruby-${{ matrix.ruby }} - ${{ matrix.libc }}
|
82
|
-
runs-on: ubuntu-20.04
|
83
|
-
|
84
|
-
steps:
|
85
|
-
- name: Enable ${{ matrix.platform }} platform
|
86
|
-
id: qemu
|
87
|
-
if: ${{ matrix.platform != 'amd64' }}
|
88
|
-
run: |
|
89
|
-
docker run --privileged --rm tonistiigi/binfmt:latest --install ${{ matrix.platform }} | tee platforms.json
|
90
|
-
echo "::set-output name=platforms::$(cat platforms.json)"
|
91
|
-
- name: Start container
|
92
|
-
id: container
|
93
|
-
run: |
|
94
|
-
case ${{ matrix.libc }} in
|
95
|
-
gnu)
|
96
|
-
echo 'ruby:${{ matrix.ruby }}'
|
97
|
-
;;
|
98
|
-
musl)
|
99
|
-
echo 'ruby:${{ matrix.ruby }}-alpine'
|
100
|
-
;;
|
101
|
-
esac > container_image
|
102
|
-
echo "::set-output name=image::$(cat container_image)"
|
103
|
-
docker run --rm -d -v "${PWD}":"${PWD}" -w "${PWD}" --platform linux/${{ matrix.platform }} $(cat container_image) /bin/sleep 64d | tee container_id
|
104
|
-
docker exec -w "${PWD}" $(cat container_id) uname -a
|
105
|
-
echo "::set-output name=id::$(cat container_id)"
|
106
|
-
- name: Install Alpine system dependencies
|
107
|
-
if: ${{ matrix.libc == 'musl' }}
|
108
|
-
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} apk add --no-cache build-base bash git
|
109
|
-
- name: Checkout
|
110
|
-
uses: actions/checkout@v3
|
111
|
-
- name: Update Rubygems
|
112
|
-
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} gem update --system
|
113
|
-
- name: Bundle
|
114
|
-
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle install
|
115
|
-
- name: Compile
|
116
|
-
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle exec rake compile
|
117
|
-
- name: Test
|
118
|
-
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle exec rake test
|
data/.gitignore
DELETED
data/Dockerfile
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
ARG RUBY_VERSION=3.2
|
2
|
-
FROM ruby:${RUBY_VERSION}
|
3
|
-
|
4
|
-
RUN test ! -f /etc/alpine-release || apk add --no-cache build-base git
|
5
|
-
|
6
|
-
# without this `COPY .git`, we get the following error:
|
7
|
-
# fatal: not a git repository (or any of the parent directories): .git
|
8
|
-
# but with it we need the full gem just to compile the extension because
|
9
|
-
# of gemspec's `git --ls-files`
|
10
|
-
# COPY .git /code/.git
|
11
|
-
COPY Gemfile mini_racer.gemspec /code/
|
12
|
-
COPY lib/mini_racer/version.rb /code/lib/mini_racer/version.rb
|
13
|
-
WORKDIR /code
|
14
|
-
RUN bundle install
|
15
|
-
|
16
|
-
COPY Rakefile /code/
|
17
|
-
COPY ext /code/ext/
|
18
|
-
RUN bundle exec rake compile
|
19
|
-
|
20
|
-
COPY . /code/
|
21
|
-
CMD bundle exec irb -rmini_racer
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,108 +0,0 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
require "rake/testtask"
|
3
|
-
|
4
|
-
Rake::TestTask.new(:test) do |t|
|
5
|
-
t.libs << "test"
|
6
|
-
t.libs << "lib"
|
7
|
-
t.test_files = FileList['test/**/*_test.rb']
|
8
|
-
end
|
9
|
-
|
10
|
-
task :default => [:compile, :test]
|
11
|
-
|
12
|
-
gem = Gem::Specification.load( File.dirname(__FILE__) + '/mini_racer.gemspec' )
|
13
|
-
|
14
|
-
if RUBY_ENGINE == "truffleruby"
|
15
|
-
task :compile do
|
16
|
-
# noop
|
17
|
-
end
|
18
|
-
|
19
|
-
task :clean do
|
20
|
-
# noop
|
21
|
-
end
|
22
|
-
else
|
23
|
-
require 'rake/extensiontask'
|
24
|
-
Rake::ExtensionTask.new( 'mini_racer_loader', gem )
|
25
|
-
Rake::ExtensionTask.new( 'mini_racer_extension', gem )
|
26
|
-
end
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
# via http://blog.flavorjon.es/2009/06/easily-valgrind-gdb-your-ruby-c.html
|
31
|
-
namespace :test do
|
32
|
-
desc "run test suite with Address Sanitizer"
|
33
|
-
task :asan do
|
34
|
-
ENV["CONFIGURE_ARGS"] = [ENV["CONFIGURE_ARGS"], '--enable-asan'].compact.join(' ')
|
35
|
-
Rake::Task['compile'].invoke
|
36
|
-
|
37
|
-
asan_path = `ldconfig -N -p |grep libasan | grep -v 32 | sed 's/.* => \\(.*\\)$/\\1/'`.chomp.split("\n")[-1]
|
38
|
-
|
39
|
-
|
40
|
-
cmdline = "env LD_PRELOAD=\"#{asan_path}\" ruby test/test_leak.rb"
|
41
|
-
puts cmdline
|
42
|
-
system cmdline
|
43
|
-
|
44
|
-
cmdline = "env LD_PRELOAD=\"#{asan_path}\" rake test"
|
45
|
-
puts cmdline
|
46
|
-
system cmdline
|
47
|
-
end
|
48
|
-
# partial-loads-ok and undef-value-errors necessary to ignore
|
49
|
-
# spurious (and eminently ignorable) warnings from the ruby
|
50
|
-
# interpreter
|
51
|
-
VALGRIND_BASIC_OPTS = "--num-callers=50 --error-limit=no \
|
52
|
-
--partial-loads-ok=yes --undef-value-errors=no"
|
53
|
-
|
54
|
-
desc "run test suite under valgrind with basic ruby options"
|
55
|
-
task :valgrind => :compile do
|
56
|
-
cmdline = "valgrind #{VALGRIND_BASIC_OPTS} ruby test/test_leak.rb"
|
57
|
-
puts cmdline
|
58
|
-
system cmdline
|
59
|
-
end
|
60
|
-
|
61
|
-
desc "run test suite under valgrind with leak-check=full"
|
62
|
-
task :valgrind_leak_check => :compile do
|
63
|
-
cmdline = "valgrind #{VALGRIND_BASIC_OPTS} --leak-check=full ruby test/test_leak.rb"
|
64
|
-
puts cmdline
|
65
|
-
require 'open3'
|
66
|
-
_, stderr = Open3.capture3(cmdline)
|
67
|
-
|
68
|
-
section = ""
|
69
|
-
stderr.split("\n").each do |line|
|
70
|
-
|
71
|
-
if line =~ /==.*==\s*$/
|
72
|
-
if (section =~ /mini_racer|SUMMARY/)
|
73
|
-
puts
|
74
|
-
puts section
|
75
|
-
puts
|
76
|
-
end
|
77
|
-
section = ""
|
78
|
-
else
|
79
|
-
section << line << "\n"
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
desc 'run clang-tidy linter on mini_racer_extension.cc'
|
86
|
-
task :lint do
|
87
|
-
require 'mkmf'
|
88
|
-
require 'libv8'
|
89
|
-
|
90
|
-
Libv8.configure_makefile
|
91
|
-
|
92
|
-
conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
|
93
|
-
'arch_hdrdir' => $arch_hdrdir.quote,
|
94
|
-
'top_srcdir' => $top_srcdir.quote)
|
95
|
-
if $universal and (arch_flag = conf['ARCH_FLAG']) and !arch_flag.empty?
|
96
|
-
conf['ARCH_FLAG'] = arch_flag.gsub(/(?:\G|\s)-arch\s+\S+/, '')
|
97
|
-
end
|
98
|
-
|
99
|
-
checks = %W(bugprone-*
|
100
|
-
cert-*
|
101
|
-
cppcoreguidelines-*
|
102
|
-
clang-analyzer-*
|
103
|
-
performance-*
|
104
|
-
portability-*
|
105
|
-
readability-*).join(',')
|
106
|
-
|
107
|
-
sh RbConfig::expand("clang-tidy -checks='#{checks}' ext/mini_racer_extension/mini_racer_extension.cc -- #$INCFLAGS #$CXXFLAGS", conf)
|
108
|
-
end
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "mini_racer"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start
|
data/bin/setup
DELETED
data/mini_racer.gemspec
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'mini_racer/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "mini_racer"
|
8
|
-
spec.version = MiniRacer::VERSION
|
9
|
-
spec.authors = ["Sam Saffron"]
|
10
|
-
spec.email = ["sam.saffron@gmail.com"]
|
11
|
-
|
12
|
-
spec.summary = %q{Minimal embedded v8 for Ruby}
|
13
|
-
spec.description = %q{Minimal embedded v8 engine for Ruby}
|
14
|
-
spec.homepage = "https://github.com/discourse/mini_racer"
|
15
|
-
spec.license = "MIT"
|
16
|
-
|
17
|
-
spec.metadata = {
|
18
|
-
"bug_tracker_uri" => "https://github.com/discourse/mini_racer/issues",
|
19
|
-
"changelog_uri" => "https://github.com/discourse/mini_racer/blob/v#{spec.version}/CHANGELOG",
|
20
|
-
"documentation_uri" => "https://www.rubydoc.info/gems/mini_racer/#{spec.version}",
|
21
|
-
"source_code_uri" => "https://github.com/discourse/mini_racer/tree/v#{spec.version}",
|
22
|
-
}
|
23
|
-
|
24
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(benchmark|test|spec|features|examples)/}) }
|
25
|
-
spec.require_paths = ["lib"]
|
26
|
-
|
27
|
-
spec.add_development_dependency "bundler"
|
28
|
-
spec.add_development_dependency "rake", ">= 12.3.3"
|
29
|
-
spec.add_development_dependency "minitest", "~> 5.0"
|
30
|
-
spec.add_development_dependency "rake-compiler"
|
31
|
-
spec.add_development_dependency "m"
|
32
|
-
|
33
|
-
spec.add_dependency 'libv8-node', MiniRacer::LIBV8_NODE_VERSION
|
34
|
-
spec.require_paths = ["lib", "ext"]
|
35
|
-
|
36
|
-
spec.extensions = ["ext/mini_racer_loader/extconf.rb", "ext/mini_racer_extension/extconf.rb"]
|
37
|
-
|
38
|
-
spec.required_ruby_version = '>= 3.0'
|
39
|
-
end
|