From 989c7f7a093ce626d671ce88ecb3d1a8d42426ea Mon Sep 17 00:00:00 2001 From: Schneems Date: Wed, 6 Nov 2024 16:05:02 -0600 Subject: [PATCH] Revert "Add ARM support for NodeJS (#1499)" This reverts commit 56199b28b9a6de9cb7a33cb3c44097ffb81b66be. --- CHANGELOG.md | 1 - lib/language_pack/helpers/node_installer.rb | 11 ++++++++--- lib/language_pack/helpers/nodebin.rb | 9 ++++----- lib/language_pack/ruby.rb | 2 +- spec/helpers/node_installer_spec.rb | 14 ++++++-------- 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ce128f47..c4cc1416c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,6 @@ ## [Unreleased] -- Support Node.js on ARM builds (https://github.com/heroku/heroku-buildpack-ruby/pull/1499) ## [v280] - 2024-11-06 diff --git a/lib/language_pack/helpers/node_installer.rb b/lib/language_pack/helpers/node_installer.rb index 218d1c8b3..16e7eb9d9 100644 --- a/lib/language_pack/helpers/node_installer.rb +++ b/lib/language_pack/helpers/node_installer.rb @@ -1,15 +1,15 @@ class LanguagePack::Helpers::NodeInstaller attr_reader :version - def initialize(arch: ) - nodebin = LanguagePack::Helpers::Nodebin.node_lts(arch: arch) + def initialize + nodebin = LanguagePack::Helpers::Nodebin.node_lts @version = nodebin["number"] @url = nodebin["url"] @fetcher = LanguagePack::Fetcher.new("") end def binary_path - File.basename(@url).delete_suffix(".tar.gz") + node_folder(@version) end def install @@ -27,4 +27,9 @@ 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 7632e8366..1a5c194f9 100644 --- a/lib/language_pack/helpers/nodebin.rb +++ b/lib/language_pack/helpers/nodebin.rb @@ -4,11 +4,10 @@ class LanguagePack::Helpers::Nodebin NODE_VERSION = "20.9.0" YARN_VERSION = "1.22.19" - def self.hardcoded_node_lts(arch: ) - arch = "x64" if arch == "amd64" + def self.hardcoded_node_lts { "number" => NODE_VERSION, - "url" => "https://nodejs.org/download/release/v#{NODE_VERSION}/node-v#{NODE_VERSION}-linux-#{arch}.tar.gz", + "url" => "https://heroku-nodebin.s3.us-east-1.amazonaws.com/node/release/linux-x64/node-v#{NODE_VERSION}-linux-x64.tar.gz" } end @@ -19,8 +18,8 @@ def self.hardcoded_yarn } end - def self.node_lts(arch: ) - hardcoded_node_lts(arch: arch) + def self.node_lts + hardcoded_node_lts end def self.yarn diff --git a/lib/language_pack/ruby.rb b/lib/language_pack/ruby.rb index 65612d7b5..ced465dc4 100644 --- a/lib/language_pack/ruby.rb +++ b/lib/language_pack/ruby.rb @@ -34,7 +34,7 @@ def bundler def initialize(*args) super(*args) - @node_installer = LanguagePack::Helpers::NodeInstaller.new(arch: @arch) + @node_installer = LanguagePack::Helpers::NodeInstaller.new @yarn_installer = LanguagePack::Helpers::YarnInstaller.new end diff --git a/spec/helpers/node_installer_spec.rb b/spec/helpers/node_installer_spec.rb index 3ba393bb2..dff419669 100644 --- a/spec/helpers/node_installer_spec.rb +++ b/spec/helpers/node_installer_spec.rb @@ -2,15 +2,13 @@ describe LanguagePack::Helpers::NodeInstaller do describe "#install" do - LanguagePack::Base::KNOWN_ARCHITECTURES.each do |arch| - it "should extract a node binary on #{arch}" do - Dir.mktmpdir do |dir| - Dir.chdir(dir) do - installer = LanguagePack::Helpers::NodeInstaller.new(arch: "arm64") - installer.install + it "should extract a node binary" do + Dir.mktmpdir do |dir| + Dir.chdir(dir) do + installer = LanguagePack::Helpers::NodeInstaller.new + installer.install - expect(File.exist?("node")).to be(true) - end + expect(File.exist?("node")).to be(true) end end end