libv8-node 24.1.0.0 → 24.12.0.1

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: a2b8e967d1a38a0d8436f0f0d6019d04a37a1ff32089e4f7240dccaa4757124c
4
- data.tar.gz: f9a4f5dac6062d022367f5a66c251d09484e8d6924e3d6b7b50dd60c5ac5e109
3
+ metadata.gz: b8f77f83cc4f349ba82b53450ec4ba2fc7ff64b2023329e0a719a918a3e2aec5
4
+ data.tar.gz: 7f5fe3f83fa59844bf8f2f5389a650d19519b9a36bb5f9a764e2120c6e2622fd
5
5
  SHA512:
6
- metadata.gz: 9d62e6a23daf53112c214e2440ff189baeee278b903d1031067bcb2791fa207b7d529075f0fa07a922965d365aeb0b5f64467f94cadc91ea99e0728eccc93eed
7
- data.tar.gz: 840e1fbf57f570b491efab1696d7ecf3ffbf70d28f9364b3f69d559ad6bf59db4be7703d93fe56abb61ed20e2699d97086e0a7b8cca45ff5e2d5d958842ad181
6
+ metadata.gz: b6d7a3baa6d355507c665ef3278523252bfa84fd2b085878d273eeaa237e241a621863b0e8929e38f0f2cae10d36f2bfdd1423d4680a1e5c06775374b36ef0a6
7
+ data.tar.gz: 3b9d6c161fd5d2867efc13f6edb80c1f81e296d8cd4928f9a41f20b10468f58a14942faf37cb7e2d36d48978b99287700695c350f08db5fbf56f616770153ce9
data/README.md CHANGED
@@ -32,17 +32,14 @@ Here's an informal list of platforms we push so far, with equally informal tiers
32
32
 
33
33
  Tier 0 (CI built and tested):
34
34
 
35
- - x86_64-darwin (17 to 20)
35
+ - x86_64-darwin
36
+ - arm64-darwin
36
37
  - x86_64-linux
37
38
  - x86_64-linux-musl
39
+ - aarch64-linux
38
40
 
39
41
  Tier 1 (manual build and test):
40
42
 
41
- - arm64-darwin (20)
42
-
43
- Tier 2 (manual build and test, has known stability issues):
44
-
45
- - aarch64-linux
46
43
  - aarch64-linux-musl
47
44
 
48
45
  As a fallback, the source gem (`ruby` gem platform) should compile on all Node supported platforms (including e.g. ppc64le or solaris), but we may not have tested it. Help is welcome!
@@ -61,9 +58,9 @@ There is an outstanding issue with rubygems and bundler, where it may misselect
61
58
 
62
59
  ## Versioning
63
60
 
64
- The gem versioning is Node-based, e.g node 15.14.0 gives the gem 15.14.0.0. The last number is an increment for libv8-node fixes. We try as mucha s possible not to include too much changes in such gem fixes, so you can consider these like "patch" in semver.
61
+ The gem versioning is Node-based, e.g node 15.14.0 gives the gem 15.14.0.0. The last number is an increment for libv8-node fixes. We try as much as possible not to include too much changes in such gem fixes, so you can consider these like "patch" in semver.
65
62
 
66
- Compared to the `libv8` gem, there is no odd/even scheme, thanks to the intriduction in bundler of the `force_ruby_platform` flag.
63
+ Compared to the `libv8` gem, there is no odd/even scheme, thanks to the introduction in bundler of the `force_ruby_platform` flag.
67
64
 
68
65
  ## Requirements
69
66
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  unless $LOAD_PATH.include?(File.expand_path('../../lib', __dir__)) # rubocop:disable Style/IfUnlessModifier
2
4
  $LOAD_PATH.unshift(File.expand_path('../../lib', __dir__))
3
5
  end
@@ -3,7 +3,7 @@
3
3
  require 'mkmf'
4
4
 
5
5
  if RUBY_ENGINE == 'truffleruby'
