summary refs log tree commit diff
path: root/pkgs/development/interpreters/ruby
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2021-05-01 21:56:15 -0500
committerGitHub <noreply@github.com>2021-05-01 21:56:15 -0500
commit92bff24dc157218068c10300f4b8af7db7af0fd6 (patch)
tree90191deabedf1288825985d4883a7da43900ab29 /pkgs/development/interpreters/ruby
parent68f651481bccd464a75d804827845b59b7f4ae69 (diff)
parent6852f66506e4fbeb42ea2d910e1ae85781e55a23 (diff)
downloadnixpkgs-92bff24dc157218068c10300f4b8af7db7af0fd6.tar
nixpkgs-92bff24dc157218068c10300f4b8af7db7af0fd6.tar.gz
nixpkgs-92bff24dc157218068c10300f4b8af7db7af0fd6.tar.bz2
nixpkgs-92bff24dc157218068c10300f4b8af7db7af0fd6.tar.lz
nixpkgs-92bff24dc157218068c10300f4b8af7db7af0fd6.tar.xz
nixpkgs-92bff24dc157218068c10300f4b8af7db7af0fd6.tar.zst
nixpkgs-92bff24dc157218068c10300f4b8af7db7af0fd6.zip
Merge pull request #119506 from marsam/ruby-disable-jit
ruby: build without jit by default
Diffstat (limited to 'pkgs/development/interpreters/ruby')
-rw-r--r--pkgs/development/interpreters/ruby/default.nix16
1 files changed, 5 insertions, 11 deletions
diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix
index 6f335039ebe..9179866fe9e 100644
--- a/pkgs/development/interpreters/ruby/default.nix
+++ b/pkgs/development/interpreters/ruby/default.nix
@@ -55,13 +55,7 @@ let
       #   Or (usually):
       #     $(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
-      #
-      # Since some Gems require JIT support, there's probably no
-      # escape from this reference. Hence, it was decided to enable this
-      # feature by default, as it's enabled by default by ruby's ./configure
-      # script. If you'd like to have a ruby without reference to cc, setting
-      # jitSupport to false should remove all known references mentioned above.
-      , removeReferencesTo, jitSupport ? true
+      , removeReferencesTo, jitSupport ? false
       , autoreconfHook, bison, autoconf
       , buildEnv, bundler, bundix
       , libiconv, libobjc, libunwind, Foundation
@@ -177,8 +171,9 @@ let
         installFlags = lib.optional docSupport "install-doc";
         # Bundler tries to create this directory
         postInstall = ''
+          rbConfig=$(find $out/lib/ruby -name rbconfig.rb)
           # Remove unnecessary groff reference from runtime closure, since it's big
-          sed -i '/NROFF/d' $out/lib/ruby/*/*/rbconfig.rb
+          sed -i '/NROFF/d' $rbConfig
           ${
             lib.optionalString (!jitSupport) ''
               # Get rid of the CC runtime dependency
@@ -187,7 +182,8 @@ let
                 $out/lib/libruby*
               ${removeReferencesTo}/bin/remove-references-to \
                 -t ${stdenv.cc} \
-                $out/${passthru.libPath}/${stdenv.hostPlatform.system}/rbconfig.rb
+                $rbConfig
+              sed -i '/CC_VERSION_MESSAGE/d' $rbConfig
             ''
           }
           # Bundler tries to create this directory
@@ -205,8 +201,6 @@ let
           addEnvHooks "$hostOffset" addGemPath
           addEnvHooks "$hostOffset" addRubyLibPath
           EOF
-
-          rbConfig=$(find $out/lib/ruby -name rbconfig.rb)
         '' + opString docSupport ''
           # Prevent the docs from being included in the closure
           sed -i "s|\$(DESTDIR)$devdoc|\$(datarootdir)/\$(RI_BASE_NAME)|" $rbConfig