sq_mini_racer 0.3.1.0.2 → 0.3.1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e68f36f6b57f07077c1f7914e2e902c6e824ee2de5d00008a5f5df50acee72b7
4
- data.tar.gz: f7cf237de4ca9714d8588d3d8fc88afdc3a5eaf561b5ba96e78f7f2acfd10e3f
3
+ metadata.gz: 6b2a41e728b0e6df27793c497d38dd6ede2431b8667b7efc50e8e686e175f329
4
+ data.tar.gz: 01dafad126f4119f4e2de4aaa48f9e1e5fa2e335b976c5ff41aa3ce74d6b9ba2
5
5
  SHA512:
6
- metadata.gz: 63227b1b45f9d20020553c96b3dda2e8e5d679ad92720131e7f5feea1055a08093270c1f8eef8cd6e1b0860fb2bdb17e004aac33c5a1000cdc0f3bbca0b66563
7
- data.tar.gz: ec0c9d009c94031a1a1dd3857bede44239fe657ea4999a167ee75e2f57873107870d7c8db77721ef088cc7fe6c9b8e88aacca3c32a127aafc692e886b4c86155
6
+ metadata.gz: eea5ddc65e27bb6cc9cdbdf36fcc43b4b0507807c312af8016a4a7cd4aef55fd60dc7d6c1c8bbbd600a20140c172878526ad541701523d974ee49989d5dbcafa
7
+ data.tar.gz: d23467f72730c1b9e3f6d10655647368ee40535253024bcc2fff91b45c3c9a7451a585f641e0bfb5a74b231f3b5367216dbeac8b4e11d2c3c767e09e34d9ca0b
@@ -8,6 +8,7 @@ require 'rubygems/package'
8
8
 
9
9
  IS_SOLARIS = RUBY_PLATFORM =~ /solaris/
10
10
  IS_LINUX_MUSL = RUBY_PLATFORM =~ /linux-musl/
11
+ IS_INTEL = RUBY_PLATFORM =~ /x86_64/
11
12
 
12
13
  def cppflags_clear_std!
13
14
  $CPPFLAGS.gsub! /-std=[^\s]+/, ''
@@ -22,7 +23,7 @@ def cppflags_add_cpu_extension!
22
23
  $CPPFLAGS += " -mavx2"
23
24
  else
24
25
  $CPPFLAGS += " -mssse3"
25
- end
26
+ end if IS_INTEL
26
27
  end
27
28
 
28
29
  def libv8_gem_name
@@ -30,7 +31,7 @@ def libv8_gem_name
30
31
  end
31
32
 
32
33
  def libv8_requirement
33
- '~> 14.14.0.0.beta1'
34
+ '~> 15.5.1.0.beta1'
34
35
  end
35
36
 
36
37
  def libv8_basename(version)
@@ -212,8 +213,9 @@ cppflags_add_cpu_extension!
212
213
  $CPPFLAGS += " -Wno-reserved-user-defined-literal" if IS_DARWIN
213
214
 
214
215
  $LDFLAGS.insert(0, " -stdlib=libc++ ") if IS_DARWIN
215
- $LDFLAGS += " -Wl,--no-undefined " unless IS_DARWIN
216
- $LDFLAGS += " -Wl,-undefined,error " if IS_DARWIN
216
+ # causes problems on some systems
217
+ # $LDFLAGS += " -Wl,--no-undefined " unless IS_DARWIN
218
+ # $LDFLAGS += " -Wl,-undefined,error " if IS_DARWIN
217
219
 
218
220
  if ENV['CXX']
219
221
  puts "SETTING CXX"
@@ -34,7 +34,9 @@
34
34
  #include <atomic>
35
35
  #include <math.h>
36
36
  #include "compat.hpp"
37
+ #ifdef __x86_64__
37
38
  #include "simdutf8check.h"
39
+ #endif
38
40
 
39
41
  #include <time.h>
40
42
 