6
- File.write('Makefile', dummy_makefile($srcdir).join('')) # rubocop:disable Style/GlobalVars
6
+ File.write('Makefile', dummy_makefile($srcdir).join) # rubocop:disable Style/GlobalVars
7
7
  return
8
8
  end
9
9
 
@@ -9,16 +9,14 @@ module Libv8; end
9
9
  module Libv8::Node
10
10
  class Location
11
11
  def install!
12
- File.open(Pathname(__FILE__).dirname.join('.location.yml'), 'w') do |f|
13
- f.write(to_yaml)
14
- end
12
+ File.write(Pathname(__FILE__).dirname.join('.location.yml'), to_yaml)
15
13
 
16
14
  0
17
15
  end
18
16
 
19
17
  def self.load!
20
18
  File.open(Pathname(__FILE__).dirname.join('.location.yml')) do |f|
21
- YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(f) : YAML.load(f) # rubocop:disable Security/YAMLLoad
19
+ YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(f) : YAML.load(f)
22
20
  end
23
21
  end
24
22
 
@@ -58,7 +56,7 @@ module Libv8::Node
58
56
 
59
57
  class ArchiveNotFound < StandardError
60
58
  def initialize(filename)
61
- super "libv8 did not install properly, expected binary v8 archive '#{filename}'to exist, but it was not found"
59
+ super("libv8 did not install properly, expected binary v8 archive '#{filename}'to exist, but it was not found")
62
60
  end
63
61
  end
64
62
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbconfig'
2
4
  require 'shellwords'
3
5
 
@@ -20,7 +22,38 @@ module Libv8::Node
20
22
  end
21
23
 
22
24
  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')
25
+ @platform ||= determine_platform
26
+ end
27
+
28
+ def determine_platform
29
+ ideal = construct_ideal_platform_name
30
+ return ideal if platform_directory_exists?(ideal)
31
+
32
+ fallback_platform
33
+ end
34
+
35
+ def construct_ideal_platform_name
36
+ local = Gem::Platform.local
37
+ parts = [local.cpu, local.os, local.version]
38
+ parts[2] = 'musl' if musl_platform?
39
+ parts.compact.reject(&:empty?).join('-').gsub(/-darwin-?\d+/, '-darwin')
40
+ end
41
+
42
+ def musl_platform?
43
+ RUBY_PLATFORM =~ /musl/
44
+ end
45
+
46
+ def platform_directory_exists?(name)
47
+ File.directory?(File.join(vendored_source_path, name))
48
+ end
49
+
50
+ def fallback_platform
51
+ available = available_platform_directories
52
+ available.size == 1 ? available.first : construct_ideal_platform_name
53
+ end
54
+
55
+ def available_platform_directories
56
+ Dir.glob(File.join(vendored_source_path, '*')).select { |d| File.directory?(d) }.map { |d| File.basename(d) } - ['include']
24
57
  end
25
58
 
26
59
  def config
@@ -4,7 +4,7 @@ module Libv8
4
4
  end
5
5
 
6
6
  module Libv8::Node
7
- VERSION = '24.1.0.0'
8
- NODE_VERSION = '24.1.0'
9
- LIBV8_VERSION = '13.6.233.10' # from src/node-.../deps/v8/include/v8-version.h
7
+ VERSION = '24.12.0.1'
8
+ NODE_VERSION = '24.12.0'
9
+ LIBV8_VERSION = '13.6.233.17' # from src/node-.../deps/v8/include/v8-version.h
10
10
  end
data/lib/libv8/node.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'libv8/node/version'
2
4
  require 'libv8-node/location'
3
5
 
data/lib/libv8-node.rb CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'libv8/node'
data/libexec/build-libv8 CHANGED
@@ -45,7 +45,7 @@ fi
45
45
 
46
46
  if [ "${BUILDTYPE}" = "Release" ] && [ "${GITHUB_ACTIONS}" != "" ]; then
47
47
  case "${target_platform}" in
48
- arm64*-darwin*)
48
+ *-darwin*)
49
49
  # dwarf debug info for v8 is so massive the macos
