Skip to content

Commit 9ed6a36

Browse files
committed
New upstream version 2.7.1
1 parent b78a37b commit 9ed6a36

File tree

224 files changed

+23277
-20168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+23277
-20168
lines changed

ChangeLog

Lines changed: 13800 additions & 12267 deletions
Large diffs are not rendered by default.

appveyor.yml

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,10 @@ version: '{build}'
33
shallow_clone: true
44
platform:
55
- x64
6-
branches:
7-
except:
8-
- trunk # mirrored from trunk. avoid doubly building on it
96
environment:
107
ruby_version: "24-%Platform%"
118
zlib_version: "1.2.11"
129
matrix:
13-
# to reduce time for finishing all jobs, run the slowest msys2 build first.
14-
- build: msys2
15-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
16-
GEMS_FOR_TEST: "timezone tzinfo"
1710
- build: vs
1811
vs: 120
1912
ssl: OpenSSL
@@ -78,52 +71,6 @@ for:
7871
# separately execute tests without -j which may crash worker with -j.
7972
- nmake -l "TESTOPTS=-v --timeout-scale=3.0 --excludes=../test/excludes/_appveyor" test-all TESTS="../test/win32ole ../test/ruby/test_bignum.rb ../test/ruby/test_syntax.rb ../test/open-uri/test_open-uri.rb ../test/rubygems/test_bundled_ca.rb"
8073
- nmake -l test-spec MSPECOPT=-fs # not using `-j` because sometimes `mspec -j` silently dies on Windows
81-
-
82-
matrix:
83-
only:
84-
- build: msys2
85-
install:
86-
- ver
87-
- chcp
88-
- set /a JOBS=%NUMBER_OF_PROCESSORS%
89-
- set MSYS_NO_PATHCONV=1
90-
- SET MSYSTEM=%Platform:x86=32%
91-
- SET MSYSTEM=%MSYSTEM:x=MINGW%
92-
- SET MSYS2_ARCH=%Platform:x86=i686%
93-
- SET MSYS2_ARCH=%MSYS2_ARCH:x64=x86_64%
94-
- set MSYSTEM_PREFIX=/mingw64
95-
- set MINGW_CHOST=%MSYS2_ARCH%-w64-mingw32
96-
- SET ruby_path=C:\Ruby%ruby_version:-x86=%
97-
- cd ..
98-
- mkdir build
99-
- mkdir install
100-
- SET PATH=%ruby_path%\bin;C:\msys64\%MSYSTEM%\bin;C:\msys64\usr\bin;%PATH%
101-
- ruby --version
102-
build_script:
103-
- pacman -Syd --noconfirm --noprogressbar --needed mingw-w64-x86_64-binutils mingw-w64-x86_64-isl mingw-w64-x86_64-libiconv mingw-w64-x86_64-mpc mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-windows-default-manifest mingw-w64-x86_64-winpthreads mingw-w64-x86_64-gcc
104-
# when fixed in MSYS2 / Mingw-w64, remove above and use normal code below
105-
#- pacman -Sy --noconfirm --noprogressbar --needed mingw-w64-x86_64-toolchain
106-
- pacman -S --noconfirm --noprogressbar --needed mingw-w64-x86_64-gdbm mingw-w64-x86_64-gmp mingw-w64-x86_64-libffi mingw-w64-x86_64-libyaml mingw-w64-x86_64-openssl mingw-w64-x86_64-ragel mingw-w64-x86_64-readline mingw-w64-x86_64-zlib
107-
- cd %APPVEYOR_BUILD_FOLDER%
108-
- set CFLAGS=-march=%MSYS2_ARCH:_=-% -mtune=generic -O3 -pipe
109-
- set CXXFLAGS=%CFLAGS%
110-
- set CPPFLAGS=-D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048
111-
- set LDFLAGS=-pipe
112-
- sh -c "autoreconf -fi"
113-
- cd ..\build
114-
- sh ../ruby/configure --disable-install-doc --prefix=/. --build=%MINGW_CHOST% --host=%MINGW_CHOST% --target=%MINGW_CHOST%
115-
- mingw32-make %mflags% touch-unicode-files
116-
- mingw32-make -j%JOBS% %UPDATE_UNICODE% up incs
117-
- mingw32-make -j%JOBS% V=1
118-
- mingw32-make DESTDIR=../install install-nodoc
119-
- if not "%GEMS_FOR_TEST%" == "" ..\install\bin\gem install --no-document %GEMS_FOR_TEST%
120-
- ..\install\bin\ruby.exe -v -ropenssl -e "puts 'Build ' + OpenSSL::OPENSSL_VERSION, 'Runtime ' + OpenSSL::OPENSSL_LIBRARY_VERSION"
121-
test_script:
122-
- mingw32-make test
123-
- mingw32-make test-all TESTOPTS="--retry --job-status=normal --show-skip --timeout-scale=1.5 --excludes=../ruby/test/excludes/_appveyor -j %JOBS% --exclude win32ole --exclude test_open-uri"
124-
# separately execute tests without -j which may crash worker with -j.
125-
- mingw32-make test-all TESTOPTS="--retry --job-status=normal --show-skip --timeout-scale=1.5 --excludes=../ruby/test/excludes/_appveyor" TESTS="../ruby/test/win32ole ../ruby/test/open-uri/test_open-uri.rb"
126-
- mingw32-make test-spec MSPECOPT=-fs # not using `-j` because sometimes `mspec -j` silently dies on Windows
12774
notifications:
12875
# Using "Webhook" with templated body to skip notification on Pull Request
12976
- provider: Webhook

