From cdb57da081701af98fcc5944dc8e174548f5584f Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 12 Oct 2025 15:59:55 +0100 Subject: [PATCH 1/2] ruby_{3_3,3_4}: backport patches for GCC 15 and LLVM 21 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ruby 3.5.0-preview1 is also affected, but it’s several months old and the patches do not apply cleanly to it. Hopefully that won’t be a big deal, since the fixes will be picked up on the next update. Closes: #449970 --- .../development/interpreters/ruby/default.nix | 36 +++++++++++++++---- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index d01980ee3a91..4b1ccdd4fdfa 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -183,13 +183,35 @@ let # make: *** [uncommon.mk:373: do-install-all] Error 1 enableParallelInstalling = false; - patches = op useBaseRuby ./do-not-update-gems-baseruby-3.2.patch ++ [ - # When using a baseruby, ruby always sets "libdir" to the build - # directory, which nix rejects due to a reference in to /build/ in - # the final product. Removing this reference doesn't seem to break - # anything and fixes cross compilation. - ./dont-refer-to-build-dir.patch - ]; + patches = + op useBaseRuby ./do-not-update-gems-baseruby-3.2.patch + ++ [ + # When using a baseruby, ruby always sets "libdir" to the build + # directory, which nix rejects due to a reference in to /build/ in + # the final product. Removing this reference doesn't seem to break + # anything and fixes cross compilation. + ./dont-refer-to-build-dir.patch + ] + ++ ops (lib.versionOlder ver.majMin "3.4") [ + (fetchpatch { + name = "ruby-3.3-fix-llvm-21.patch"; + url = "https://github.com/ruby/ruby/commit/5a8d7642168f4ea0d9331fded3033c225bbc36c5.patch"; + excludes = [ "version.h" ]; + hash = "sha256-dV98gXXTSKM2ZezTvhVXNaKaXJxiWKEeUbqqL360cWw="; + }) + ] + ++ ops (lib.versionAtLeast ver.majMin "3.4" && lib.versionOlder ver.majMin "3.5") [ + (fetchpatch { + name = "ruby-3.4-fix-gcc-15-llvm-21-1.patch"; + url = "https://github.com/ruby/ruby/commit/846bb760756a3bf1ab12d56d8909e104f16e6940.patch"; + hash = "sha256-+f0mzHsGAe9FT9NWE345BxzaB6vmWzMTvEfWF84uFOs="; + }) + (fetchpatch { + name = "ruby-3.4-fix-gcc-15-llvm-21-2.patch"; + url = "https://github.com/ruby/ruby/commit/18e176659e8afe402cab7d39972f2d56f2cf378f.patch"; + hash = "sha256-TKPG1hcC1G2WmUkvNV6QSnvUpTEDqrYKrIk/4fAS8QE="; + }) + ]; cargoRoot = opString yjitSupport "yjit"; From f0166da268940ec4a78504a83a15b61871eb1552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 13 Oct 2025 08:59:35 +0200 Subject: [PATCH 2/2] ruby: avoid rebuilding default ruby on linux for now --- pkgs/development/interpreters/ruby/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index 4b1ccdd4fdfa..348708f573a0 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -192,7 +192,8 @@ let # anything and fixes cross compilation. ./dont-refer-to-build-dir.patch ] - ++ ops (lib.versionOlder ver.majMin "3.4") [ + # TODO: drop the isClang condition + ++ ops (lib.versionOlder ver.majMin "3.4" && stdenv.cc.isClang) [ (fetchpatch { name = "ruby-3.3-fix-llvm-21.patch"; url = "https://github.com/ruby/ruby/commit/5a8d7642168f4ea0d9331fded3033c225bbc36c5.patch";