Skip to content

Commit

Permalink
Revert "Add ARM support for NodeJS (#1499)"
Browse files Browse the repository at this point in the history
This reverts commit 56199b2.
  • Loading branch information
schneems committed Nov 6, 2024
1 parent 35e96df commit 989c7f7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## [Unreleased]

- Support Node.js on ARM builds (https://github.com/heroku/heroku-buildpack-ruby/pull/1499)

## [v280] - 2024-11-06

Expand Down
11 changes: 8 additions & 3 deletions lib/language_pack/helpers/node_installer.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
9 changes: 4 additions & 5 deletions lib/language_pack/helpers/nodebin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/language_pack/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 6 additions & 8 deletions spec/helpers/node_installer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 989c7f7

Please sign in to comment.