mini_racer 0.7.0 → 0.9.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 +52 -102
- data/ext/mini_racer_extension/mini_racer_extension.cc +2 -2
- data/lib/mini_racer/truffleruby.rb +1 -2
- data/lib/mini_racer/version.rb +2 -2
- metadata +8 -17
- 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: a6ebb67e67be2952ea043e965a9b3ecbf55c1a8c7747b1b9be21433ab8dd394b
|
4
|
+
data.tar.gz: 0de98c006a529bdffb79116a089e7f7345ad373661270fd4851bb4b2ff6dd2cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ae281e2827ab7edcb549c694ad8f11744d6b28960177e907a9ef546a31315ea956fbc818ef419daaaec9201a01454f0a94e3e44a5cdd318a5a091c815d3cfc1
|
7
|
+
data.tar.gz: 12c82ef489ac60ed7c4699d44d436a9aba7cfe30a59770354ca13c9ec072c53bcbe50143eefa79415ff7e6b6d5c47a7b50337ab90702c46f9119879ad635cdf1
|
data/CHANGELOG
CHANGED
@@ -1,12 +1,21 @@
|
|
1
|
-
- 25-
|
1
|
+
- 0.9.0 - 25-03-2024
|
2
2
|
|
3
|
-
- 0.
|
3
|
+
- Target Node to 18.19.0.0
|
4
4
|
|
5
|
-
|
5
|
+
- 0.8.0 - 29-05-2023
|
6
|
+
|
7
|
+
- Target Node to 18.16.0.0
|
8
|
+
- Drop supporting EOL'd Ruby 2.7
|
9
|
+
|
10
|
+
- 0.7.0 - 26-05-2023
|
11
|
+
|
12
|
+
- Target Node to 17.9.1.0
|
6
13
|
|
7
|
-
-
|
14
|
+
- 0.6.4 - 25-05-2022
|
8
15
|
|
9
|
-
- 0.
|
16
|
+
- Target Node 16.19.0.0
|
17
|
+
|
18
|
+
- 0.6.3 - 16-08-2022
|
10
19
|
|
11
20
|
- Truffle ruby support! Thanks to Brandon Fish and the truffle team
|
12
21
|
- Hide libv8 symbols on ELF targets
|
@@ -14,164 +23,130 @@
|
|
14
23
|
- Simplified timeout implementation
|
15
24
|
- Some stability fixes
|
16
25
|
|
17
|
-
- 17-01-2022
|
18
|
-
|
19
|
-
- 0.6.2
|
26
|
+
- 17-01-2022 - 0.6.2
|
20
27
|
|
21
28
|
- Fix support for compilation on 2.6, llvm compiles
|
22
29
|
- Stability patches to handle rare memory leaks
|
23
30
|
- Corrected re-raising of exceptions to support strings
|
24
31
|
- During early termination of context under certain conditions MiniRacer could crash
|
25
32
|
|
26
|
-
- 31-12-2021
|
27
|
-
|
28
|
-
- 0.6.1
|
33
|
+
- 0.6.1 - 31-12-2021
|
29
34
|
|
30
35
|
- Added support for single threaded platform: `MiniRacer::Platform.set_flags! :single_threaded`
|
31
36
|
must be called prior to booting ANY MiniRacer::Context
|
32
37
|
|
33
|
-
- 0.6.0
|
38
|
+
- 0.6.0 - 11-04-2021
|
34
39
|
|
35
40
|
- Ruby 3.1 support
|
36
41
|
- Fixes memory leak in heap snapshotting
|
37
42
|
- Improved compilation ergonomics in clang
|
38
43
|
- Migrated internal storage in c extension to TypedData
|
39
44
|
|
40
|
-
- 11-04-2021
|
41
45
|
|
42
46
|
- 0.5.0
|
47
|
+
|
43
48
|
- Fixes issues on aarch (Apple M1)
|
44
49
|
- Update to use libv8-node 16.x (#210) [Loic Nageleisen]
|
45
50
|
- FEATURE: Configurable max marshal stack depth (#202) [seanmakesgames]
|
46
51
|
- Ruby 2.3 and 2.4 are EOL, we no longer support them
|
47
52
|
|
48
|
-
- 0.4.0
|
53
|
+
- 0.4.0 - 08-04-2021
|
49
54
|
|
50
55
|
- FEATURE: upgrade to libv8 node 15.14.0 (v8 8.6.395.17)
|
51
56
|
- Promote 0.4.0.beta1 to release, using libv8-node release path
|
52
57
|
|
53
|
-
- 08-04-2021
|
54
58
|
|
55
|
-
- 0.4.0.beta1
|
59
|
+
- 0.4.0.beta1 - 23-07-2020
|
56
60
|
|
57
61
|
- FIX: on downgrade mkmf was picking the wrong version of libv8, this fix will correct future issues
|
58
62
|
- FEATURE: upgraded libv8 to use node libv8 build which supports M1 and various ARM builds v8 moved to (8.6.395.17)
|
59
63
|
|
60
|
-
- 23-07-2020
|
61
64
|
|
62
|
-
- 0.3.1
|
65
|
+
- 0.3.1 - 22-07-2020
|
63
66
|
|
64
67
|
- FIX: specify that libv8 must be larger than 8.4.255 but smaller than 8.5, this avoids issues going forward
|
65
68
|
|
66
|
-
-
|
67
|
-
|
68
|
-
- 0.3.0
|
69
|
+
- 0.3.0 - 29-06-2020
|
69
70
|
|
70
71
|
- FEATURE: upgraded to libv8 version 8.4.255.0
|
71
72
|
|
72
|
-
- 29-06-2020
|
73
73
|
|
74
|
-
- 0.2.15
|
74
|
+
- 0.2.15 - 15-05-2020
|
75
75
|
|
76
76
|
- FEATURE: basic wasm support via pump_message_loop
|
77
77
|
|
78
|
-
- 15-05-2020
|
79
78
|
|
80
|
-
- 0.2.14
|
79
|
+
- 0.2.14 - 15-05-2020
|
81
80
|
|
82
81
|
- FIX: ensure_gc_after_idle should take in milliseconds like the rest of the APIs not seconds
|
83
82
|
- FEATURE: strict params on MiniRacer::Context.new
|
84
83
|
|
85
|
-
- 15-05-2020
|
86
84
|
|
87
|
-
- 0.2.13
|
85
|
+
- 0.2.13 - 15-05-2020
|
88
86
|
|
89
87
|
- FIX: edge case around ensure_gc_after_idle possibly firing when context is not idle
|
90
88
|
|
91
|
-
- 15-05-2020
|
92
89
|
|
93
|
-
- 0.2.12
|
90
|
+
- 0.2.12 - 14-05-2020
|
94
91
|
|
95
92
|
- FEATURE: isolate.low_memory_notification which can force a full GC
|
96
93
|
- 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
94
|
|
98
|
-
- 14-05-2020
|
99
95
|
|
100
96
|
- 0.2.11
|
101
97
|
|
102
98
|
- FIX: dumping heap snapshots was not flushing the file leading to corrupt snapshots
|
103
99
|
- FIX: a use-after-free shutdown crash
|
104
100
|
|
105
|
-
- 0.2.10
|
106
|
-
|
107
|
-
- 22-04-2020
|
108
|
-
|
101
|
+
- 0.2.10 - 22-04-2020
|
109
102
|
- FEATURE: memory softlimit support for nogvl_context_call
|
110
103
|
|
111
|
-
- 0.2.9
|
112
|
-
|
113
|
-
- 09-01-2020
|
104
|
+
- 0.2.9 - 09-01-2020
|
114
105
|
|
115
106
|
- FIX: correct segfault when JS returns a Symbol and properly cast to ruby symbol
|
116
107
|
|
117
|
-
- 0.2.8
|
108
|
+
- 0.2.8 - 11-11-2019
|
118
109
|
|
119
|
-
- 11-11-2019
|
120
110
|
|
121
111
|
- FIX: ensure thread live cycle is properly accounter for following file descriptor fix
|
122
112
|
|
123
|
-
- 0.2.7
|
124
|
-
|
125
|
-
- 11-11-2019
|
113
|
+
- 0.2.7 - 11-11-2019
|
126
114
|
|
127
115
|
- FIX: release the file descriptor for timeout pipe earlier (this avoids holding too many files open in Ruby 2.7)
|
128
116
|
|
129
|
-
- 14-05-2019
|
130
|
-
|
131
|
-
- 0.2.6
|
117
|
+
- 0.2.6 - 14-05-2019
|
132
118
|
|
133
119
|
- FEATURE: add support for write_heap_snapshot which helps you analyze memory
|
134
120
|
|
135
|
-
- 25-04-2019
|
136
|
-
|
137
|
-
- 0.2.5
|
121
|
+
- 0.2.5 - 25-04-2019
|
138
122
|
|
139
123
|
- FIX: Compatibility fixes for V8 7 and above @ignisf
|
140
124
|
- FIX: Memory leak in gc_callback @messense
|
141
125
|
- IMPROVEMENT: Added example of sourcemap support @ianks
|
142
126
|
- URGENT: you will need this release for latest version of libv8 to work
|
143
127
|
|
144
|
-
- 02-11-2018
|
145
|
-
|
146
|
-
- 0.2.4
|
128
|
+
- 0.2.4 - 02-11-2018
|
147
129
|
|
148
130
|
- FIX: deadlock releasing context when shared isolates are used
|
149
131
|
- FEATURE: include js backtrace when snapshots do not compile
|
150
132
|
|
151
|
-
- 28-09-2018
|
152
|
-
|
153
|
-
- 0.2.3
|
133
|
+
- 0.2.3 - 28-09-2018
|
154
134
|
|
155
135
|
- Drop all conditional logic from Mini Racer compilation for clang, always
|
156
136
|
rely on MacOS being High Sierra or up
|
157
137
|
|
158
|
-
- 26-09-2018
|
159
|
-
|
160
|
-
- 0.2.2
|
138
|
+
- 0.2.2 - 26-09-2018
|
161
139
|
|
162
140
|
- WORKAROUND: RUBY_PLATFORM is hardcoded on Ruby compile and can not be
|
163
141
|
trusted for feature detection, use a different technique when checking for
|
164
142
|
macOS Mojave
|
165
143
|
|
166
|
-
- 25-09-2018
|
167
|
-
|
168
|
-
- 0.2.1
|
144
|
+
- 0.2.1 - 25-09-2018
|
169
145
|
|
170
146
|
- FEATURE: Mojave macOS support
|
171
147
|
|
172
|
-
- 06-07-2018
|
148
|
+
- 0.2.0 - 06-07-2018
|
173
149
|
|
174
|
-
- 0.2.0
|
175
150
|
- FEATURE: context#call to allow for cheaper invocation of functions
|
176
151
|
- FIX: rare memory leak when terminating a long running attached function
|
177
152
|
- FIX: rare segfault when terminating a long running attached function
|
@@ -179,105 +154,80 @@
|
|
179
154
|
- Account for changes in the upstream V8 API @ignisf
|
180
155
|
- Support for libv8 6.7
|
181
156
|
|
182
|
-
23-08-2017
|
183
|
-
|
184
|
-
- 0.1.15
|
157
|
+
- 0.1.15 - 23-08-2017
|
185
158
|
|
186
159
|
- bump dependency of libv8 to 6.3
|
187
160
|
|
188
|
-
23-08-2017
|
189
|
-
|
190
|
-
- 0.1.14
|
161
|
+
- 0.1.14 - 23-08-2017
|
191
162
|
|
192
163
|
- libv8 erroneously bumped to beta, reverted change
|
193
164
|
|
194
|
-
23-08-2017
|
195
|
-
|
196
|
-
- 0.1.13
|
165
|
+
- 0.1.13 - 23-08-2017
|
197
166
|
|
198
167
|
- Fix: amend array buffer allocator to use v8 6.0 compatible allocator @ignisf
|
199
168
|
|
200
|
-
18-07-2017
|
201
|
-
|
202
|
-
- 0.1.12
|
169
|
+
- 0.1.12 - 18-07-2017
|
203
170
|
|
204
171
|
- Feature: upgrade libv8 to 5.9
|
205
172
|
- Fix: warning when running with ruby warnings enabled (missed @disposed initialize)
|
206
173
|
|
207
|
-
18-07-2017
|
208
|
-
|
209
|
-
- 0.1.11
|
174
|
+
- 0.1.11 - 18-07-2017
|
210
175
|
|
211
176
|
- Feature: upgrade libv8 to 5.7
|
212
177
|
|
213
|
-
13-07-2017
|
214
178
|
|
215
|
-
- 0.1.10
|
179
|
+
- 0.1.10 - 13-07-2017
|
216
180
|
|
217
181
|
- Fix leak: memory leak when disposing a context (20 bytes per context)
|
218
182
|
- Feature: added #heap_stats so you can get visibility from context to actual memory usage of isolate
|
219
183
|
- Feature: added #dispose so you reclaim all v8 memory right away as opposed to waiting for GC
|
220
184
|
- Feature: you can now specify filename in an eval eg: eval('a = 1', filename: 'my_awesome.js')
|
221
185
|
|
222
|
-
09-03-2017
|
223
186
|
|
224
|
-
- 0.1.9
|
187
|
+
- 0.1.9 - 09-03-2017
|
225
188
|
|
226
189
|
- Perf: speed up ruby/node boundary performance when moving large objects
|
227
190
|
|
228
|
-
06-02-2017
|
229
|
-
|
230
|
-
- 0.1.8
|
191
|
+
- 0.1.8 - 06-02-2017
|
231
192
|
|
232
193
|
- Fix: Include math.h to fix use of undeclared identifier floor with rbx. See #51
|
233
194
|
|
234
|
-
02-11-2016
|
235
|
-
|
236
|
-
- 0.1.7
|
195
|
+
- 0.1.7 - 02-11-2016
|
237
196
|
|
238
197
|
- Fix: if for some reason an isolate was forked don't free it and raise a warning instead to avoid hanging process
|
239
198
|
|
240
|
-
25-10-2016
|
241
|
-
|
242
|
-
- 0.1.6
|
199
|
+
- 0.1.6 - 25-10-2016
|
243
200
|
|
244
201
|
- Fix: timeout behavior was incorrect, in some cases stop could be called on already stopped contexts
|
245
202
|
|
246
|
-
10-10-2016
|
247
|
-
|
248
|
-
- 0.1.5
|
203
|
+
- 0.1.5 - 10-10-2016
|
249
204
|
|
250
205
|
- Support for snapshots, shared isolates, runtime flags thanks to @wk8
|
251
206
|
- Fix timeout behavior when it occurs in an attached Ruby method
|
252
207
|
|
253
|
-
19-05-2016
|
254
|
-
|
255
|
-
- 0.1.4
|
208
|
+
- 0.1.4 - 19-05-2016
|
256
209
|
|
257
210
|
- Set upper bound for libv8 inclusion @ignisf
|
258
211
|
- Support conversion of Date, Time and DateTime from Ruby to JS @seanmakesgames
|
259
212
|
- Support conversion of large numbers back from Ruby to JS @seanmakesgames
|
260
213
|
|
261
|
-
- 0.1.3
|
214
|
+
- 0.1.3 - 17-05-2016
|
262
215
|
|
263
216
|
- Support more conversions from Ruby back to JS (Hash, Symbol, Array)
|
264
217
|
- Support attaching nested objects
|
265
218
|
|
266
|
-
17-05-2016
|
267
219
|
|
268
|
-
- 0.1.2
|
220
|
+
- 0.1.2 - 17-05-2016
|
269
221
|
|
270
222
|
- Gemspec specifies minimal version of Ruby (2.0)
|
271
223
|
- Implement #load on Context to load files
|
272
224
|
|
273
|
-
17-05-2016
|
274
225
|
|
275
226
|
- 0.1.1
|
276
227
|
|
277
228
|
- Added unblock function so SIGINT does not lead to a crash
|
278
229
|
|
279
|
-
14-05-2016
|
280
230
|
|
281
|
-
- 0.1.1.beta.1
|
231
|
+
- 0.1.1.beta.1 - 14-05-2016
|
282
232
|
|
283
233
|
- 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))
|
@@ -72,8 +72,7 @@ module MiniRacer
|
|
72
72
|
|
73
73
|
unless Polyglot.languages.include? "js"
|
74
74
|
raise "The language 'js' is not available, you likely need to `export TRUFFLERUBYOPT='--jvm --polyglot'`\n" \
|
75
|
-
"You also need to install the 'js' component
|
76
|
-
"Note that you need TruffleRuby+GraalVM and not just the TruffleRuby standalone to use MiniRacer"
|
75
|
+
"You also need to install the 'js' component, see https://github.com/oracle/truffleruby/blob/master/doc/user/polyglot.md#installing-other-languages"
|
77
76
|
end
|
78
77
|
|
79
78
|
@context = Polyglot::InnerContext.new(on_cancelled: -> {
|
data/lib/mini_racer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_racer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 18.19.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.19.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,14 @@ files:
|
|
122
114
|
- lib/mini_racer.rb
|
123
115
|
- lib/mini_racer/truffleruby.rb
|
124
116
|
- lib/mini_racer/version.rb
|
125
|
-
- mini_racer.gemspec
|
126
117
|
homepage: https://github.com/discourse/mini_racer
|
127
118
|
licenses:
|
128
119
|
- MIT
|
129
120
|
metadata:
|
130
121
|
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.
|
122
|
+
changelog_uri: https://github.com/discourse/mini_racer/blob/v0.9.0/CHANGELOG
|
123
|
+
documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.9.0
|
124
|
+
source_code_uri: https://github.com/discourse/mini_racer/tree/v0.9.0
|
134
125
|
post_install_message:
|
135
126
|
rdoc_options: []
|
136
127
|
require_paths:
|
@@ -147,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
138
|
- !ruby/object:Gem::Version
|
148
139
|
version: '0'
|
149
140
|
requirements: []
|
150
|
-
rubygems_version: 3.4
|
141
|
+
rubygems_version: 3.5.4
|
151
142
|
signing_key:
|
152
143
|
specification_version: 4
|
153
144
|
summary: Minimal embedded v8 for Ruby
|
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
|