50
50
  # builder runs out of disk space when it's enabled
51
51
  find out -name '*.mk' -exec sed -i '' -e 's/gdwarf-2/g0/g' {} ';'
@@ -0,0 +1,60 @@
1
+ #!/bin/sh
2
+
3
+ set -e
4
+ set -u
5
+
6
+ BASEDIR="${PWD}"
7
+
8
+ export TARGET_PLATFORM=x86_64-darwin
9
+ export RUBY_TARGET_PLATFORM=x86_64-darwin
10
+
11
+ bundle install
12
+
13
+ # shellcheck disable=SC2034
14
+ RUBY_PLATFORM=$(./libexec/metadata ruby_platform)
15
+ GEM_PLATFORM=$(./libexec/metadata gem_platform)
16
+ GEM_VERSION=$(./libexec/metadata gem_version)
17
+ NODE_VERSION=$(./libexec/metadata node_version)
18
+ LIBV8_VERSION=$(./libexec/metadata libv8_version)
19
+
20
+ ./libexec/download-node "$NODE_VERSION"
21
+ ./libexec/extract-node "$NODE_VERSION"
22
+
23
+ # Validate that we have the correct V8 version.
24
+ libv8_version_h=$(./libexec/metadata libv8_version_h)
25
+ if [ "$libv8_version_h" != "$LIBV8_VERSION" ]; then
26
+ echo "LIBV8 version mismatch: expected $LIBV8_VERSION but found $libv8_version_h"
27
+ exit 1
28
+ fi
29
+
30
+ # Build the package.
31
+ ./libexec/build-libv8 "$NODE_VERSION"
32
+ ./libexec/build-monolith "$NODE_VERSION"
33
+ ./libexec/inject-libv8 "$NODE_VERSION"
34
+
35
+ # Run V8 tests.
36
+ cd test/gtest
37
+ cmake -S . -B build
38
+ cd build
39
+ cmake --build .
40
+ if ! ./c_v8_tests; then
41
+ echo "Tests failed."
42
+ exit 1
43
+ fi
44
+
45
+ # Build the gem.
46
+ cd "${BASEDIR}"
47
+ bundle exec rake binary
48
+
49
+ # Test that the gem can be installed and used.
50
+ gem install pkg/libv8-node-"$GEM_VERSION"-"$GEM_PLATFORM".gem
51
+
52
+ rm -rf test/mini_racer
53
+ git clone https://github.com/rubyjs/mini_racer.git test/mini_racer --depth 1
54
+ cd test/mini_racer
55
+ ruby -i -ne "\$_ =~ /^\s+LIBV8_NODE_VERSION/ ? print(\" LIBV8_NODE_VERSION = \\\"$GEM_VERSION\\\"\\n\") : print" lib/mini_racer/version.rb
56
+ # shellcheck disable=SC2016
57
+ ruby -i -ne '$_ =~ /spec.required_ruby_version/ ? "" : print' mini_racer.gemspec
58
+ bundle install
59
+ bundle exec rake compile
60
+ bundle exec rake test
@@ -0,0 +1,64 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # libexec/fetch-gems <url-or-run-id>
5
+ # Downloads all artifacts from a GitHub Actions run, extracts the gems,
6
+ # and places them in the pkg/ directory for easy publishing.
7
+
8
+ URL_OR_ID=$1
9
+
10
+ if [[ -z "$URL_OR_ID" ]]; then
11
+ echo "Usage: $0 <github-actions-run-url-or-id>"
12
+ exit 1
13
+ fi
14
+
15
+ # Extract run ID from URL or use as is if it's already an ID
16
+ if [[ "$URL_OR_ID" =~ /actions/runs/([0-9]+) ]]; then
17
+ RUN_ID="${BASH_REMATCH[1]}"
18
+ elif [[ "$URL_OR_ID" =~ ^[0-9]+$ ]]; then
19
+ RUN_ID="$URL_OR_ID"
20
+ else
21
+ echo "Error: Could not parse run ID from '$URL_OR_ID'"
22
+ exit 1
23
+ fi
24
+
25
+ # Determine repo - default to rubyjs/libv8-node but allow override via GH_REPO env var
26
+ REPO=${GH_REPO:-rubyjs/libv8-node}
27
+
28
+ echo "Fetching artifacts for run $RUN_ID in $REPO..."
29
+
30
+ # Create a temporary directory for downloading
31
+ TMP_DIR=$(mktemp -d -t libv8-node-artifacts-XXXXXX)
32
+ trap 'rm -rf "$TMP_DIR"' EXIT
33
+
34
+ # Download all artifacts
35
+ gh run download "$RUN_ID" --repo "$REPO" -D "$TMP_DIR"
36
+
37
+ # Ensure pkg directory exists
38
+ mkdir -p pkg
39
+
40
+ # Move all .gem files to pkg/
41
+ # Artifacts are downloaded into subdirectories named after the artifact
42
+ echo "Extracting gems..."
43
+ found_gems=0
44
+ while IFS= read -r gem_file; do
45
+ gem_name=$(basename "$gem_file")
46
+ mv -v "$gem_file" "pkg/$gem_name"
47
+ found_gems=$((found_gems + 1))
48
+ done < <(find "$TMP_DIR" -name "*.gem")
49
+
50
+ if [ "$found_gems" -eq 0 ]; then
51
+ echo "No gems found in artifacts for run $RUN_ID."
52
+ exit 1
53
+ fi
54
+
55
+ echo ""
56
+ echo "Successfully downloaded $found_gems gem(s) to pkg/:"
57
+ ls -1 pkg/*.gem
58
+
59
+ echo ""
60
+ echo "To publish all downloaded gems, run:"
61
+ echo " for g in pkg/*.gem; do gem push \"\$g\"; done"
62
+ echo ""
63
+ echo "To publish a specific gem:"
64
+ echo " gem push pkg/<gem-filename>"
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" } }.to_s.gsub(/-darwin-?\d+/, "-darwin")'
8
+ ruby -e 'p = Gem::Platform.local; parts = [p.cpu, p.os, p.version]; parts[2] = "musl" if RUBY_PLATFORM =~ /musl/; puts parts.compact.reject { |s| s.to_s.empty? }.join("-").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
@@ -29,6 +29,13 @@ host_platform="${triple}"
29
29
  target_platform="${TARGET_PLATFORM:-${1:-}}"
30
30
  target_platform="${target_platform:-${host_platform}}"
31
31
 
32
+ normalize_platform() {
33
+ echo "$1" | sed -E 's/(x86_64|aarch64|armv[0-9]+|arm).*-linux-musl.*/\1-linux-musl/' | sed -E 's/(x86_64|aarch64|armv[0-9]+|arm).*-linux-gnu.*/\1-linux/' | sed -E 's/armv[0-9]+l?/arm/'
34
+ }
35
+
36
+ norm_host=$(normalize_platform "${host_platform}")
37
+ norm_target=$(normalize_platform "${target_platform}")
38
+
32
39
  case "${target_platform}" in
