ruby: remove insecure 1.8.7, fixes #11194

1.8.x is unsupported and is probably insecure.

This also simplifies things a little bit

authored by zimbatm.tngl.sh and committed by Rok Garbas ad2a4ab2 e7cd9077

+14 -148
+7
nixos/doc/manual/release-notes/rl-unstable.xml
··· 82 82 </para> 83 83 </listitem> 84 84 85 + <listitem> 86 + <para><command>ruby_1_8</command> has been removed as it's not 87 + supported from upstream anymore and probably contains security 88 + issues. 89 + </para> 90 + </listitem> 91 + 85 92 </itemizedlist> 86 93 87 94 </section>
+2 -4
pkgs/development/interpreters/ruby/bundler-env/default.nix
··· 88 88 require 'rubygems/package' 89 89 require 'fileutils' 90 90 91 - if defined?(Encoding.default_internal) 92 - Encoding.default_internal = Encoding::UTF_8 93 - Encoding.default_external = Encoding::UTF_8 94 - end 91 + Encoding.default_internal = Encoding::UTF_8 92 + Encoding.default_external = Encoding::UTF_8 95 93 96 94 if Gem::VERSION < '2.0' 97 95 load "${./package-1.8.rb}"
+5 -17
pkgs/development/interpreters/ruby/default.nix
··· 18 18 else versionNoPatch; 19 19 tag = "v" + stdenv.lib.replaceChars ["." "p" "-"] ["_" "_" ""] fullVersionName; 20 20 isRuby21 = majorVersion == "2" && minorVersion == "1"; 21 - isRuby18 = majorVersion == "1" && minorVersion == "8"; 22 21 baseruby = self.override { useRailsExpress = false; }; 23 22 self = lib.makeOverridable ( 24 23 { stdenv, lib, fetchurl, fetchFromSavannah, fetchFromGitHub ··· 64 63 # support is disabled (if it's enabled, we already have it) and we're 65 64 # running on darwin 66 65 ++ (op (!cursesSupport && stdenv.isDarwin) readline) 67 - ++ (ops stdenv.isDarwin (with darwin; [ libiconv libobjc libunwind ])) 68 - ++ op isRuby18 autoconf; 66 + ++ (ops stdenv.isDarwin (with darwin; [ libiconv libobjc libunwind ])); 69 67 70 68 enableParallelBuilding = true; 71 69 ··· 77 75 rm "$sourceRoot/enc/unicode/name2ctype.h" 78 76 ''; 79 77 80 - postPatch = opString (!isRuby18) (if isRuby21 then '' 78 + postPatch = if isRuby21 then '' 81 79 rm tool/config_files.rb 82 80 cp ${config}/config.guess tool/ 83 81 cp ${config}/config.sub tool/ 84 - '' else opString useRailsExpress '' 82 + '' 83 + else opString useRailsExpress '' 85 84 sed -i configure.in -e '/config.guess/d' 86 85 cp ${config}/config.guess tool/ 87 86 cp ${config}/config.sub tool/ 88 - ''); 87 + ''; 89 88 90 89 configureFlags = ["--enable-shared" "--enable-pthread"] 91 90 ++ op useRailsExpress "--with-baseruby=${baseruby}/bin/ruby" ··· 136 135 ) args; in self; 137 136 138 137 in { 139 - ruby_1_8_7 = generic { 140 - majorVersion = "1"; 141 - minorVersion = "8"; 142 - teenyVersion = "7"; 143 - patchLevel = "374"; 144 - sha256 = { 145 - src = "0v17cmm95f3xwa4kvza8xwbnfvfqcrym8cvqfvscn45bxsmfwvl7"; 146 - git = "1xddhxr0j26hpxfixvhqdscwk2ri846w2129fcfwfjzvy19igswx"; 147 - }; 148 - }; 149 - 150 138 ruby_1_9_3 = generic { 151 139 majorVersion = "1"; 152 140 minorVersion = "9";
-19
pkgs/development/interpreters/ruby/patchsets.nix
··· 1 1 { patchSet, useRailsExpress, ops, patchLevel }: 2 2 3 3 let self = rec { 4 - "1.8.7" = [ 5 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/01-ignore-generated-files.patch" 6 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/02-fix-tests-for-osx.patch" 7 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/03-sigvtalrm-fix.patch" 8 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/04-railsbench-gc-patch.patch" 9 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/05-display-full-stack-trace.patch" 10 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/06-better-source-file-tracing.patch" 11 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/07-heap-dump-support.patch" 12 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/08-fork-support-for-gc-logging.patch" 13 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/09-track-malloc-size.patch" 14 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/10-track-object-allocation.patch" 15 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/11-expose-heap-slots.patch" 16 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/12-fix-heap-size-growth-logic.patch" 17 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/13-heap-slot-size.patch" 18 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/14-add-trace-stats-enabled-methods.patch" 19 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/15-track-live-dataset-size.patch" 20 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/16-add-object-size-information-to-heap-dump.patch" 21 - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/17-caller-for-all-threads.patch" 22 - ]; 23 4 "1.9.3" = [ 24 5 ./ruby19-parallel-install.patch 25 6 ./bitperfect-rdoc.patch
-104
pkgs/development/interpreters/ruby/ruby-1.8.7.nix
··· 1 - { stdenv, lib, fetchurl, fetchFromGitHub 2 - , zlib, zlibSupport ? true 3 - , openssl, opensslSupport ? true 4 - , gdbm, gdbmSupport ? true 5 - , ncurses, readline, cursesSupport ? true 6 - , groff, docSupport ? false 7 - , ruby_1_8_7, autoreconfHook, bison, useRailsExpress ? true 8 - }: 9 - 10 - let 11 - op = stdenv.lib.optional; 12 - ops = stdenv.lib.optionals; 13 - patchSet = import ./rvm-patchsets.nix { inherit fetchFromGitHub; }; 14 - baseruby = ruby_1_8_7.override { useRailsExpress = false; }; 15 - in 16 - 17 - stdenv.mkDerivation rec { 18 - version = with passthru; "${majorVersion}.${minorVersion}.${teenyVersion}-p${patchLevel}"; 19 - 20 - name = "ruby-${version}"; 21 - 22 - src = if useRailsExpress then fetchFromGitHub { 23 - owner = "ruby"; 24 - repo = "ruby"; 25 - rev = "v1_8_7_${passthru.patchLevel}"; 26 - sha256 = "1xddhxr0j26hpxfixvhqdscwk2ri846w2129fcfwfjzvy19igswx"; 27 - } else fetchurl { 28 - url = "http://cache.ruby-lang.org/pub/ruby/1.8/${name}.tar.bz2"; 29 - sha256 = "1qq7khilwkayrhwmzlxk83scrmiqfi7lgsn4c63znyvz2c1lgqxl"; 30 - }; 31 - 32 - # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds. 33 - NROFF = "${groff}/bin/nroff"; 34 - 35 - buildInputs = ops useRailsExpress [ autoreconfHook bison ] 36 - ++ (ops cursesSupport [ ncurses readline ] ) 37 - ++ (op docSupport groff ) 38 - ++ (op zlibSupport zlib) 39 - ++ (op opensslSupport openssl) 40 - ++ (op gdbmSupport gdbm); 41 - 42 - patches = ops useRailsExpress [ 43 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/01-ignore-generated-files.patch" 44 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/02-fix-tests-for-osx.patch" 45 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/03-sigvtalrm-fix.patch" 46 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/04-railsbench-gc-patch.patch" 47 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/05-display-full-stack-trace.patch" 48 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/06-better-source-file-tracing.patch" 49 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/07-heap-dump-support.patch" 50 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/08-fork-support-for-gc-logging.patch" 51 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/09-track-malloc-size.patch" 52 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/10-track-object-allocation.patch" 53 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/11-expose-heap-slots.patch" 54 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/12-fix-heap-size-growth-logic.patch" 55 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/13-heap-slot-size.patch" 56 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/14-add-trace-stats-enabled-methods.patch" 57 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/15-track-live-dataset-size.patch" 58 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/16-add-object-size-information-to-heap-dump.patch" 59 - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/17-caller-for-all-threads.patch" 60 - ]; 61 - 62 - configureFlags = [ "--enable-shared" "--enable-pthread" ] 63 - # Without this fails due to not finding X11/Xlib.h 64 - # Not sure why this isn't required on Linux 65 - ++ ops stdenv.isDarwin [ "--without-tcl" "--without-tk" ] 66 - ++ op useRailsExpress "--with-baseruby=${baseruby}/bin/ruby"; 67 - 68 - installFlags = stdenv.lib.optionalString docSupport "install-doc"; 69 - 70 - postInstall = '' 71 - # Bundler tries to create this directory 72 - mkdir -pv $out/${passthru.gemPath} 73 - mkdir -p $out/nix-support 74 - cat > $out/nix-support/setup-hook <<EOF 75 - addGemPath() { 76 - addToSearchPath GEM_PATH \$1/${passthru.gemPath} 77 - } 78 - 79 - envHooks+=(addGemPath) 80 - EOF 81 - '' + lib.optionalString useRailsExpress '' 82 - rbConfig=$(find $out/lib/ruby -name rbconfig.rb) 83 - 84 - # Prevent the baseruby from being included in the closure. 85 - sed -i '/^ CONFIG\["BASERUBY"\]/d' $rbConfig 86 - sed -i "s|'--with-baseruby=${baseruby}/bin/ruby'||" $rbConfig 87 - ''; 88 - 89 - meta = { 90 - license = stdenv.lib.licenses.ruby; 91 - homepage = "http://www.ruby-lang.org/en/"; 92 - description = "The Ruby language"; 93 - }; 94 - 95 - passthru = rec { 96 - majorVersion = "1"; 97 - minorVersion = "8"; 98 - teenyVersion = "7"; 99 - patchLevel = "374"; 100 - rubyEngine = "ruby"; 101 - libPath = "lib/${rubyEngine}/${majorVersion}.${minorVersion}.${teenyVersion}"; 102 - gemPath = "lib/${rubyEngine}/gems/${majorVersion}.${minorVersion}.${teenyVersion}"; 103 - }; 104 - }
-4
pkgs/top-level/all-packages.nix
··· 5216 5216 buildRubyGem = callPackage ../development/interpreters/ruby/gem.nix { }; 5217 5217 bundlerEnv = callPackage ../development/interpreters/ruby/bundler-env { }; 5218 5218 5219 - ruby_1_8_7 = callPackage ../development/interpreters/ruby/ruby-1.8.7.nix { }; 5220 5219 inherit (callPackage ../development/interpreters/ruby {}) 5221 - # TODO: uncomment when ruby_1_8_7 doesn't need autoconf 5222 - # ruby_1_8_7 5223 5220 ruby_1_9_3 5224 5221 ruby_2_0_0 5225 5222 ruby_2_1_0 ruby_2_1_1 ruby_2_1_2 ruby_2_1_3 ruby_2_1_6 ··· 5227 5224 5228 5225 # Ruby aliases 5229 5226 ruby = ruby_2_2; 5230 - ruby_1_8 = ruby_1_8_7; 5231 5227 ruby_1_9 = ruby_1_9_3; 5232 5228 ruby_2_0 = ruby_2_0_0; 5233 5229 ruby_2_1 = ruby_2_1_6;