about summary refs log tree commit diff
path: root/pkgs/development/interpreters/ruby
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2023-04-30 14:56:44 +0800
committerNick Cao <nickcao@nichi.co>2023-04-30 14:58:53 +0800
commit6469970155d48f27ce333087f7ca9d6d88522ad3 (patch)
tree53c5e72cc46945733c74c2e2641911c7919ee5e8 /pkgs/development/interpreters/ruby
parent468356287fe4ce68f58fa5cf16e8ed6fc40a1a7f (diff)
ruby_3_2: only enable yjit on supported platforms
Diffstat (limited to 'pkgs/development/interpreters/ruby')
-rw-r--r--pkgs/development/interpreters/ruby/default.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix
index 702780b999b3a..806b1382bf9ef 100644
--- a/pkgs/development/interpreters/ruby/default.nix
+++ b/pkgs/development/interpreters/ruby/default.nix
@@ -23,6 +23,8 @@ let
     atLeast30 = lib.versionAtLeast ver.majMin "3.0";
     atLeast31 = lib.versionAtLeast ver.majMin "3.1";
     atLeast32 = lib.versionAtLeast ver.majMin "3.2";
+    # https://github.com/ruby/ruby/blob/v3_2_2/yjit.h#L21
+    yjitSupported = atLeast32 && (stdenv.hostPlatform.isx86_64 || (!stdenv.hostPlatform.isWindows && stdenv.hostPlatform.isAarch64));
     self = lib.makeOverridable (
       { stdenv, buildPackages, lib
       , fetchurl, fetchpatch, fetchFromSavannah, fetchFromGitHub
@@ -46,7 +48,7 @@ let
       #     $(nix-build -A ruby)/lib/ruby/2.6.0/x86_64-linux/rbconfig.rb
       # - In $out/lib/libruby.so and/or $out/lib/libruby.dylib
       , removeReferencesTo, jitSupport ? yjitSupport
-      , rustPlatform, yjitSupport ? atLeast32
+      , rustPlatform, yjitSupport ? yjitSupported
       , autoreconfHook, bison, autoconf
       , buildEnv, bundler, bundix
       , libiconv, libobjc, libunwind, Foundation