@@ -564,11 +566,13 @@ static inline Local<Value> convert_ruby_str_to_v8(
564
566
  static const rb_encoding *usascii_enc = rb_usascii_encoding();
565
567
  static const rb_encoding *latin1_enc = rb_enc_find("ISO-8859-1");
566
568
  assert(latin1_enc != nullptr);
569
+ #ifdef __x86_64__
567
570
  #ifndef __AVX2__
568
571
  # define validate_utf8 validate_utf8_fast
569
572
  #else
570
573
  static const (*validate_utf8)(const char *, size_t) =
571
574
  best_utf8_validate_func();
575
+ #endif
572
576
  #endif
573
577
 
574
578
  rb_encoding *enc = rb_enc_get(value);
@@ -577,8 +581,12 @@ static inline Local<Value> convert_ruby_str_to_v8(
577
581
  if (len < 0 || len > INT_MAX) {
578
582
  return Null(isolate);
579
583
  }
584
+ #ifdef __x86_64__
580
585
  bool is_valid_utf8 = enc == utf8_enc &&
581
586
  validate_utf8(str, static_cast<size_t>(len));
587
+ #else
588
+ bool is_valid_utf8 = false;
589
+ #endif
582
590
 
583
591
  MaybeLocal<String> v8str;
584
592
  int int_len = static_cast<int>(len);
@@ -641,7 +649,11 @@ static Local<Value> convert_ruby_to_v8(Isolate* isolate, Local<Context> context,
641
649
  case T_FLOAT:
642
650
  return scope.Escape(Number::New(isolate, NUM2DBL(value)));
643
651
  case T_STRING:
644
- return scope.Escape(convert_ruby_str_to_v8(scope, isolate, value));
652
+ //#ifndef __x86_64__
653
+ // return scope.Escape(String::NewFromUtf8(isolate, RSTRING_PTR(value), NewStringType::kNormal, (int)RSTRING_LEN(value)).ToLocalChecked());
654
+ //#else
655
+ return scope.Escape(convert_ruby_str_to_v8(scope, isolate, value));
656
+ //#endif
645
657
  case T_NIL:
646
658
  return scope.Escape(Null(isolate));
647
659
  case T_TRUE:
@@ -672,7 +684,11 @@ static Local<Value> convert_ruby_to_v8(Isolate* isolate, Local<Context> context,
672
684
  case T_SYMBOL:
673
685
  {
674
686
  value = rb_funcall(value, rb_intern("to_s"), 0);
675
- return scope.Escape(convert_ruby_str_to_v8(scope, isolate, value));
687
+ //#ifndef __x86_64__
688
+ // return scope.Escape(String::NewFromUtf8(isolate, RSTRING_PTR(value), NewStringType::kNormal, (int)RSTRING_LEN(value)).ToLocalChecked());
689
+ //#else
690
+ return scope.Escape(convert_ruby_str_to_v8(scope, isolate, value));
691
+ //#endif
676
692
  }
677
693
  case T_DATA:
678
694
  {
@@ -704,7 +720,11 @@ static Local<Value> convert_ruby_to_v8(Isolate* isolate, Local<Context> context,
704
720
  if (rb_respond_to(value, rb_intern("to_s"))) {
705
721
  // TODO: if this throws we're screwed
706
722
  value = rb_funcall(value, rb_intern("to_s"), 0);
723
+ //#ifndef __x86_64__
724
+ // return scope.Escape(String::NewFromUtf8(isolate, RSTRING_PTR(value), NewStringType::kNormal, (int)RSTRING_LEN(value)).ToLocalChecked());
725
+ //#else
707
726
  return scope.Escape(convert_ruby_str_to_v8(scope, isolate, value));
727
+ //#endif
708
728
  }
709
729
  return scope.Escape(
710
730
  String::NewFromUtf8Literal(isolate, "Undefined Conversion"));
@@ -2,6 +2,6 @@ module Sqreen
2
2
  module MiniRacer
3
3
  # first three numbers is the upstream version
4
4
  # that we last merged with
5
- VERSION = "0.3.1.0.2"
5
+ VERSION = "0.3.1.0.6"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sq_mini_racer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1.0.2
4
+ version: 0.3.1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-16 00:00:00.000000000 Z
11
+ date: 1980-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -118,8 +118,6 @@ files:
118
118
  - LICENSE.txt
119
119
  - README.md
120
120
  - Rakefile
121
- - azure-pipelines.yml
122
- - azure-template.yml
123
121
  - bin/console
124
122
  - bin/setup
125
123
  - ext/mini_racer_extension/compat.hpp
@@ -138,9 +136,9 @@ licenses:
138
136
  - MIT
139
137
  metadata:
140
138
  bug_tracker_uri: https://github.com/discourse/mini_racer/issues
141
- changelog_uri: https://github.com/discourse/mini_racer/blob/v0.3.1.0.2/CHANGELOG
142
- documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.3.1.0.2
143
- source_code_uri: https://github.com/discourse/mini_racer/tree/v0.3.1.0.2
139
+ changelog_uri: https://github.com/discourse/mini_racer/blob/v0.3.1.0.6/CHANGELOG
140
+ documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.3.1.0.6
141
+ source_code_uri: https://github.com/discourse/mini_racer/tree/v0.3.1.0.6
144
142
  post_install_message:
145
143
  rdoc_options: []
146
144
  require_paths:
@@ -157,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
155
  - !ruby/object:Gem::Version
158
156
  version: '0'
159
157
  requirements: []
160
- rubygems_version: 3.1.3
158
+ rubygems_version: 3.2.16
161
159
  signing_key:
162
160
  specification_version: 4
163
161
  summary: Minimal embedded v8 for Ruby
data/azure-pipelines.yml DELETED
@@ -1,69 +0,0 @@
1
- jobs:
2
- - template: azure-template.yml
3
- parameters:
4
- name: linux_2_0
5
- displayName: Linux Ruby 2.0
6
- rubyVersion: '2.0'
7
- publishCoverage: true
8
-
9
- - template: azure-template.yml
10
- parameters:
11
- name: linux_2_1
12
- displayName: Linux Ruby 2.1
13
- rubyVersion: '2.1'
14
-
15
- - template: azure-template.yml
16
- parameters:
17
- name: linux_2_2
18
- displayName: Linux Ruby 2.2
19
- rubyVersion: '2.2'
20
-
21
- - template: azure-template.yml
22
- parameters:
23
- name: linux_2_3
24
- displayName: Linux Ruby 2.3
25
- rubyVersion: '2.3'
26
-
27
- - template: azure-template.yml
28
- parameters:
29
- name: linux_2_4
30
- displayName: Linux Ruby 2.4
31
- rubyVersion: '2.4'
32
-
33
- - template: azure-template.yml
34
- parameters:
35
- name: linux_2_5
36
- displayName: Linux Ruby 2.5
37
- rubyVersion: '2.5'
38
-
39
- - template: azure-template.yml
40
- parameters:
41
- name: linux_2_6
42
- displayName: Linux Ruby 2.6
43
- rubyVersion: '2.6'
44
-
45
- - template: azure-template.yml
46
- parameters:
47
- name: linux_2_7
48
- displayName: Linux Ruby 2.7
49
- rubyVersion: '2.7'
50
-
51
- - template: azure-template.yml
52
- parameters:
53
- name: linux_2_7_mini_racer
54
- displayName: Linux Ruby 2.7 (with mini_racer)
55
- rubyVersion: '2.7'
56
- with_mini_racer: true
57
-
58
- - template: azure-template.yml
59
- parameters:
60
- name: linux_2_7_therubyracer
61
- displayName: Linux Ruby 2.7 (with therubyracer)
62
- rubyVersion: '2.7'
63
- with_therubyracer: true
64
-
65
- - template: azure-template.yml
66
- parameters:
67
- name: macos_10_15
68
- displayName: MacOS 10.15
69
- imageName: 'macos-10.15'
data/azure-template.yml DELETED
@@ -1,101 +0,0 @@
1
- parameters:
2
- name: ~
3
- displayName: ~
4
- rubyVersion: bundled
5
- imageName: ubuntu-18.04
6
- publishCoverage: false
7
- with_mini_racer: false
8
- with_therubyracer: false
9
-
10
- jobs:
11
- - job: ${{ parameters.name }}
12
- displayName: ${{ parameters.displayName }}
13
- pool:
14
- vmImage: ${{ parameters.imageName }}
15
-
16
- variables:
17
- TESTOPTS: -v
18
- ${{ if eq(parameters.publishCoverage, true) }}:
19
- CPPFLAGS: --coverage
20
- LDFLAGS: --coverage
21
- ${{ if eq(parameters.rubyVersion, 'bundled') }}:
22
- gem: gem
23
- bundle: bundle
24
- ${{ if ne(parameters.rubyVersion, 'bundled') }}:
25
- gem: /opt/ruby/${{ parameters.rubyVersion }}/bin/gem
26
- bundle: /opt/ruby/${{ parameters.rubyVersion }}/bin/bundle
27
- GEM_HOME: /opt/ruby/${{ parameters.rubyVersion }}/lib/ruby/gems/${{ parameters.rubyVersion }}.0
28
-
29
- steps:
30
- - checkout: self
31
- displayName: Checkout
32
- clean: true
33
- submodules: recursive
34
-
35
- - ${{ if ne(parameters.rubyVersion, 'bundled') }}:
36
- - script: |
37
- sudo apt-get install -y gnupg
38
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 5D98E7264E3F3D89463B314B12229434A9F003C9
39
- echo deb [arch=amd64] http://sqreen-download-private.s3.amazonaws.com/deb bionic main | sudo tee -a /etc/apt/sources.list
40
- sudo apt-get update
41
- sudo apt-get install -y sq-ruby${{ parameters.rubyVersion }} ruby-
42
- displayName: Install Ruby
43
-
44
- - ${{ if eq(parameters.rubyVersion, 'bundled') }}:
45
- - script: sudo $(gem) install bundler --version '< 2.0' --no-document
46
- displayName: Install bundler
47
-
48
- - ${{ if eq(parameters.imageName, 'ubuntu-18.04') }}:
49
- - script: |
50
- sudo apt-get install -y build-essential git curl valgrind g++ make
51
- displayName: Install Linux packages
52
-
53
- - script: $(bundle) install --path vendor/bundle
54
- displayName: Install gem dependencies
55
- env:
56
- ${{ if eq(parameters.with_mini_racer, true) }}:
57
- LOAD_MINI_RACER: 1
58
- ${{ if eq(parameters.with_therubyracer, true) }}:
59
- LOAD_THERUBYRACER: 1
60
-
61
- - script: PATH=`dirname $(bundle)`:$PATH CPPFLAGS=$(CPPFLAGS) LDFLAGS=$(LDFLAGS) $(bundle) exec rake compile
62
- displayName: Compile extension
63
-
64
- - script: |
65
- find . -name '*.log' -exec cat '{}' \;
66
- displayName: Print logs
67
- condition: failed()
68
-
69
- - script: TESTOPTS=--junit $(bundle) exec rake test
70
- displayName: Run tests
71
- env:
72
- ${{ if eq(parameters.with_mini_racer, true) }}:
73
- LOAD_MINI_RACER: 1
74
- ${{ if eq(parameters.with_therubyracer, true) }}:
75
- LOAD_THERUBYRACER: 1
76
-
77
- - task: PublishTestResults@2
78
- displayName: Publish test results
79
- condition: succeededOrFailed()
80
- inputs:
81
- testResultsFormat: 'JUnit'
82
- testResultsFiles: '**/report.xml'
83
- searchFolder: '$(System.DefaultWorkingDirectory)'
84
- mergeTestResults: true
85
-
86
- - ${{ if and(eq(parameters.imageName, 'ubuntu-18.04'), eq(parameters.with_mini_racer, false), eq(parameters.with_therubyracer, false)) }}:
87
- - script: $(bundle) exec rake test:valgrind
88
- displayName: Run tests w/ valgrind
89
-
90
- - script: |
91
- PATH=$PATH:$(dirname $(which $(gem)))
92
- $(bundle) exec rake build
93
- sudo PATH=$PATH $(gem) install pkg/*.gem
94
- displayName: Check that the gem is installable
95
-
96
- - ${{ if eq(parameters.publishCoverage, true) }}:
97
- - bash: >
98
- test -z "$CODECOV_TOKEN" || bash <(curl -s https://codecov.io/bash)
99
- displayName: "Publish coverage (Codecov)"
100
- env:
101
- CODECOV_TOKEN: $(CODECOV_TOKEN)