From 55d12fe1fce32b9c72c109793b91385d80b25407 Mon Sep 17 00:00:00 2001 From: Andrew Hayworth Date: Thu, 23 Feb 2023 21:46:24 -0600 Subject: [PATCH] Allow ruby bindings on arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While fixing the gem build, I noticed that the gem will not run on arm64 machines, like the new spiffy M1/M2 MacBooks. On a whim, I tried just removing that restriction... and it does seem to work: ``` foundationdb/bindings/ruby/lib on  ahayworth/fix-ruby-binding-build [?] via 💎 v3.2.1 took 2s zsh ❯ pry [1] pry(main)> require 'fdb' => true [2] pry(main)> FDB.api_version 720 LoadError: FoundationDB API only supported on x86_64 (not arm64) from /Users/andrew/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/fdb-7.3.0/lib/fdbimpl.rb:40:in `' [3] pry(main)> ``` --- bindings/ruby/lib/fdbimpl.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/ruby/lib/fdbimpl.rb b/bindings/ruby/lib/fdbimpl.rb index c679f004bc..98420177f3 100644 --- a/bindings/ruby/lib/fdbimpl.rb +++ b/bindings/ruby/lib/fdbimpl.rb @@ -36,8 +36,8 @@ module FDB module FDBC require 'rbconfig' - if RbConfig::CONFIG['host_cpu'] != "x86_64" - raise LoadError, "FoundationDB API only supported on x86_64 (not #{RbConfig::CONFIG['host_cpu']})" + unless ["x86_64", "arm64"].include? RbConfig::CONFIG['host_cpu'] + raise LoadError, "FoundationDB API only supported on x86_64 and arm64 (not #{RbConfig::CONFIG['host_cpu']})" end case RbConfig::CONFIG['host_os']