Skip to content

Commit

Permalink
added 1.8.7 patch level 370 patch set
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kaes committed Sep 17, 2012
1 parent 0c8037e commit db81715
Show file tree
Hide file tree
Showing 22 changed files with 3,436 additions and 2 deletions.
20 changes: 18 additions & 2 deletions README.rdoc
Expand Up @@ -56,7 +56,8 @@ there's no guarantee. The following versions are currently supported:
1.8.7-p334 # not recommended, as p352 fixes a serious GC corruption problem
1.8.7-p352 # not recommended, use at least p358
1.8.7-p357 # fixes a DOS vulnerability in 1.8.7
1.8.7-p358 # current rvm default for MRI-ruby 1.8.7
1.8.7-p358 #
1.8.7-p370 # current rvm default for MRI-ruby 1.8.7
1.9.2-p180 #
1.9.2-p290 #
1.9.2-p318 #
Expand All @@ -78,6 +79,21 @@ To enable heap dump support, pass the --enable-gcdebug option to the rvm install

If rvm cannot configure your ruby, update your rvm install.

=== Installing on Mountain Lion

If you want to install versions eralier than 1.9.3, you must install gcc-4.2.

With MacPorts, this is as easy as

sudo port install appl-gcc42
sudo ln -s /opt/local/bin/ggc-apple-4.2 /usr/bin/gcc-4.2

Additionally, when compiling ruby, you need to set

CPPFLAGS=-I/opt/include

Script install.sh will set CPPFLAGS automatically for you.

=== Using patches for ruby-branches (1.8.7/1.9.3 only)

The most recent patch level on the ruby_1_8_7 branch is 360. If you want to use it, you
Expand All @@ -104,7 +120,7 @@ Instead, add new patches on top of the existing ones. Then they will have a chan

== Caveats

* The 1.9.3 patches heave not received a lot of testing. Use at your own risk!
* The 1.9.3 patches have not received a lot of testing. Use at your own risk!

== Credits

Expand Down
5 changes: 5 additions & 0 deletions install.sh
@@ -1,6 +1,11 @@
#!/bin/bash
find $rvm_path/patches $rvm_path/patchsets -name '*railsexpress*' | xargs rm -rf
cp -rp patches patchsets $rvm_path

if [[ "`uname -a`" =~ (Darwin Kernel Version 12) ]]; then
export CPPFLAGS=-I/opt/X11/include
fi

for i in "$@"; do
rvm reinstall $i --patch railsexpress
done
101 changes: 101 additions & 0 deletions patches/ruby/1.8.7/p370/railsexpress/01-ignore-generated-files.patch
@@ -0,0 +1,101 @@
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..00c347a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,95 @@
+.ext
+.installed.list
+.rbconfig.time
+Makefile
+autom4te.cache/
+config.h
+config.status
+configure
+ext/Win32API/Makefile
+ext/bigdecimal/Makefile
+ext/curses/Makefile
+ext/dbm/Makefile
+ext/digest/Makefile
+ext/digest/bubblebabble/Makefile
+ext/digest/md5/Makefile
+ext/digest/rmd160/Makefile
+ext/digest/sha1/Makefile
+ext/digest/sha2/Makefile
+ext/dl/Makefile
+ext/dl/call.func
+ext/dl/callback.func
+ext/dl/cbtable.func
+ext/dl/dlconfig.h
+ext/dl/dlconfig.rb
+ext/enumerator/Makefile
+ext/etc/Makefile
+ext/fcntl/Makefile
+ext/gdbm/Makefile
+ext/iconv/Makefile
+ext/io/wait/Makefile
+ext/nkf/Makefile
+ext/openssl/Makefile
+ext/openssl/extconf.h
+ext/pty/Makefile
+ext/racc/cparse/Makefile
+ext/readline/Makefile
+ext/sdbm/Makefile
+ext/socket/Makefile
+ext/stringio/Makefile
+ext/strscan/Makefile
+ext/syck/Makefile
+ext/syslog/Makefile
+ext/thread/Makefile
+ext/tk/Makefile
+ext/tk/tkutil/Makefile
+ext/win32ole/Makefile
+ext/win32ole/.document
+ext/zlib/Makefile
+largefile.h
+miniruby
+parse.c
+rbconfig.rb
+ruby
+enc.mk
+ext/bigdecimal/extconf.h
+ext/continuation/
+ext/coverage/
+ext/curses/extconf.h
+ext/dbm/extconf.h
+ext/digest/bubblebabble/extconf.h
+ext/digest/extconf.h
+ext/digest/md5/extconf.h
+ext/digest/rmd160/extconf.h
+ext/digest/sha1/extconf.h
+ext/digest/sha2/extconf.h
+ext/dl/callback.h
+ext/dl/extconf.h
+ext/etc/extconf.h
+ext/fcntl/extconf.h
+ext/fiber/
+ext/iconv/extconf.h
+ext/io/wait/extconf.h
+ext/json/
+ext/nkf/extconf.h
+ext/pty/extconf.h
+ext/racc/cparse/extconf.h
+ext/readline/extconf.h
+ext/ripper/
+ext/sdbm/extconf.h
+ext/socket/constants.h
+ext/socket/extconf.h
+ext/stringio/extconf.h
+ext/strscan/extconf.h
+ext/syck/extconf.h
+ext/syslog/extconf.h
+ext/tk/extconf.h
+ext/tk/tkutil/extconf.h
+ext/zlib/extconf.h
+miniprelude.c
+prelude.c
+revision.h
+*.dylib
+*.log
+*.dSYM
+patches-ruby*
139 changes: 139 additions & 0 deletions patches/ruby/1.8.7/p370/railsexpress/02-fix-tests-for-osx.patch
@@ -0,0 +1,139 @@
diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb
index bc16ab1..c12b168 100644
--- a/test/drb/drbtest.rb
+++ b/test/drb/drbtest.rb
@@ -22,7 +22,7 @@ class DRbService
%w(ut_drb.rb ut_array.rb ut_port.rb ut_large.rb ut_safe1.rb ut_eval.rb).each do |nm|
add_service_command(nm)
end
- @server = @@server = DRb::DRbServer.new('druby://localhost:0', @@manager, {})
+ @server = @@server = DRb::DRbServer.new('druby://127.0.0.1:0', @@manager, {})
@@manager.uri = @@server.uri
def self.manager
@@manager
@@ -79,16 +79,16 @@ module DRbCore
end