common.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3037,6 +3037,7 @@ transcode.$(OBJEXT): {$(VPATH)}assert.h
30373037
transcode.$(OBJEXT): {$(VPATH)}config.h
30383038
transcode.$(OBJEXT): {$(VPATH)}defines.h
30393039
transcode.$(OBJEXT): {$(VPATH)}encoding.h
3040+
transcode.$(OBJEXT): {$(VPATH)}id.h
30403041
transcode.$(OBJEXT): {$(VPATH)}intern.h
30413042
transcode.$(OBJEXT): {$(VPATH)}internal.h
30423043
transcode.$(OBJEXT): {$(VPATH)}missing.h

cont.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,15 @@ cont_save_thread(rb_context_t *cont, rb_thread_t *th)
10961096
sec->machine.stack_end = NULL;
10971097
}
10981098

1099+
static void
1100+
cont_init_mjit_cont(rb_context_t *cont)
1101+
{
1102+
VM_ASSERT(cont->mjit_cont == NULL);
1103+
if (mjit_enabled) {
1104+
cont->mjit_cont = mjit_cont_new(&(cont->saved_ec));
1105+
}
1106+
}
1107+
10991108
static void
11001109
cont_init(rb_context_t *cont, rb_thread_t *th)
11011110
{
@@ -1105,9 +1114,7 @@ cont_init(rb_context_t *cont, rb_thread_t *th)
11051114
cont->saved_ec.local_storage = NULL;
11061115
cont->saved_ec.local_storage_recursive_hash = Qnil;
11071116
cont->saved_ec.local_storage_recursive_hash_for_trace = Qnil;
1108-
if (mjit_enabled) {
1109-
cont->mjit_cont = mjit_cont_new(&cont->saved_ec);
1110-
}
1117+
cont_init_mjit_cont(cont);
11111118
}
11121119

11131120
static rb_context_t *
@@ -1124,6 +1131,14 @@ cont_new(VALUE klass)
11241131
return cont;
11251132
}
11261133

1134+
void
1135+
rb_fiber_init_mjit_cont(struct rb_fiber_struct *fiber)
1136+
{
1137+
// Currently this function is meant for root_fiber. Others go through cont_new.
1138+
// XXX: Is this mjit_cont `mjit_cont_free`d?
1139+
cont_init_mjit_cont(&fiber->cont);
1140+
}
1141+
11271142
#if 0
11281143
void
11291144
show_vm_stack(const rb_execution_context_t *ec)

doc/syntax/methods.rdoc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,23 @@ converted to an Array:
379379

380380
gather_arguments 1, 2, 3 # prints [1, 2, 3]
381381

382-
The array argument must be the last positional argument, it must appear before
383-
any keyword arguments.
382+
The array argument must appear before any keyword arguments.
383+
384+
It is possible to gather arguments at the beginning or in the middle:
385+
386+
def gather_arguments(first_arg, *middle_arguments, last_arg)
387+
p middle_arguments
388+
end
389+
390+
gather_arguments 1, 2, 3, 4 # prints [2, 3]
384391

385392
The array argument will capture a Hash as the last entry if a hash was sent by
386393
the caller after all positional arguments.
387394

395+
def gather_arguments(*arguments)
396+
p arguments
397+
end
398+
388399
gather_arguments 1, a: 2 # prints [1, {:a=>2}]
389400

390401
However, this only occurs if the method does not declare any keyword arguments.

eval.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
NORETURN(void rb_raise_jump(VALUE, VALUE));
2828
void rb_ec_clear_current_thread_trace_func(const rb_execution_context_t *ec);
29+
void rb_ec_clear_all_trace_func(const rb_execution_context_t *ec);
2930

3031
static int rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex);
3132
static int rb_ec_exec_node(rb_execution_context_t *ec, void *n);
@@ -140,7 +141,7 @@ rb_ec_teardown(rb_execution_context_t *ec)
140141
}
141142
EC_POP_TAG();
142143
rb_ec_exec_end_proc(ec);
143-
rb_ec_clear_current_thread_trace_func(ec);
144+
rb_ec_clear_all_trace_func(ec);
144145
}
145146

146147
static void

ext/-test-/cxxanyargs/extconf.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,7 @@
2727
$cleanfiles << "$(FAILURES:.cpp=.failed)"
2828
create_makefile("-test-/cxxanyargs") do |mk|
2929
mk << "FAILURES #{['=', failures].join(' ')}\n"
30+
mk << ".IGNORE: $(FAILURES:.cpp=.o)\n" unless $mswin
31+
mk
3032
end
3133
end

