libv8-node 16.10.0.0 → 18.19.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba145591a1a337f0e998b92bf0b623e103e53b1b68e367c920eccd87d317144d
4
- data.tar.gz: 9bfd12ef63fe1c54ee66004b0f36ab239f6ff34feb24bc88704abdbcc6d6f750
3
+ metadata.gz: 1b315cf0c9b93c8b72c0c93217620056865a7a2d529f60b50410e20720afab91
4
+ data.tar.gz: efaf88598b5d5b3d03518bdfb17a4e6b0e28b0ba8462c27aa819f00d0739ff99
5
5
  SHA512:
6
- metadata.gz: 6674253a43f01a089b224a07c0c0d93db9c38b8e443cbef5c6020cd694b49618b7b2c408cb13d4c5000cb276539b517ab9082e0ad335c96a8f246e152b516d8c
7
- data.tar.gz: 31db2d25ea502073ed5e36987320b50a7e22ce86f22e523bb8b6f5fcdae57d0378342348067ce815897b6731dc5f01fb917f2ed8224330981911ce88c8593457
6
+ metadata.gz: 144737ba46503b1154fab500df60bbdd5a993cd84276d92d65e77202451ff183dd6a6642369c7a29dcbc4f7fbd07d4571934ce5f07d12c7b34e419e2707ff9c4
7
+ data.tar.gz: 8653426d7d84f2140a02fc90331ef1b8d9d1477a28335875d0a5a63737582a15a877d7872df4291e89a3e77e33bb583454a154306ff0a06925364678e0738151
@@ -1,4 +1,4 @@
1
- unless $LOAD_PATH.include?(File.expand_path('../../lib', __dir__))
1
+ unless $LOAD_PATH.include?(File.expand_path('../../lib', __dir__)) # rubocop:disable Style/IfUnlessModifier
2
2
  $LOAD_PATH.unshift(File.expand_path('../../lib', __dir__))
3
3
  end
4
4
  require 'libv8/node/version'
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'mkmf'
4
+
5
+ if RUBY_ENGINE == 'truffleruby'
6
+ File.write('Makefile', dummy_makefile($srcdir).join('')) # rubocop:disable Style/GlobalVars
7
+ return
8
+ end
9
+
4
10
  create_makefile('libv8-node')
5
11
 
6
12
  require File.expand_path('location', __dir__)
@@ -45,7 +45,7 @@ module Libv8::Node
45
45
  def verify_installation!
46
46
  include_paths = Libv8::Node::Paths.include_paths
47
47
 
48
- unless include_paths.detect { |p| Pathname(p).join('v8.h').exist? }
48
+ unless include_paths.detect { |p| Pathname(p).join('v8.h').exist? } # rubocop:disable Style/IfUnlessModifier
49
49
  raise(HeaderNotFound, "Unable to locate 'v8.h' in the libv8 header paths: #{include_paths.inspect}")
50
50
  end
51
51
 
@@ -13,12 +13,16 @@ module Libv8::Node
13
13
 
14
14
  def object_paths
15
15
  [Shellwords.escape(File.join(vendored_source_path,
16
- Gem::Platform.local.to_s,
16
+ platform,
17
17
  'libv8',
18
18
  'obj',
19
19
  "libv8_monolith.#{config['LIBEXT']}"))]
20
20
  end
21
21
 
22
+ def platform
23
+ Gem::Platform.local.tap { |p| RUBY_PLATFORM =~ /musl/ && p.version.nil? && p.instance_eval { @version = 'musl' } }.to_s.gsub(/-darwin-?\d+/, '-darwin')
24
+ end
25
+
22
26
  def config
23
27
  RbConfig::MAKEFILE_CONFIG
24
28
  end
@@ -1,7 +1,7 @@
1
1
  module Libv8; end
2
2
 
3
3
  module Libv8::Node
4
- VERSION = '16.10.0.0'.freeze
5
- NODE_VERSION = '16.10.0'.freeze
6
- LIBV8_VERSION = '9.3.345.19'.freeze # from v8/include/v8-version.h
4
+ VERSION = '18.19.0.0'.freeze
5
+ NODE_VERSION = '18.19.0'.freeze
6
+ LIBV8_VERSION = '10.2.154.26'.freeze # from v8/include/v8-version.h
7
7
  end