def test_00_DRbObject
- ro = DRbObject.new(nil, 'druby://localhost:12345')
- assert_equal('druby://localhost:12345', ro.__drburi)
+ ro = DRbObject.new(nil, 'druby://127.0.0.1:12345')
+ assert_equal('druby://127.0.0.1:12345', ro.__drburi)
assert_equal(nil, ro.__drbref)

- ro = DRbObject.new_with_uri('druby://localhost:12345')
- assert_equal('druby://localhost:12345', ro.__drburi)
+ ro = DRbObject.new_with_uri('druby://127.0.0.1:12345')
+ assert_equal('druby://127.0.0.1:12345', ro.__drburi)
assert_equal(nil, ro.__drbref)

- ro = DRbObject.new_with_uri('druby://localhost:12345?foobar')
- assert_equal('druby://localhost:12345', ro.__drburi)
+ ro = DRbObject.new_with_uri('druby://127.0.0.1:12345?foobar')
+ assert_equal('druby://127.0.0.1:12345', ro.__drburi)
assert_equal(DRb::DRbURIOption.new('foobar'), ro.__drbref)
end

diff --git a/test/drb/ut_drb.rb b/test/drb/ut_drb.rb
index f5720cf..265713d 100644
--- a/test/drb/ut_drb.rb
+++ b/test/drb/ut_drb.rb
@@ -154,7 +154,7 @@ if __FILE__ == $0

DRb::DRbServer.default_argc_limit(8)
DRb::DRbServer.default_load_limit(4096)
- DRb.start_service('druby://localhost:0', DRbEx.new)
+ DRb.start_service('druby://127.0.0.1:0', DRbEx.new)
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
end
diff --git a/test/drb/ut_drb_drbssl.rb b/test/drb/ut_drb_drbssl.rb
index 0a2191e..bca3012 100644
--- a/test/drb/ut_drb_drbssl.rb
+++ b/test/drb/ut_drb_drbssl.rb
@@ -18,7 +18,7 @@ if __FILE__ == $0

DRb::DRbServer.default_argc_limit(8)
DRb::DRbServer.default_load_limit(4096)
- DRb.start_service('drbssl://localhost:0', DRbEx.new, config)
+ DRb.start_service('drbssl://127.0.0.1:0', DRbEx.new, config)
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
end
diff --git a/test/drb/ut_eval.rb b/test/drb/ut_eval.rb
index 4df963e..9127939 100644
--- a/test/drb/ut_eval.rb
+++ b/test/drb/ut_eval.rb
@@ -3,7 +3,7 @@ require 'drb/extserv'