ext/-test-/tracepoint/gc_hook.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,16 @@ set_after_gc_start(VALUE module, VALUE proc)
7373
"__set_after_gc_start_tpval__", "__set_after_gc_start_proc__");
7474
}
7575

76+
static VALUE
77+
start_after_gc_exit(VALUE module, VALUE proc)
78+
{
79+
return set_gc_hook(module, proc, RUBY_INTERNAL_EVENT_GC_EXIT,
80+
"__set_after_gc_exit_tpval__", "__set_after_gc_exit_proc__");
81+
}
82+
7683
void
7784
Init_gc_hook(VALUE module)
7885
{
7986
rb_define_module_function(module, "after_gc_start_hook=", set_after_gc_start, 1);
87+
rb_define_module_function(module, "after_gc_exit_hook=", start_after_gc_exit, 1);
8088
}

ext/fiddle/extlibs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
http://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz \
1+
https://ftp.osuosl.org/pub/blfs/conglomeration/libffi/libffi-3.2.1.tar.gz \
22
md5:83b89587607e3eb65c70d361f13bab43 \
33
sha512:980ca30a8d76f963fca722432b1fe5af77d7a4e4d2eac5144fbc5374d4c596609a293440573f4294207e1bdd9fda80ad1e1cafb2ffb543df5a275bc3bd546483 \
44
#

ext/io/console/console.c

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ rawmode_opt(int *argcp, VALUE *argv, int min_argc, int max_argc, rawmode_arg_t *
111111
int argc = *argcp;
112112
rawmode_arg_t *optp = NULL;
113113
VALUE vopts = Qnil;
114+
#ifdef RB_SCAN_ARGS_PASS_CALLED_KEYWORDS
115+
argc = rb_scan_args(argc, argv, "*:", NULL, &vopts);
116+
#else
114117
if (argc > min_argc) {
115118
vopts = rb_check_hash_type(argv[argc-1]);
116119
if (!NIL_P(vopts)) {
@@ -120,6 +123,7 @@ rawmode_opt(int *argcp, VALUE *argv, int min_argc, int max_argc, rawmode_arg_t *
120123
if (!vopts) vopts = Qnil;
121124
}
122125
}
126+
#endif
123127
rb_check_arity(argc, min_argc, max_argc);
124128
if (!NIL_P(vopts)) {
125129
VALUE vmin = rb_hash_aref(vopts, ID2SYM(id_min));
@@ -188,8 +192,9 @@ set_rawmode(conmode *t, void *arg)
188192
#endif
189193
#ifdef ISIG
190194
if (r->intr) {
191-
t->c_iflag |= BRKINT|IXON;
195+
t->c_iflag |= BRKINT;
192196
t->c_lflag |= ISIG;
197+
t->c_oflag |= OPOST;
193198
}
194199
#endif
195200
(void)r;
@@ -355,9 +360,9 @@ ttymode_with_io(VALUE io, VALUE (*func)(VALUE, VALUE), VALUE farg, void (*setter
355360

356361
/*
357362
* call-seq:
358-
* io.raw(min: nil, time: nil) {|io| }
363+
* io.raw(min: nil, time: nil, intr: nil) {|io| }
359364
*
360-
* Yields +self+ within raw mode.
365+
* Yields +self+ within raw mode, and returns the result of the block.
361366
*
362367
* STDIN.raw(&:gets)
363368
*
@@ -369,6 +374,9 @@ ttymode_with_io(VALUE io, VALUE (*func)(VALUE, VALUE), VALUE farg, void (*setter
369374
* The parameter +time+ specifies the timeout in _seconds_ with a
370375
* precision of 1/10 of a second. (default: 0)
371376
*
377+
* If the parameter +intr+ is +true+, enables break, interrupt, quit,
378+
* and suspend special characters.
379+
*
372380
* Refer to the manual page of termios for further details.
373381
*
374382
* You must require 'io/console' to use this method.
@@ -382,11 +390,11 @@ console_raw(int argc, VALUE *argv, VALUE io)
382390

383391
/*
384392
* call-seq:
385-
* io.raw!(min: nil, time: nil)
393+
* io.raw!(min: nil, time: nil, intr: nil) -> io
386394
*
387-
* Enables raw mode.
395+
* Enables raw mode, and returns +io+.
388396
*
389-
* If the terminal mode needs to be back, use io.raw { ... }.
397+
* If the terminal mode needs to be back, use <code>io.raw { ... }</code>.
390398
*
391399
* See IO#raw for details on the parameters.
392400
*
@@ -482,7 +490,7 @@ nogvl_getch(void *p)
482490

483491
/*
484492
* call-seq:
485-
* io.getch(min: nil, time: nil) -> char
493+
* io.getch(min: nil, time: nil, intr: nil) -> char
486494
*
487495
* Reads and returns a character in raw mode.
488496
*
@@ -1489,7 +1497,7 @@ console_dev(int argc, VALUE *argv, VALUE klass)
14891497

14901498
/*
14911499
* call-seq:
1492-
* io.getch(min: nil, time: nil) -> char
1500+
* io.getch(min: nil, time: nil, intr: nil) -> char
14931501
*
14941502
* See IO#getch.
14951503
*/

0 commit comments

Comments
 (0)