mini_racer 0.1.0 → 0.5.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 +5 -5
- data/.dockerignore +12 -0
- data/.github/workflows/ci.yml +78 -0
- data/.gitignore +2 -0
- data/.travis.yml +18 -11
- data/CHANGELOG +230 -2
- data/Dockerfile +21 -0
- data/LICENSE.txt +1 -1
- data/README.md +325 -23
- data/Rakefile +42 -0
- data/ext/mini_racer_extension/extconf.rb +47 -8
- data/ext/mini_racer_extension/mini_racer_extension.cc +1631 -264
- data/ext/mini_racer_loader/extconf.rb +8 -0
- data/ext/mini_racer_loader/mini_racer_loader.c +123 -0
- data/lib/mini_racer/version.rb +4 -1
- data/lib/mini_racer.rb +385 -16
- data/mini_racer.gemspec +14 -8
- metadata +42 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f868c575c8ed41f4080580b2d09d0d42522d337390f425b3110e38298952a6f4
|
4
|
+
data.tar.gz: 9c2df1f0171dd3ed4bba7a59faa3ea7d87a1976087395da3ec56966aeedd23d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c51ea3a8f4abc4ae458090ce2f37760110ac240f7600e3fd249f07df97725e0b7903884fb90063b3d3140c0337eeae132a6e395b1f74777c85dfddc03b6ad96
|
7
|
+
data.tar.gz: '0948c498cdb9a0767dbe0de9d4b233d2561eb6b72f6603170c3f4d9304083487a03fc395f8803f1d1690ef6f9d06e0faddc86ef694b950c0e95ea4047943c96e'
|
data/.dockerignore
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
name: Test
|
2
|
+
on:
|
3
|
+
- push
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test-darwin:
|
7
|
+
strategy:
|
8
|
+
fail-fast: false
|
9
|
+
matrix:
|
10
|
+
os:
|
11
|
+
- '10.15'
|
12
|
+
- '11.0'
|
13
|
+
platform:
|
14
|
+
- x86_64
|
15
|
+
# arm64
|
16
|
+
name: Test (darwin)
|
17
|
+
runs-on: macos-${{ matrix.os }}
|
18
|
+
steps:
|
19
|
+
- name: Checkout
|
20
|
+
uses: actions/checkout@v2
|
21
|
+
- name: Bundle
|
22
|
+
run: bundle install
|
23
|
+
- name: Compile
|
24
|
+
run: bundle exec rake compile
|
25
|
+
- name: Test
|
26
|
+
run: bundle exec rake test
|
27
|
+
test-linux:
|
28
|
+
strategy:
|
29
|
+
fail-fast: false
|
30
|
+
matrix:
|
31
|
+
ruby:
|
32
|
+
- '2.6'
|
33
|
+
- '2.7'
|
34
|
+
- '3.0'
|
35
|
+
platform:
|
36
|
+
- amd64
|
37
|
+
- arm64
|
38
|
+
# arm
|
39
|
+
# ppc64le
|
40
|
+
# s390x
|
41
|
+
libc:
|
42
|
+
- gnu
|
43
|
+
- musl
|
44
|
+
name: Test (linux)
|
45
|
+
runs-on: ubuntu-20.04
|
46
|
+
steps:
|
47
|
+
- name: Enable ${{ matrix.platform }} platform
|
48
|
+
id: qemu
|
49
|
+
if: ${{ matrix.platform != 'amd64' }}
|
50
|
+
run: |
|
51
|
+
docker run --privileged --rm tonistiigi/binfmt:latest --install ${{ matrix.platform }} | tee platforms.json
|
52
|
+
echo "::set-output name=platforms::$(cat platforms.json)"
|
53
|
+
- name: Start container
|
54
|
+
id: container
|
55
|
+
run: |
|
56
|
+
case ${{ matrix.libc }} in
|
57
|
+
gnu)
|
58
|
+
echo 'ruby:${{ matrix.ruby }}'
|
59
|
+
;;
|
60
|
+
musl)
|
61
|
+
echo 'ruby:${{ matrix.ruby }}-alpine'
|
62
|
+
;;
|
63
|
+
esac > container_image
|
64
|
+
echo "::set-output name=image::$(cat container_image)"
|
65
|
+
docker run --rm -d -v "${PWD}":"${PWD}" -w "${PWD}" --platform linux/${{ matrix.platform }} $(cat container_image) /bin/sleep 64d | tee container_id
|
66
|
+
docker exec -w "${PWD}" $(cat container_id) uname -a
|
67
|
+
echo "::set-output name=id::$(cat container_id)"
|
68
|
+
- name: Install Alpine system dependencies
|
69
|
+
if: ${{ matrix.libc == 'musl' }}
|
70
|
+
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} apk add --no-cache build-base linux-headers bash python2 python3 git curl tar clang binutils-gold
|
71
|
+
- name: Checkout
|
72
|
+
uses: actions/checkout@v2
|
73
|
+
- name: Bundle
|
74
|
+
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle install
|
75
|
+
- name: Compile
|
76
|
+
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle exec rake compile
|
77
|
+
- name: Test
|
78
|
+
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle exec rake test
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,16 +1,23 @@
|
|
1
1
|
language: ruby
|
2
|
+
os: linux
|
2
3
|
rvm:
|
3
|
-
- 2.
|
4
|
-
- 2.
|
5
|
-
-
|
6
|
-
-
|
7
|
-
|
4
|
+
- 2.6
|
5
|
+
- 2.7
|
6
|
+
- 3.0
|
7
|
+
- ruby-head
|
8
|
+
arch:
|
9
|
+
- amd64
|
10
|
+
- arm64
|
11
|
+
jobs:
|
8
12
|
include:
|
9
|
-
- rvm: 2.
|
13
|
+
- rvm: 2.6
|
10
14
|
os: osx
|
11
|
-
osx_image:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
15
|
+
osx_image: xcode11.3
|
16
|
+
- rvm: 2.6
|
17
|
+
os: osx
|
18
|
+
osx_image: xcode12.2
|
19
|
+
- rvm: 2.7
|
20
|
+
os: osx
|
21
|
+
osx_image: xcode12.2
|
22
|
+
dist: xenial
|
16
23
|
cache: bundler
|
data/CHANGELOG
CHANGED
@@ -1,11 +1,239 @@
|
|
1
|
+
- 11-04-2021
|
2
|
+
|
3
|
+
- 0.4.0
|
4
|
+
|
5
|
+
- FEATURE: upgrade to libv8 node 15.14.0 (v8 8.6.395.17)
|
6
|
+
- Promote 0.4.0.beta1 to release, using libv8-node release path
|
7
|
+
|
8
|
+
- 08-04-2021
|
9
|
+
|
10
|
+
- 0.4.0.beta1
|
11
|
+
|
12
|
+
- FIX: on downgrade mkmf was picking the wrong version of libv8, this fix will correct future issues
|
13
|
+
- FEATURE: upgraded libv8 to use node libv8 build which supports M1 and various ARM builds v8 moved to (8.6.395.17)
|
14
|
+
|
15
|
+
- 23-07-2020
|
16
|
+
|
17
|
+
- 0.3.1
|
18
|
+
|
19
|
+
- FIX: specify that libv8 must be larger than 8.4.255 but smaller than 8.5, this avoids issues going forward
|
20
|
+
|
21
|
+
- 22-07-2020
|
22
|
+
|
23
|
+
- 0.3.0
|
24
|
+
|
25
|
+
- FEATURE: upgraded to libv8 version 8.4.255.0
|
26
|
+
|
27
|
+
- 29-06-2020
|
28
|
+
|
29
|
+
- 0.2.15
|
30
|
+
|
31
|
+
- FEATURE: basic wasm support via pump_message_loop
|
32
|
+
|
33
|
+
- 15-05-2020
|
34
|
+
|
35
|
+
- 0.2.14
|
36
|
+
|
37
|
+
- FIX: ensure_gc_after_idle should take in milliseconds like the rest of the APIs not seconds
|
38
|
+
- FEATURE: strict params on MiniRacer::Context.new
|
39
|
+
|
40
|
+
- 15-05-2020
|
41
|
+
|
42
|
+
- 0.2.13
|
43
|
+
|
44
|
+
- FIX: edge case around ensure_gc_after_idle possibly firing when context is not idle
|
45
|
+
|
46
|
+
- 15-05-2020
|
47
|
+
|
48
|
+
- 0.2.12
|
49
|
+
|
50
|
+
- FEATURE: isolate.low_memory_notification which can force a full GC
|
51
|
+
- 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
|
52
|
+
|
53
|
+
- 14-05-2020
|
54
|
+
|
55
|
+
- 0.2.11
|
56
|
+
|
57
|
+
- FIX: dumping heap snapshots was not flushing the file leading to corrupt snapshots
|
58
|
+
- FIX: a use-after-free shutdown crash
|
59
|
+
|
60
|
+
- 0.2.10
|
61
|
+
|
62
|
+
- 22-04-2020
|
63
|
+
|
64
|
+
- FEATURE: memory softlimit support for nogvl_context_call
|
65
|
+
|
66
|
+
- 0.2.9
|
67
|
+
|
68
|
+
- 09-01-2020
|
69
|
+
|
70
|
+
- FIX: correct segfault when JS returns a Symbol and properly cast to ruby symbol
|
71
|
+
|
72
|
+
- 0.2.8
|
73
|
+
|
74
|
+
- 11-11-2019
|
75
|
+
|
76
|
+
- FIX: ensure thread live cycle is properly accounter for following file descriptor fix
|
77
|
+
|
78
|
+
- 0.2.7
|
79
|
+
|
80
|
+
- 11-11-2019
|
81
|
+
|
82
|
+
- FIX: release the file descriptor for timeout pipe earlier (this avoids holding too many files open in Ruby 2.7)
|
83
|
+
|
84
|
+
- 14-05-2019
|
85
|
+
|
86
|
+
- 0.2.6
|
87
|
+
|
88
|
+
- FEATURE: add support for write_heap_snapshot which helps you analyze memory
|
89
|
+
|
90
|
+
- 25-04-2019
|
91
|
+
|
92
|
+
- 0.2.5
|
93
|
+
|
94
|
+
- FIX: Compatiblity fixes for V8 7 and above @ignisf
|
95
|
+
- FIX: Memory leak in gc_callback @messense
|
96
|
+
- IMPROVEMENT: Added example of sourcemap support @ianks
|
97
|
+
- URGENT: you will need this release for latest version of libv8 to work
|
98
|
+
|
99
|
+
- 02-11-2018
|
100
|
+
|
101
|
+
- 0.2.4
|
102
|
+
|
103
|
+
- FIX: deadlock releasing context when shared isolates are used
|
104
|
+
- FEATURE: include js backtrace when snapshots do not compile
|
105
|
+
|
106
|
+
- 28-09-2018
|
107
|
+
|
108
|
+
- 0.2.3
|
109
|
+
|
110
|
+
- Drop all conditional logic from Mini Racer compilation for clang, always
|
111
|
+
rely on MacOS being High Sierra or up
|
112
|
+
|
113
|
+
- 26-09-2018
|
114
|
+
|
115
|
+
- 0.2.2
|
116
|
+
|
117
|
+
- WORKAROUND: RUBY_PLATFORM is hardcoded on Ruby compile and can not be
|
118
|
+
trusted for feature detection, use a different technique when checking for
|
119
|
+
macOS Mojave
|
120
|
+
|
121
|
+
- 25-09-2018
|
122
|
+
|
123
|
+
- 0.2.1
|
124
|
+
|
125
|
+
- FEATURE: Mojave macOS support
|
126
|
+
|
127
|
+
- 06-07-2018
|
128
|
+
|
129
|
+
- 0.2.0
|
130
|
+
- FEATURE: context#call to allow for cheaper invocation of functions
|
131
|
+
- FIX: rare memory leak when terminating a long running attached function
|
132
|
+
- FIX: rare segfault when terminating a long running attached function
|
133
|
+
- FIX: Reimplement Isolate#idle_notification using idle_notification_deadline, API remains the same @ignisf
|
134
|
+
- Account for changes in the upstream V8 API @ignisf
|
135
|
+
- Support for libv8 6.7
|
136
|
+
|
137
|
+
23-08-2017
|
138
|
+
|
139
|
+
- 0.1.15
|
140
|
+
|
141
|
+
- bump dependency of libv8 to 6.3
|
142
|
+
|
143
|
+
23-08-2017
|
144
|
+
|
145
|
+
- 0.1.14
|
146
|
+
|
147
|
+
- libv8 erronuously bumped to beta, reverted change
|
148
|
+
|
149
|
+
23-08-2017
|
150
|
+
|
151
|
+
- 0.1.13
|
152
|
+
|
153
|
+
- Fix: amend array buffer allocator to use v8 6.0 compatible allocator @ignisf
|
154
|
+
|
155
|
+
18-07-2017
|
156
|
+
|
157
|
+
- 0.1.12
|
158
|
+
|
159
|
+
- Feature: upgrade libv8 to 5.9
|
160
|
+
- Fix: warning when runnin with ruby warnings enabled (missed @disposed initialize)
|
161
|
+
|
162
|
+
18-07-2017
|
163
|
+
|
164
|
+
- 0.1.11
|
165
|
+
|
166
|
+
- Feature: upgrade libv8 to 5.7
|
167
|
+
|
168
|
+
13-07-2017
|
169
|
+
|
170
|
+
- 0.1.10
|
171
|
+
|
172
|
+
- Fix leak: memory leak when disposing a context (20 bytes per context)
|
173
|
+
- Feature: added #heap_stats so you can get visibility from context to actual memory usage of isolate
|
174
|
+
- Feature: added #dispose so you reclaim all v8 memory right away as opposed to waiting for GC
|
175
|
+
- Feature: you can now specify filename in an eval eg: eval('a = 1', filename: 'my_awesome.js')
|
176
|
+
|
177
|
+
09-03-2017
|
178
|
+
|
179
|
+
- 0.1.9
|
180
|
+
|
181
|
+
- Perf: speed up ruby/node boundary performance when moving large objects
|
182
|
+
|
183
|
+
06-02-2017
|
184
|
+
|
185
|
+
- 0.1.8
|
186
|
+
|
187
|
+
- Fix: Include math.h to fix use of undeclared identifier floor with rbx. See #51
|
188
|
+
|
189
|
+
02-11-2016
|
190
|
+
|
191
|
+
- 0.1.7
|
192
|
+
|
193
|
+
- Fix: if for some reason an isolate was forked don't free it and raise a warning instead to avoid hanging process
|
194
|
+
|
195
|
+
25-10-2016
|
196
|
+
|
197
|
+
- 0.1.6
|
198
|
+
|
199
|
+
- Fix: timeout behavior was incorrect, in some cases stop could be called on already stopped contexts
|
200
|
+
|
201
|
+
10-10-2016
|
202
|
+
|
203
|
+
- 0.1.5
|
204
|
+
|
205
|
+
- Support for snapshots, shared isolates, runtime flags thanks to @wk8
|
206
|
+
- Fix timeout behavior when it occurs in an attached Ruby method
|
207
|
+
|
208
|
+
19-05-2016
|
209
|
+
|
210
|
+
- 0.1.4
|
211
|
+
|
212
|
+
- Set upper bound for libv8 inclusion @ignisf
|
213
|
+
- Support conversion of Date, Time and DateTime from Ruby to JS @seanmakesgames
|
214
|
+
- Support conversion of large numbers back from Ruby to JS @seanmakesgames
|
215
|
+
|
216
|
+
- 0.1.3
|
217
|
+
|
218
|
+
- Support more conversions from Ruby back to JS (Hash, Symbol, Array)
|
219
|
+
- Support attaching nested objects
|
220
|
+
|
221
|
+
|
222
|
+
17-05-2016
|
223
|
+
|
224
|
+
- 0.1.2
|
225
|
+
|
226
|
+
- Gemspec specifies minimal version of Ruby (2.0)
|
227
|
+
- Implement #load on Context to load files
|
228
|
+
|
1
229
|
17-05-2016
|
2
230
|
|
3
|
-
- 0.
|
231
|
+
- 0.1.1
|
4
232
|
|
5
233
|
- Added unblock function so SIGINT does not lead to a crash
|
6
234
|
|
7
235
|
14-05-2016
|
8
236
|
|
9
|
-
- 0.
|
237
|
+
- 0.1.1.beta.1
|
10
238
|
|
11
239
|
- First release
|
data/Dockerfile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
ARG RUBY_VERSION=2.7
|
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/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2016
|
3
|
+
Copyright (c) 2016-2019, the mini_racer project authors.
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|