From 379a34c2e2a4b3f20ed5db0c029fddf98ea0e806 Mon Sep 17 00:00:00 2001 From: Matt Larraz Date: Tue, 10 Sep 2024 14:44:29 -0400 Subject: [PATCH] ARM support for NodeJS --- CHANGELOG.md | 1 + lib/language_pack/helpers/node_installer.rb | 7 +------ lib/language_pack/helpers/nodebin.rb | 3 ++- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da33c7f75..4875c6bd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## [Unreleased] +- Support NodeJS on ARM builds (https://github.com/heroku/heroku-buildpack-ruby/pull/1493) ## [v279] - 2024-09-04 diff --git a/lib/language_pack/helpers/node_installer.rb b/lib/language_pack/helpers/node_installer.rb index 16e7eb9d9..7dfecb172 100644 --- a/lib/language_pack/helpers/node_installer.rb +++ b/lib/language_pack/helpers/node_installer.rb @@ -9,7 +9,7 @@ def initialize end def binary_path - node_folder(@version) + File.basename(@url).delete_suffix(".tar.gz") end def install @@ -27,9 +27,4 @@ def install FileUtils.mv("#{dir}/#{node_bin}", ".") end end - - private - def node_folder(version) - "node-v#{version}-linux-x64" - end end diff --git a/lib/language_pack/helpers/nodebin.rb b/lib/language_pack/helpers/nodebin.rb index 1a5c194f9..ac7c13e6d 100644 --- a/lib/language_pack/helpers/nodebin.rb +++ b/lib/language_pack/helpers/nodebin.rb @@ -3,11 +3,12 @@ class LanguagePack::Helpers::Nodebin NODE_VERSION = "20.9.0" YARN_VERSION = "1.22.19" + ARCH = RUBY_PLATFORM.start_with?(/aarch64|arm64/) ? "arm64" : "x64" def self.hardcoded_node_lts { "number" => NODE_VERSION, - "url" => "https://heroku-nodebin.s3.us-east-1.amazonaws.com/node/release/linux-x64/node-v#{NODE_VERSION}-linux-x64.tar.gz" + "url" => "https://nodejs.org/download/release/v#{NODE_VERSION}/node-v#{NODE_VERSION}-linux-#{ARCH}.tar.gz", } end