33
40
  x86_64*-linux-musl)
34
41
  RUBY_TARGET_PLATFORM='x86_64-linux-musl'
@@ -57,7 +64,7 @@ case "${target_platform}" in
57
64
  RUBY_TARGET_PLATFORM='arm64-darwin'
58
65
  ;;
59
66
  *)
60
- if [ "${host_platform}" != "${target_platform}" ]; then
67
+ if [ "${norm_host}" != "${norm_target}" ]; then
61
68
  echo 'cross compilation not supported'
62
69
  exit 1
63
70
  fi
@@ -78,8 +85,8 @@ case "${host_platform}" in
78
85
  ;;
79
86
  esac
80
87
 
81
- if [ "${host_platform}" != "${target_platform}" ]; then
82
- echo "# cross compiling host: ${host_platform} target: ${target_platform}"
88
+ if [ "${norm_host}" != "${norm_target}" ]; then
89
+ echo "# cross compiling host: ${host_platform} (norm: ${norm_host}) target: ${target_platform} (norm: ${norm_target})"
83
90
  case "${target_platform}" in
84
91
  aarch64-*linux*)
85
92
  CC='aarch64-linux-gnu-gcc'
@@ -6,11 +6,11 @@ index 6e21dac6d7..bcf022fb28 100644
6
6
  }, {
7
7
  'v8_enable_etw_stack_walking': 0,
8
8
  }],
