libv8-node 24.12.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: 1b236529e0b7a1bc84cf99a96962ada218873a6cd24c8093fda5c8c33c9a6f90
4
- data.tar.gz: e558d5b144f431d251409a73c70e98e32be7c59747f560687f30c6d9129a3d27
3
+ metadata.gz: b8f77f83cc4f349ba82b53450ec4ba2fc7ff64b2023329e0a719a918a3e2aec5
4
+ data.tar.gz: 7f5fe3f83fa59844bf8f2f5389a650d19519b9a36bb5f9a764e2120c6e2622fd
5
5
  SHA512:
6
- metadata.gz: f8e856fdf8828f71750f0141409ec8c134b30d1ac5478407aad6048de333e6f84dcf58bc1a47b9a81fb1d4508eb1f2267b87efb14f999ffeb6fc8a916f3f9040
7
- data.tar.gz: 8365e6536ee648018e00773b8a194c07b0df395056523f60a90de3e949b82e0c6db3deedd147f72ded6bbf9d73e5dae0127eda36cd165ef78cbd43a84f48103b
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
 
@@ -22,7 +22,38 @@ module Libv8::Node
22
22
  end
23
23
 
24
24
  def platform
25
- 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']
26
57
  end
27
58
 
28
59
  def config
@@ -4,7 +4,7 @@ module Libv8
4
4
  end
5
5
 
6
6
  module Libv8::Node
7
- VERSION = '24.12.0.0'
7
+ VERSION = '24.12.0.1'
8
8
  NODE_VERSION = '24.12.0'
9
9
  LIBV8_VERSION = '13.6.233.17' # from src/node-.../deps/v8/include/v8-version.h
10
10
  end
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,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'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libv8-node
3
3
  version: !ruby/object:Gem::Version
4
- version: 24.12.0.0
4
+ version: 24.12.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -102,6 +102,7 @@ files:
102
102
  - libexec/build-monolith
103
103
  - libexec/download-node
104
104
  - libexec/extract-node
105
+ - libexec/fetch-gems
105
106
  - libexec/inject-libv8
106
107
  - libexec/metadata
107
108
  - libexec/platform