data/libexec/build-libv8 CHANGED
@@ -17,26 +17,36 @@ BUILDTYPE="${BUILDTYPE:-Release}"
17
17
 
18
18
  cd "${src}/node-v${version}"
19
19
 
20
- if command -v python3 >/dev/null 2>&1; then
21
- PYTHON="${PYTHON:-python3}"
22
- else
23
- PYTHON="${PYTHON:-python2}"
24
- fi
25
-
26
20
  configure_flags='--openssl-no-asm --without-npm --shared --with-intl=full-icu'
27
21
  eval "$("${libexec}/platform")"
28
22
 
29
23
  echo "configure: ${configure_flags}"
30
24
  echo "compilers: CC='${CC}' CXX='${CXX}' CC_host='${CC_host:-}' CXX_host='${CXX_host:-}'"
31
25
 
32
- "${CC}" -v
33
- "${CXX}" -v
26
+ ${CC} -v
27
+ ${CXX} -v
34
28
 
35
29
  # shellcheck disable=SC2086
36
- "${PYTHON}" configure ${configure_flags}
30
+ ./configure ${configure_flags}
37
31
 
38
32
  make BUILDTYPE="${BUILDTYPE}" config.gypi
39
33
  make BUILDTYPE="${BUILDTYPE}" "out/Makefile"
40
34
 
35
+ # workaround for node specifying `-msign-return-address=all` in ALL `CFLAGS` for aarch64 builds
36
+ # (if the host isn't also aarch64, this flag causes a compiler error)
37
+
38
+ # shellcheck disable=SC2154 # these variables are defined by `eval`ing the output of the platform script above
39
+ if [ "$host_platform" != "$target_platform" ] && [ "${target_platform%%-*}" = "aarch64" ]; then
40
+ find . -iname "*.host.mk" -exec sed -i '/-msign-return-address /d' {} ';'
41
+ fi
42
+
43
+ # workaround for clang 15 making -Wenum-constexpr-conversion a default and an error
44
+ # (if the host isn't arm64, no such error occurs)
45
+
46
+ # shellcheck disable=SC2154 # these variables are defined by `eval`ing the output of the platform script above
47
+ if [ "${target_platform%%-*}" = "arm64" ]; then
48
+ find . \( -iname "*.host.mk" -or -iname "*.target.mk" \) -exec perl -pi -e 's/^(CFLAGS_(?:Release|Debug) := )([\\])/\1-Wno-enum-constexpr-conversion \2/' {} ';'
49
+ fi
50
+
41
51
  export PATH="${PWD}/out/tools/bin:${PATH}"
42
52
  make -j"${NJOBS}" -C out BUILDTYPE="${BUILDTYPE}" V=0
@@ -21,21 +21,14 @@ platform=$(uname)
21
21
  rm -f "${LIBV8_MONOLITH}"
22
22
  case "${platform}" in
23
23
  "SunOS")
24
- /usr/xpg4/bin/find . -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | while read -r obj; do
25
- ar cqS "${LIBV8_MONOLITH}" "${obj}"
26
- done
27
- ranlib "${LIBV8_MONOLITH}"
24
+ /usr/xpg4/bin/find . '(' '!' -path './icutools/deps/icu-small/source/stubdata/stubdata.o' ')' -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | xargs ar cq "${LIBV8_MONOLITH}"
28
25
  ;;
29
26
  "Darwin")
30
- /usr/bin/find . -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | while read -r obj; do
31
- /usr/bin/ar -cqS "${LIBV8_MONOLITH}" "${obj}"
32
- done
33
- /usr/bin/ranlib "${LIBV8_MONOLITH}"
27
+ /usr/bin/find . '(' '!' -path './icutools/deps/icu-small/source/stubdata/stubdata.o' ')' -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | xargs /usr/bin/ar -cq "${LIBV8_MONOLITH}"
34
28
  ;;
35
29
  "Linux")
36
- find . -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | while read -r obj; do
37
- ar -cq "${LIBV8_MONOLITH}" "${obj}"
38
- done
30
+ find . '(' '!' -path './icutools/deps/icu-small/source/stubdata/stubdata.o' ')' -and '(' -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" ')' | sort | uniq | xargs ar -cqSP "${LIBV8_MONOLITH}"
31
+ ar -sP "${LIBV8_MONOLITH}"
39
32
  ;;
40
33
  *)
41
34
  echo "Unsupported platform: ${platform}"
