Граф коммитов

65332 Коммитов

Автор SHA1 Сообщение Дата
git 4c4c0043b8 * 2021-02-19 [ci skip] 2021-02-19 16:41:44 +09:00
Shugo Maeda 5de38c41ae
ripper: fix a bug of Ripper::Lexer with syntax error and heredoc [Bug #17644] 2021-02-19 16:40:29 +09:00
Koichi Sasada 7b9476fbfa Ractor.allocate should not be allowed
Ractor.allocate and Ractor#dup should not be allowed like Thread.
[Bug #17642]
2021-02-18 22:35:34 +09:00
Nobuyoshi Nakada 9a5da2dcff [ruby/readline-ext] Initialize libedit before managing the history
Fixes https://bugs.ruby-lang.org/issues/17629

https://github.com/ruby/readline-ext/commit/250d6787ed
2021-02-18 21:18:37 +09:00
Nobuyoshi Nakada 9110021fd2 [ruby/readline-ext] Use omit
https://github.com/ruby/readline-ext/commit/f6dff0a9f6
2021-02-18 21:17:42 +09:00
Koichi Sasada 07ab172ebe sync check_rvalue_consistency_force()
check_rvalue_consistency_force() uses is_pointer_to_heap() and
it should be synchronized with other ractors.
[Bug #17636]
2021-02-18 17:04:59 +09:00
Koichi Sasada 100e464bee clear RVALUE on NEWOBJ event.
NEWOBJ event is called without clearing RVALUE values (v1, v2, v3).
This patch clear them before NEWOBJ tracepoint internal hook.
[Bug #17599]
2021-02-18 17:04:23 +09:00
Nobuyoshi Nakada 70cf53b4d2
Update bundled_gems 2021-02-18 16:51:44 +09:00
git feed820c96 * 2021-02-18 [ci skip] 2021-02-18 16:41:20 +09:00
Koichi Sasada 969b824a0c sync GC rest if needed
marking requires a barrier (stop all Ractors) and gc_enter() does it.
However, it doesn't check rest event which can start marking.
[Bug #17599]
2021-02-18 16:40:59 +09:00
Nobuyoshi Nakada 42a16e5974
Removed no-longer used variable 2021-02-17 20:15:05 +09:00
Peter Zhu 33b8bd97a8 Remove unreachable if statement in gc_page_sweep
This if statement is not reachable because `was_compacting` cannot be true when `heap->compact_cursor` is NULL.
2021-02-16 15:07:59 -08:00
git 7bd9329362 * 2021-02-17 [ci skip] 2021-02-17 07:00:53 +09:00
Aaron Patterson 938e027cdf Eliminate useless catch tables and nops from lambdas
Before this commit:

```
$ ruby --dump=insn -e '1.times { |x| puts x }'
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,22)> (catch: FALSE)
== catch table
| catch type: break  st: 0000 ed: 0004 sp: 0000 cont: 0004
| == disasm: #<ISeq:block in <main>@-e:1 (1,8)-(1,22)> (catch: FALSE)
| == catch table
| | catch type: redo   st: 0001 ed: 0006 sp: 0000 cont: 0001
| | catch type: next   st: 0001 ed: 0006 sp: 0000 cont: 0006
| |------------------------------------------------------------------------
| local table (size: 1, argc: 1 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
| [ 1] x@0<Arg>
| 0000 nop                                                              (   1)[Bc]
| 0001 putself                                [Li]
| 0002 getlocal_WC_0                          x@0
| 0004 opt_send_without_block                 <calldata!mid:puts, argc:1, FCALL|ARGS_SIMPLE>
| 0006 leave                                  [Br]
|------------------------------------------------------------------------
0000 putobject_INT2FIX_1_                                             (   1)[Li]
0001 send                                   <calldata!mid:times, argc:0>, block in <main>
0004 leave
```

After this commit:

```
> ruby --dump=insn -e '1.times { |x| puts x }'
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,22)> (catch: FALSE)
0000 putobject_INT2FIX_1_                                             (   1)[Li]
0001 send                                   <calldata!mid:times, argc:0>, block in <main>
0004 leave

== disasm: #<ISeq:block in <main>@-e:1 (1,8)-(1,22)> (catch: FALSE)
local table (size: 1, argc: 1 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 1] x@0<Arg>
0000 putself                                                          (   1)[LiBc]
0001 getlocal_WC_0                          x@0
0003 opt_send_without_block                 <calldata!mid:puts, argc:1, FCALL|ARGS_SIMPLE>
0005 leave
```

Fixes [ruby-core:102418] [Feature #17613]

Co-Authored-By: Alan Wu <XrXr@users.noreply.github.com>
2021-02-16 14:00:36 -08:00
Nobuyoshi Nakada 296a2cab07 Parse "-00:00" as UTC for the round-trip [Feature #17544] 2021-02-16 20:34:23 +09:00
Nobuyoshi Nakada 5b7439bb7b UTC zone should be still "+00:00" [Feature #17544] 2021-02-16 20:34:23 +09:00
Nobuyoshi Nakada 9ef66ce3fc strftime.c: support unknown offset UTC in RFC 3339 [Feature #17544]
In RFC 3339, -00:00 is used for the time in UTC is known, but the
offset to local time is unknown.  Support that representation by
`-` flag for `z`.
2021-02-16 20:34:23 +09:00
Nobuyoshi Nakada 4fc6fb2d12
Update bundled_gems 2021-02-16 19:54:25 +09:00
Nobuyoshi Nakada b1149bf305
Make the commit of updated bundled_gems file 2021-02-16 19:54:16 +09:00
Kazuhiro NISHIYAMA 96228e3ed6
Fix a spec failure
http://ci.rvm.jp/logfiles/brlog.trunk-test.20210216-182358
```
1)
$LOAD_PATH.resolve_feature_path raises LoadError if feature cannot be found FAILED
Expected LoadError but no exception was raised (nil was returned)
/tmp/ruby/v3/src/trunk-test/spec/ruby/language/predefined_spec.rb:1275:in `block (3 levels) in <top (required)>'
/tmp/ruby/v3/src/trunk-test/spec/ruby/language/predefined_spec.rb:1259:in `block in <top (required)>'
/tmp/ruby/v3/src/trunk-test/spec/ruby/language/predefined_spec.rb:1258:in `<top (required)>'
```
2021-02-16 18:52:40 +09:00
Kazuhiro NISHIYAMA 1a84c07715
Fix a failure
http://ci.rvm.jp/results/trunk-test@ruby-sky1/3359644
```
:   1)
: TestEncoding#test_nonascii_library_path [/tmp/ruby/v3/src/trunk-test/test/ruby/test_encoding.rb:157]:
: Exception(LoadError) with message matches to /\[Bug #16382\]/.
```
2021-02-16 18:17:09 +09:00
Kazuhiro NISHIYAMA 4dfc5496b7
Add NEWS entry for [Feature #16043] 2021-02-16 18:13:27 +09:00
git b75c0cd2fd * 2021-02-16 [ci skip] 2021-02-16 18:11:39 +09:00
David Rodríguez 02151dad1b `$LOAD_PATH.resolve_feature_path` should not raise
I think it's more friendly and easier to work with to return `nil` when
the feature is not found in the $LOAD_PATH.
2021-02-16 18:11:13 +09:00
Nobuyoshi Nakada 37b90bcdc1 [DOC] NEWS for Thread::Backtrace.limit [Feature #17479] 2021-02-15 18:29:35 +09:00
Nobuyoshi Nakada 4f47d655e3 Added Thread::Backtrace.limit [Feature #17479] 2021-02-15 18:29:35 +09:00
Nobuyoshi Nakada 522b256689 Added tests for --backtrace-limit option 2021-02-15 18:29:35 +09:00
David Carlier dfd029c962 supports for stack protection for haiku. 2021-02-15 17:16:14 +09:00
git 2947ae3254 * 2021-02-15 [ci skip] 2021-02-15 10:46:52 +09:00
Takashi Tamura 990b54054d Add a missing semicolon. 2021-02-15 10:46:29 +09:00
Marvin Schmidt dbeddfb0b2
Make global ruby namespace usage explicit
If the use of the ruby namespace isn't prepended by `::` to make it
explicit that the global ruby namespace is referenced here, it can
clash with other non-global namespace named ruby, e.g.

```
  // declaration
  namespace myproject {
  namespace ruby {
    // my ruby classes
  }
  }

  // implementation
  using namespace myproject;

  [...]

  rb_define_method(...);

  [...]
```

leads to the following error:

```
../ruby/choice.cc: In function 'void {anonymous}::do_register_choice()':
../ruby/choice.cc:342:9: error: reference to 'ruby' is ambiguous
  342 |         rb_define_method(c_choices, "each", RUBY_FUNC_CAST(&choices_each), 0);
      |         ^~~~~~~~~~~~~~~~
In file included from ../ruby/choice.cc:20:
../ruby/paludis_ruby.hh:53:15: note: candidates are: 'namespace paludis::ruby { }'
   53 |     namespace ruby
      |               ^~~~
In file included from /usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby/backward/2/stdalign.h:23,
                 from /usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby/defines.h:77,
                 from /usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby/ruby.h:23,
                 from /usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby.h:38,
                 from ../ruby/paludis_ruby.hh:44,
                 from ../ruby/choice.cc:20:
/usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby/internal/stdalign.h:92:11: note:                 'namespace ruby { }'
   92 | namespace ruby {
      |           ^~~~
In file included from /usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby/internal/anyargs.h:83,
                 from /usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby/ruby.h:24,
                 from /usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby.h:38,
                 from ../ruby/paludis_ruby.hh:44,
                 from ../ruby/choice.cc:20:
../ruby/choice.cc:342:9: error: '::define' has not been declared
  342 |         rb_define_method(c_choices, "each", RUBY_FUNC_CAST(&choices_each), 0);
      |         ^~~~~~~~~~~~~~~~
../ruby/choice.cc:344:9: error: reference to 'ruby' is ambiguous
  344 |         rb_define_method(c_choices, "find_by_name_with_prefix", RUBY_FUNC_CAST(&choices_find_by_name_with_prefix), 1);
      |         ^~~~~~~~~~~~~~~~
```
2021-02-14 22:12:32 +09:00
xtkoba (Tee KOBAYASHI) a681c484a3
Fixed codepage for utime [Bug #17626]
Should use the given codepage argument.

Co-Authored-By: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-02-14 19:44:41 +09:00
Nobuyoshi Nakada 416956afa6
Set verbose flag at retrying 2021-02-14 17:47:46 +09:00
Nobuyoshi Nakada 0dad341006
Directory mapping for default gems
To uniform directory structures, sometimes files are gathered in
different directory than the upstreams, executable files in
`libexec` for instance.  Re-map these files to consistent with the
upstreams.
2021-02-14 17:41:26 +09:00
Nobuyoshi Nakada 504d6dc429
Revert following rbinstall.rb changes
Because unexpected names are listed in gemspec files.

* "Fix gemspec only case"
  fc56b96b09

* "Refined installation of gemspecs placed other than ext and lib"
  31f4dec637
2021-02-14 16:57:08 +09:00
Vít Ondruch ff527e7e32
Remove binstubs which are generated by `Gem::Installer` now.
There is no real reason to carry these around, since they can be
generated during the installation. The `Gem::Installer` generates up to
date date stubs, where the racc stubs were of older format and
regenerated anyway.
2021-02-14 14:09:08 +09:00
Vít Ondruch 763b8fed3d
Use UnpackedInstaller to install default gems.
Use UnpackedInstaller for installation of default gems similarly it is
already used to install bundled gems.

This allows to reuse RubyGems functionality instead of custom code full
of exceptions.
2021-02-14 14:09:05 +09:00
Nobuyoshi Nakada fc56b96b09
Fix gemspec only case 2021-02-14 13:20:22 +09:00
git 07a8f09b9f * 2021-02-14 [ci skip] 2021-02-14 11:07:03 +09:00
Nobuyoshi Nakada 31f4dec637
Refined installation of gemspecs placed other than ext and lib 2021-02-14 11:05:23 +09:00
Koichi Sasada 813fe4c256 opt_equality_by_mid for rb_equal_opt
This patch improves the performance of sequential and parallel
execution of rb_equal() (and rb_eql()).
[Bug #17497]

rb_equal_opt (and rb_eql_opt) does not have own cd and it waste
a time to initialize cd. This patch introduces opt_equality_by_mid()
to check equality without cd.

Furthermore, current master uses "static" cd on rb_equal_opt
(and rb_eql_opt) and it hurts CPU caches on multi-thread execution.
Now they are gone so there are no bottleneck on parallel execution.
2021-02-13 11:51:33 +09:00
git 81995797bb * 2021-02-13 [ci skip] 2021-02-13 04:24:19 +09:00
Peter Zhu 15dbaa0b54 [Fixes #17622] Mark and move the previous ep 2021-02-12 11:23:57 -08:00
Nobuyoshi Nakada 1f0e0dfb22
Thread::Queue.new should accept an Enumerable [Feature #17327]
Enumerable implements #to_a but not #to_array.
2021-02-12 12:21:49 +09:00
Nobuyoshi Nakada e8b210542b
Define rb_to_array which converts with to_a 2021-02-12 12:15:57 +09:00
Sarun Rattanasiri 1a3b68e7c1
correct the result of casecmp? examples [ci skip] 2021-02-12 06:56:51 +09:00
Jeremy Evans 2d877327e1 Make a cyclic prepend not modify ancestors for the receiver
Check for cyclic prepend before making any changes.  This requires
scanning the module ancestor chain twice, but in general modules
do not have large numbers of ancestors.
2021-02-11 07:45:52 -08:00
git b83ad02997 * 2021-02-12 [ci skip] 2021-02-12 00:02:33 +09:00
Nobuyoshi Nakada b83b27cddb [ruby/irb] Fix inverse separator condition
https://github.com/ruby/irb/commit/33f933196f
2021-02-12 00:02:16 +09:00
Nobuyoshi Nakada aea40f44aa
Fixed time_t conversion modifiers for debug 2021-02-11 23:53:29 +09:00