class EvalAttack
def initialize
- @four = DRb::DRbServer.new('druby://localhost:0', self, {:safe_level => 4})
+ @four = DRb::DRbServer.new('druby://127.0.0.1:0', self, {:safe_level => 4})
end

def four
@@ -25,7 +25,7 @@ if __FILE__ == $0

$SAFE = 1

- DRb.start_service('druby://localhost:0', EvalAttack.new, {:safe_level => 2})
+ DRb.start_service('druby://127.0.0.1:0', EvalAttack.new, {:safe_level => 2})
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
end
diff --git a/test/drb/ut_large.rb b/test/drb/ut_large.rb
index d6717c5..0aefd1b 100644
--- a/test/drb/ut_large.rb
+++ b/test/drb/ut_large.rb
@@ -31,7 +31,7 @@ if __FILE__ == $0

DRb::DRbServer.default_argc_limit(3)
DRb::DRbServer.default_load_limit(100000)
- DRb.start_service('druby://localhost:0', DRbLarge.new)
+ DRb.start_service('druby://127.0.0.1:0', DRbLarge.new)
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
end
diff --git a/test/drb/ut_safe1.rb b/test/drb/ut_safe1.rb
index 4df8e1e..5e7fe82 100644
--- a/test/drb/ut_safe1.rb
+++ b/test/drb/ut_safe1.rb
@@ -8,7 +8,7 @@ if __FILE__ == $0
it
end

- DRb.start_service('druby://localhost:0', [1, 2, 'III', 4, "five", 6],
+ DRb.start_service('druby://127.0.0.1:0', [1, 2, 'III', 4, "five", 6],

This comment has been minimized.

Copy link
@travistilley

travistilley Sep 25, 2012

Doesn't apply cleanly:

patching file test/drb/drbtest.rb
patching file test/drb/ut_drb.rb
patching file test/drb/ut_drb_drbssl.rb
patching file test/drb/ut_eval.rb
patching file test/drb/ut_large.rb
patching file test/drb/ut_safe1.rb
Hunk #1 FAILED at 8.
1 out of 1 hunk FAILED -- saving rejects to file test/drb/ut_safe1.rb.rej
patching file test/net/pop/test_pop.rb
{:safe_level => 1})
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
diff --git a/test/net/pop/test_pop.rb b/test/net/pop/test_pop.rb
index c8aa9a8..129ca08 100644
--- a/test/net/pop/test_pop.rb
+++ b/test/net/pop/test_pop.rb
@@ -3,10 +3,14 @@ require 'test/unit'
require 'digest/md5'

class TestPOP < Test::Unit::TestCase
+ def localhost
+ '127.0.0.1'
+ end
+
def setup
@users = {'user' => 'pass' }
@ok_user = 'user'
- @stamp_base = "#{$$}.#{Time.now.to_i}@localhost"
+ @stamp_base = "#{$$}.#{Time.now.to_i}@#{localhost}"
end

def test_pop_auth_ok
@@ -64,7 +68,7 @@ class TestPOP < Test::Unit::TestCase
end

def pop_test(apop=false)
- host = 'localhost'
+ host = localhost
server = TCPServer.new(host, 0)
port = server.addr[1]
thread = Thread.start do
25 changes: 25 additions & 0 deletions patches/ruby/1.8.7/p370/railsexpress/03-sigvtalrm-fix.patch
@@ -0,0 +1,25 @@
diff --git a/eval.c b/eval.c
index c2049c7..f49044a 100644
--- a/eval.c
+++ b/eval.c
@@ -12483,6 +12483,11 @@ rb_thread_start_0(fn, arg, th)
curr_thread->next = th;
th->priority = curr_thread->priority;
th->thgroup = curr_thread->thgroup;
+#if defined(HAVE_SETITIMER) || defined(_THREAD_SAFE)
+ if (!thread_init) {
+ rb_thread_start_timer();
+ }
+#endif
}
START_TIMER();

@@ -13211,7 +13216,9 @@ rb_thread_atfork()
main_thread = curr_thread;
curr_thread->next = curr_thread;
curr_thread->prev = curr_thread;
- STOP_TIMER();
+#if defined(HAVE_SETITIMER) || defined(_THREAD_SAFE)
+ rb_thread_stop_timer();
+#endif
}

0 comments on commit db81715

Please sign in to comment.