data/libexec/extract-node CHANGED
@@ -30,7 +30,7 @@ extract "${src}" "${src}/node-v${version}.tar.gz"
30
30
  cd "${src}/node-v${version}"
31
31
 
32
32
  #patch -p1 < "${top}"/patch/gyp-libv8_monolith.patch
33
- patch -p1 < "${top}"/patch/py2-icutrim.patch
33
+ #patch -p1 < "${top}"/patch/py2-icutrim.patch
34
34
  patch -p1 < "${top}"/patch/py2-genv8constants.patch
35
35
 
36
36
  # TODO: the following still fails on py3 so the above one forcing py2 is needed
data/libexec/inject-libv8 CHANGED
@@ -26,6 +26,12 @@ done
26
26
 
27
27
  cd "${BASEDIR}/out/${BUILDTYPE}"
28
28
 
29
+ case "${RUBY_TARGET_PLATFORM}" in
30
+ *-darwin*)
31
+ RUBY_TARGET_PLATFORM="$(echo "${RUBY_TARGET_PLATFORM}" | sed -e 's/-darwin[0-9]*/-darwin/')"
32
+ ;;
33
+ esac
34
+
29
35
  rm -rf "${top}/vendor/v8/${RUBY_TARGET_PLATFORM}"
30
36
  # shellcheck disable=SC2043
31
37
  for lib in libv8_monolith.a; do
@@ -33,8 +39,35 @@ for lib in libv8_monolith.a; do
33
39
  mkdir -p "${dir}"
34
40
  rm -f "${dir}/${lib}"
35
41
 
36
- echo "${BASEDIR}/out/${BUILDTYPE}/${lib} -> ${dir}/${lib}"
37
- "${STRIP}" -S -x -o "${dir}/${lib}" "${lib}"
42
+ if [ "$STRIP_NEEDS_EXTRACT" = "y" ]; then
43
+ # manual extract/strip objects/build archive sequence
44
+ # because `strip` can't deal with these
45
+ # (presumably due to that folder issue mentioned below)
46
+ (
47
+ tmpdir="$(mktemp -d)"
48
+ trap 'rm -r "$tmpdir"' EXIT
49
+ mkdir "$tmpdir/stage"
50
+ cd "$tmpdir/stage"
51
+
52
+ # create folders named in `ar` archive (`ar -x` fails to create these)
53
+ "$AR" "$ARLISTFLAGS" "$BASEDIR/out/$BUILDTYPE/$lib" | while read -r path; do
54
+ dirname "$path"
55
+ done | uniq | xargs mkdir -p
56
+ "$AR" "$AREXTRACTFLAGS" "$BASEDIR/out/${BUILDTYPE}/$lib"
57
+
58
+ # strip all objects
59
+ "$FIND" -type f -exec "$STRIP" -Sx {} +
60
+
61
+ # rebuild the archive
62
+ "$FIND" -type f -exec "$AR" "$ARCOLLECTFLAGS" "../$lib" {} +
63
+ $ARBUILDSYMBOLS "../$lib"
64
+ mv "../$lib" "$dir/$lib"
65
+ )
66
+ echo "${BASEDIR}/out/${BUILDTYPE}/${lib} -> ${dir}/${lib}"
67
+ else
68
+ echo "${BASEDIR}/out/${BUILDTYPE}/${lib} -> ${dir}/${lib}"
69
+ "${STRIP}" -S -x -o "${dir}/${lib}" "${lib}"
70
+ fi
38
71
  done
39
72
 
40
73
  mkdir -p "${top}/ext/libv8-node"
data/libexec/metadata CHANGED
@@ -5,7 +5,7 @@ case "$1" in
5
5
  ruby -e 'puts RUBY_PLATFORM'
6
6
  ;;
7
7
  gem_platform)
8
- ruby -e 'puts Gem::Platform.local.tap { |p| RUBY_PLATFORM =~ /musl/ && p.version.nil? and p.instance_eval { @version = "musl" } }'
8
+ ruby -e 'puts Gem::Platform.local.tap { |p| RUBY_PLATFORM =~ /musl/ && p.version.nil? and p.instance_eval { @version = "musl" } }.to_s.gsub(/-darwin-?\d+/, "-darwin")'
9
9
  ;;
10
10
  gem_version|version)
11
11
  ruby -I'lib' -r'libv8/node/version' -e 'puts Libv8::Node::VERSION'
