From 2da5872b72f7986913ff37eb0d782a4f04cdc83e Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 7 Jun 2020 10:18:16 +0300 Subject: [PATCH 1/3] ruby: Enable to disable JIT support --- pkgs/development/interpreters/ruby/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index 1756c13b53d1..e21d765e7b91 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -37,6 +37,7 @@ let , fetchurl, fetchpatch, fetchFromSavannah, fetchFromGitHub , useRailsExpress ? true , rubygemsSupport ? true + , JitSupport ? true , zlib, zlibSupport ? true , openssl, opensslSupport ? true , gdbm, gdbmSupport ? true @@ -118,6 +119,7 @@ let configureFlags = ["--enable-shared" "--enable-pthread" "--with-soname=ruby_${tag}"] ++ op useRailsExpress "--with-baseruby=${baseruby}/bin/ruby" + ++ op (!JitSupport) "--disable-jit-support" ++ op (!docSupport) "--disable-install-doc" ++ ops stdenv.isDarwin [ # on darwin, we have /usr/include/tk.h -- so the configure script detects From 0ab3c6b7d00a33d3412867f74f83ebe9fe709cdb Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 7 Jun 2020 10:19:16 +0300 Subject: [PATCH 2/3] ruby: make removeReferencesToCC remove all cc refs `lib/ruby/${version}//rbconfig.rb` records the compiler used for JIT. --- pkgs/development/interpreters/ruby/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index e21d765e7b91..bea64fa7a776 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -157,6 +157,9 @@ let ${removeReferencesTo}/bin/remove-references-to \ -t ${stdenv.cc} \ $out/lib/libruby* + ${removeReferencesTo}/bin/remove-references-to \ + -t ${stdenv.cc} \ + $out/lib/ruby/${version}/${stdenv.targetPlatform.system}/rbconfig.rb '' } # Bundler tries to create this directory From bb8ea1384097210b942bd5333f97794df5a730b4 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 7 Jun 2020 10:31:58 +0300 Subject: [PATCH 3/3] rubyMinimal: Disable JIT support and remove cc refs To make rubyMinimal truely minimal, it shouldn't reference stdenv.cc --- pkgs/development/interpreters/ruby/default.nix | 2 +- pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index bea64fa7a776..1e6a81373bb5 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -159,7 +159,7 @@ let $out/lib/libruby* ${removeReferencesTo}/bin/remove-references-to \ -t ${stdenv.cc} \ - $out/lib/ruby/${version}/${stdenv.targetPlatform.system}/rbconfig.rb + $out/${passthru.libPath}/${stdenv.targetPlatform.system}/rbconfig.rb '' } # Bundler tries to create this directory diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b2b95da052c2..b963674d1e55 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9777,6 +9777,8 @@ in rubyMinimal = ruby.override { # gem support is minimal overhead rubygemsSupport = true; + removeReferenceToCC = true; + JitSupport = false; useRailsExpress = false; zlibSupport = false; opensslSupport = false;