9
- - ['OS=="linux"', {
9
+ - ['OS=="linux" or OS=="openharmony"', {
10
10
  + # Disable madvise(MADV_DONTFORK), it's a great optimization for programs
11
11
  + # that fork & exec but not for programs that fork and keep running.
12
12
  + # It makes mini_racer's test/test_forking.rb test segfault.
13
- + ['False and OS=="linux"', {
13
+ + ['False and (OS=="linux" or OS=="openharmony")', {
14
14
  # Sets -dV8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION.
15
15
  #
16
- # This flag speeds up the performance of fork/execve on Linux systems for
16
+ # This flag speeds up the performance of fork/execve on Linux systems for
data/sums/v24.12.0.sum ADDED
@@ -0,0 +1 @@
1
+ ad24a1f29e55c9539228f2c51a032da279188b681c4dc019cced7f82a0fcdd8d
metadata CHANGED
@@ -1,15 +1,56 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libv8-node
3
3
  version: !ruby/object:Gem::Version
4
- version: 24.1.0.0
4
+ version: 24.12.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-06-12 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: base64
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :development
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
26
+ - !ruby/object:Gem::Dependency
27
+ name: logger
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ - !ruby/object:Gem::Dependency
41
+ name: mutex_m
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
13
54
  - !ruby/object:Gem::Dependency
14
55
  name: rake
15
56
  requirement: !ruby/object:Gem::Requirement
@@ -28,16 +69,16 @@ dependencies:
28
69
  name: rubocop
29
70
  requirement: !ruby/object:Gem::Requirement
30
71
  requirements:
31
- - - "~>"
72
+ - - ">="
32
73
  - !ruby/object:Gem::Version
33
- version: 1.44.0
74
+ version: 1.8.0
34
75
  type: :development
35
76
  prerelease: false
36
77
  version_requirements: !ruby/object:Gem::Requirement
37
78
  requirements:
38
- - - "~>"
79
+ - - ">="
39
80
  - !ruby/object:Gem::Version
40
- version: 1.44.0
81
+ version: 1.8.0
41
82
  description: Node.JS's V8 JavaScript engine for multiplatform goodness
42
83
  email:
43
84
  - ''
@@ -57,9 +98,11 @@ files:
57
98
  - lib/libv8/node.rb
58
99
  - lib/libv8/node/version.rb
59
100
  - libexec/build-libv8
101
+ - libexec/build-macos-x86_64
60
102
  - libexec/build-monolith
61
103
  - libexec/download-node
62
104
  - libexec/extract-node
105
+ - libexec/fetch-gems
63
106
  - libexec/inject-libv8
64
107
  - libexec/metadata
65
108
  - libexec/platform
@@ -92,11 +135,12 @@ files:
92
135
  - sums/v23.6.1.sum
93
136
  - sums/v23.8.0.sum
94
137
  - sums/v24.1.0.sum
138
+ - sums/v24.12.0.sum
95
139
  homepage: https://github.com/rubyjs/libv8-node
96
140
  licenses:
97
141
  - MIT
98
- metadata: {}
99
- post_install_message:
142
+ metadata:
143
+ rubygems_mfa_required: 'true'
100
144
  rdoc_options: []
101
145
  require_paths:
102
146
  - lib
@@ -112,8 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
156
  - !ruby/object:Gem::Version
113
157
  version: '0'
114
158
  requirements: []
115
- rubygems_version: 3.3.26
116
- signing_key:
159
+ rubygems_version: 4.0.3
117
160
  specification_version: 4
118
161
  summary: Node.JS's V8 JavaScript engine
119
162
  test_files: []