data/libexec/platform CHANGED
@@ -15,8 +15,16 @@ elif command -v cc >/dev/null 2>&1; then
15
15
  fi
16
16
 
17
17
  STRIP="${STRIP:-strip}"
18
+ AR="${AR:-ar}"
19
+ AREXTRACTFLAGS="${AREXTRACTFLAGS:--x}"
20
+ ARLISTFLAGS="${ARLISTFLAGS:--t}"
21
+ ARCOLLECTFLAGS="${ARCOLLECTFLAGS:-cqS}"
22
+ # this is the command to build the symbol table in an ar archive.
23
+ ARBUILDSYMBOLS="${ARBUILDSYMBOLS:-ranlib}"
24
+ FIND="${FIND:-find}"
25
+ STRIP_NEEDS_EXTRACT="${STRIP_NEEDS_EXTRACT:-n}"
18
26
 
19
- triple=$("${CC}" -dumpmachine)
27
+ triple=$(${CC} -dumpmachine)
20
28
  host_platform="${triple}"
21
29
  target_platform="${TARGET_PLATFORM:-${1:-}}"
22
30
  target_platform="${target_platform:-${host_platform}}"
@@ -42,14 +50,17 @@ case "${target_platform}" in
42
50
  ;;
43
51
  x86_64*-darwin*)
44
52
  # not for cross compilation
45
- RUBY_TARGET_PLATFORM="$(ruby -e 'puts Gem::Platform.local.to_s')"
53
+ RUBY_TARGET_PLATFORM='x86_64-darwin'
46
54
  ;;
47
55
  arm64*-darwin*)
48
56
  # not for cross compilation
49
- RUBY_TARGET_PLATFORM="$(ruby -e 'puts Gem::Platform.local.to_s')"
57
+ RUBY_TARGET_PLATFORM='arm64-darwin'
50
58
  ;;
51
59
  *)
52
- # not for cross compilation
60
+ if [ "${host_platform}" != "${target_platform}" ]; then
61
+ echo 'cross compilation not supported'
62
+ exit 1
63
+ fi
53
64
  RUBY_TARGET_PLATFORM="$(ruby -e 'puts Gem::Platform.local.to_s')"
54
65
  ;;
55
66
  esac
@@ -60,6 +71,11 @@ case "${host_platform}" in
60
71
  CXX="${CXX:-/opt/local/gcc7/bin/g++}"
61
72
  STRIP="gstrip"
62
73
  ;;
74
+ *linux*)
75
+ STRIP_NEEDS_EXTRACT="y"
76
+ ARCOLLECTFLAGS="-cqSP"
77
+ ARBUILDSYMBOLS="${AR} -sP"
78
+ ;;
63
79
  esac
64
80
 
65
81
  if [ "${host_platform}" != "${target_platform}" ]; then
@@ -81,6 +97,30 @@ if [ "${host_platform}" != "${target_platform}" ]; then
81
97
  STRIP='arm-linux-gnueabihf-strip'
82
98
  configure_flags='--dest-cpu=arm --cross-compiling --dest-os=linux --with-arm-float-abi=hard --with-arm-fpu=neon'
83
99
  ;;
100
+ x86_64-*linux*)
101
+ CC='x86_64-linux-gnu-gcc'
102
+ CXX='x86_64-linux-gnu-g++'
103
+ CC_host='gcc'
104
+ CXX_host='g++'
105
+ STRIP='x86_64-linux-gnu-strip'
106
+ configure_flags='--dest-cpu=x86_64 --cross-compiling --dest-os=linux'
107
+ ;;
108
+ x86_64*-darwin*)
109
+ CC='clang -arch x86_64'
110
+ CXX='clang++ -arch x86_64'
111
+ CC_host='clang'
112
+ CXX_host='clang++'
113
+ STRIP='strip'
114
+ configure_flags='--dest-cpu=x86_64 --cross-compiling --dest-os=mac'
115
+ ;;
116
+ arm64*-darwin*)
117
+ CC='clang -arch arm64'
118
+ CXX='clang++ -arch arm64'
119
+ CC_host='clang'
120
+ CXX_host='clang++'
121
+ STRIP='strip'
122
+ configure_flags='--dest-cpu=arm64 --cross-compiling --dest-os=mac'
123
+ ;;
84
124
  *)
85
125
  configure_flags=''
86
126
  ;;
@@ -102,11 +142,31 @@ fi
102
142
  # ;;
103
143
  # esac
104
144
 
145
+ if command -v ccache >/dev/null 2>&1; then
146
+ if [ -n "${CC:-}" ] && [ "${CC}" = "${CC#ccache}" ]; then
147
+ CC="ccache ${CC}"
148
+ CXX="ccache ${CXX}"
149
+ fi
150
+
151
+ if [ -n "${CC_host:-}" ] && [ "${CC_host}" = "${CC_host#ccache}" ]; then
152
+ CC_host="ccache ${CC_host}"
153
+ CXX_host="ccache ${CXX_host}"
154
+ fi
155
+ fi
156
+
105
157
  cat <<EOF
106
158
  export CC='${CC}'
107
159
  export CXX='${CXX}'
108
160
  host_platform='${host_platform}'
109
161
  target_platform='${target_platform}'
162
+ STRIP='$STRIP'
163
+ AR='$AR'
164
+ AREXTRACTFLAGS='$AREXTRACTFLAGS'
165
+ ARLISTFLAGS='$ARLISTFLAGS'
166
+ ARCOLLECTFLAGS='$ARCOLLECTFLAGS'
167
+ ARBUILDSYMBOLS='$ARBUILDSYMBOLS'
168
+ FIND='$FIND'
169
+ STRIP_NEEDS_EXTRACT='$STRIP_NEEDS_EXTRACT'
110
170
  EOF
111
171
 
112
172
  if [ -n "${CC_host:-}" ]; then cat <<EOF; fi
data/sums/v17.3.1.sum ADDED
@@ -0,0 +1 @@
1
+ 34ed7eeb1fd088c59e2719c229dc9587c9f106b45329798ca3945c386ac824ed
data/sums/v17.9.1.sum ADDED
@@ -0,0 +1 @@
1
+ 1102f5e0aafaab8014d19c6c57142caf2ba3ef69d88d7a7f0f82798051796027
data/sums/v18.13.0.sum ADDED
@@ -0,0 +1,2 @@
1
+ 61ae68446438c2479e466d551b6e8c898097d56722957b1a8466ec8476a590d2
2
+
data/sums/v18.16.0.sum ADDED
@@ -0,0 +1 @@
1
+ 6a4f5c5d76e5c50cef673099e56f19bc3266ae363f56ca0ab77dd2f3c5088c6d
data/sums/v18.19.0.sum ADDED
@@ -0,0 +1 @@
1
+ dd4c1dc1cb94e1e29f65a3a592247edeb8ceb23483123b0e1847d75c5f0b0c17
data/sums/v18.8.0.sum ADDED
@@ -0,0 +1 @@
1
+ 676a3ca9bdbe7381e49652f2f78705f83175f3844a7450893d562faa35537ba2
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libv8-node
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.10.0.0
4
+ version: 18.19.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-17 00:00:00.000000000 Z
11
+ date: 2024-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.50.0
33
+ version: 1.44.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.50.0
40
+ version: 1.44.0
41
41
  description: Node.JS's V8 JavaScript engine for multiplatform goodness
42
42
  email:
43
43
  - ''
@@ -76,11 +76,17 @@ files:
76
76
  - sums/v16.7.0.sum
77
77
  - sums/v16.8.0.sum
78
78
  - sums/v16.9.1.sum
79
- homepage: https://github.com/sqreen/ruby-libv8-node
79
+ - sums/v17.3.1.sum
80
+ - sums/v17.9.1.sum
81
+ - sums/v18.13.0.sum
82
+ - sums/v18.16.0.sum
83
+ - sums/v18.19.0.sum
84
+ - sums/v18.8.0.sum
85
+ homepage: https://github.com/rubyjs/libv8-node
80
86
  licenses:
81
87
  - MIT
82
88
  metadata: {}
83
- post_install_message:
89
+ post_install_message:
84
90
  rdoc_options: []
85
91
  require_paths:
86
92
  - lib
@@ -96,8 +102,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
102
  - !ruby/object:Gem::Version
97
103
  version: '0'
98
104
  requirements: []
99
- rubygems_version: 3.0.3.1
100
- signing_key:
105
+ rubygems_version: 3.4.22
106
+ signing_key:
101
107
  specification_version: 4
102
108
  summary: Node.JS's V8 JavaScript engine
103
109
  test_files: []