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

60172 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada aeaf0dc555
Separate objspace argument for rb_gc_disable and rb_gc_enable 2020-02-09 17:06:31 +09:00
Nobuyoshi Nakada c47cd4be28
Removed duplicated code 2020-02-09 16:00:18 +09:00
Burdette Lamar b7e0831e8f
Enhance rdoc for ENV 2020-02-09 15:59:55 +09:00
Kazuhiro NISHIYAMA e077a910b6
Fix message of ExceptionForMatrix::ErrOperationNotDefined
```
 % RBENV_VERSION=2.6.5 ruby -r matrix -e 'Vector[1]*Vector[2] rescue p($!)'
 #<ExceptionForMatrix::ErrOperationNotDefined: Operation(*) can't be defined: Vector op Vector>
 % RBENV_VERSION=2.7.0 ruby -r matrix -e 'Vector[1]*Vector[2] rescue p($!)'
 #<ExceptionForMatrix::ErrOperationNotDefined: Operation(*) can\'t be defined: Vector op Vector>
 % RBENV_VERSION=master ruby -r matrix -e 'Vector[1]*Vector[2] rescue p($!)'
 #<ExceptionForMatrix::ErrOperationNotDefined: Operation(*) can't be defined: Vector op Vector>
```
2020-02-09 13:39:24 +09:00
Yusuke Endoh a28c166f78 gc.c: make the stack overflow detection earlier under s390x
On s390x, TestFiber#test_stack_size fails with SEGV.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel_zlinux/ruby-master/log/20200205T223421Z.fail.html.gz

```
TestFiber#test_stack_size [/home/chkbuild/build/20200205T223421Z/ruby/test/ruby/test_fiber.rb:356]:
pid 23844 killed by SIGABRT (signal 6) (core dumped)
| -e:1:in `times': stack level too deep (SystemStackError)
| 	from -e:1:in `rec'
| 	from -e:1:in `block (3 levels) in rec'
| 	from -e:1:in `times'
| 	from -e:1:in `block (2 levels) in rec'
| 	from -e:1:in `times'
| 	from -e:1:in `block in rec'
| 	from -e:1:in `times'
| 	from -e:1:in `rec'
| 	 ... 172 levels...
| 	from -e:1:in `block in rec'
| 	from -e:1:in `times'
| 	from -e:1:in `rec'
| 	from -e:1:in `block in <main>'
| -e: [BUG] Segmentation fault at 0x0000000000000000
```

This change tries a similar fix with
ef64ab917e and
3ddbba84b5.
2020-02-09 12:55:44 +09:00
Nobuyoshi Nakada 92c86e39de
Removed a useless guard
MSpec requires Ruby 2.4 or more recent.
2020-02-09 12:13:28 +09:00
Yusuke Endoh 2173ae7801 spec/ruby/core/file/utime_spec.rb: far future timestamp may be trancated
Under some Ext4 filesystem settings, a timestamp is limited up to
0x37fffffff (2446-05-10).

https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Inode_Timestamps
> Therefore, timestamps should not overflow until May 2446.

Actually the spec fails under one of our CI environments, like:

```
1)
File.utime allows Time instances in the far future to set mtime and atime FAILED
Expected 2446 == 559444
to be truthy but was false
```
https://rubyci.org/logs/rubyci.s3.amazonaws.com/arch/ruby-master/log/20200208T180002Z.fail.html.gz
2020-02-09 11:13:06 +09:00
git acb9b73495 * 2020-02-09 [ci skip] 2020-02-09 02:56:05 +09:00
aycabta 97b583d68b [ruby/reline] Organize special keys escape sequences
https://github.com/ruby/reline/commit/41deb1a3d9
2020-02-09 02:54:41 +09:00
Nobuyoshi Nakada 80cbf97918
[DOC] Added 2.7.x to the latest stable versions [ci skip] 2020-02-08 19:48:31 +09:00
git c76484c399 * 2020-02-08 [ci skip] 2020-02-08 09:57:34 +09:00
Bernhard F. Brodowsky 07c98537ca
Clarified documentation in rb_integer_unpack [ci skip]
I struggled figuring out which of the pack/unpack functions goes into which direction and the two first sentences were of the documentation were:
* Import an integer into a buffer.
* Export an integer into a buffer.

It sounds like both of them go from a ruby integer to a buffer because both use "into". So I fixed it and went to "Import an integer from a buffer". I find this much more clear.
2020-02-08 09:57:15 +09:00
S-H-GAMELINKS b76a21aa45 support multi-run test for test/did_you_mean/spell_checking/test_class_name_check.rb 2020-02-07 09:30:43 -05:00
S.H 59a40feec2
remove warning & support multi-run test for test/psych_test_yaml.rb (#2887) 2020-02-07 19:36:10 +09:00
S.H 38ed8cbb5f
remove warning & support multi-run test for test/psych/visitors/test_to_ruby.rb (#2881) 2020-02-07 19:35:52 +09:00
Nobuyoshi Nakada b64b0f3433
Show unmatched sequence on failure 2020-02-07 18:10:36 +09:00
卜部昌平 115fec062c more on NULL versus functions.
Function pointers are not void*.  See also
ce4ea956d2
8427fca49b
2020-02-07 14:24:19 +09:00
Nobuyoshi Nakada 6ed1a5e0e6
Made a test more robust
Against changes of the `assert_separately` prologue code.
2020-02-07 13:52:53 +09:00
git dedcf62b13 * 2020-02-07 [ci skip] 2020-02-07 13:47:11 +09:00
Nobuyoshi Nakada aece5baa75
Removed useless empty lines 2020-02-07 13:44:34 +09:00
Nobuyoshi Nakada a3fb97465d
Stop auto runner
Auto runner should not run in forked processes in separated tests.
2020-02-07 13:43:50 +09:00
Nobuyoshi Nakada 3d21a75c72
No crafted backtrace for SystemExit
As SystemExit is ignored, it is just useless.
2020-02-07 11:09:19 +09:00
Hiroshi SHIBATA 8c67080381
Revert "[rubygems/rubygems] Fix require issue with file extension priority"
This reverts commit d767da428c.

  It fails with spec/ruby/core/kernel/require_spec.rb:5
2020-02-06 22:07:39 +09:00
Hiroshi SHIBATA bd0a02d143
Revert to remove the query command of rubygems.
The original commit was https://github.com/rubygems/rubygems/pull/3119
2020-02-06 21:57:18 +09:00
David Rodríguez d767da428c
[rubygems/rubygems] Fix require issue with file extension priority
If `require "a"` is run when two folders have been specified in the -I
option including a "a.rb" file and a "a.so" file respectively, the ruby
spec says that the ".rb" file should always be preferred. However, the
logic we added in https://github.com/rubygems/rubygems/commit/6b81076d9
to make the -I option always beat default gems does not respect this
spec, creating a difference from the original ruby-core's require.

[the ruby spec says]: d80a6e2b22/core/kernel/shared/require.rb (L234-L246)

https://github.com/rubygems/rubygems/commit/b3944384f4
2020-02-06 21:57:18 +09:00
David Rodríguez c6b5881eae
[rubygems/rubygems] Make non "test_" method private
https://github.com/rubygems/rubygems/commit/912d141a35
2020-02-06 21:57:17 +09:00
David Rodríguez 054d99d95b
[rubygems/rubygems] Allow releasing with a rubygems pre version
This condition is too restrictive in my opinion. If a user has a pre
version of rubygems installed, she should be fully responsible for it,
and we shouldn't restrict any functionality.

Also, why is a new prerelease disallowed but an old prelease allowed, or
why is 2.0.0.rc2 explictly whitelisted? I believe this kind of
exceptions are one more reason to actually permit this.

https://github.com/rubygems/rubygems/commit/7f77a77620
2020-02-06 21:57:17 +09:00
aycabta e323f50a9c Fix readline-ext sync 2020-02-06 21:20:20 +09:00
Nobuyoshi Nakada 5fac54a594
Fixed the output from separated test in parallel test
Redirect the output of separated child process to
`MiniTest::Unit.output`.
2020-02-06 20:53:11 +09:00
Nobuyoshi Nakada f1c230f18b
Add separated assertion count 2020-02-06 20:52:25 +09:00
Nobuyoshi Nakada 739fdb7ff0
[ruby/spec] Don't care about return values
RDoc says nothing about them.  Added an example that
ConditionVariable#wait can be woken up by
ConditionVariable#signal, instead.
2020-02-06 15:42:36 +09:00
Nobuyoshi Nakada 32adae431d
[ruby/spec] Just test that sleep completes 2020-02-06 15:42:16 +09:00
Nobuyoshi Nakada 3d83e641b1
[ruby/spec] Check by Thread#stop?
Check if threads are stopped by Thread#stop? instead of the status
name.
2020-02-06 14:50:32 +09:00
卜部昌平 34f8e75f93 rb_vm_t::postponed_job_index shall be rb_atomic_t
Pointer to this field is passed to ATOMIC_CAS.  We have to use
rb_atomic_t for that purpose.
2020-02-06 11:46:51 +09:00
卜部昌平 ce4ea956d2 function pointers are not void*
The same as 8427fca49b.
2020-02-06 11:46:51 +09:00
卜部昌平 b223a78a71 this ternary operator is an undefined behaviour
Let me quote ISO/IEC 9899:2018 section 6.5.15:

> Constraints
>
> The first operand shall have scalar type.
> One of the following shall hold for the second and third operands:
> — both operands have arithmetic type;
> — both operands have the same structure or union type;
> — both operands have void type;
(snip)

Here, `*option` is a const struct rb_compile_option_struct. OTOH
`COMPILE_OPTION_DEFAULT` is a struct rb_compile_option_struct, without
const.   These two are _not_ the "same structure or union type".  Hence
the expression renders undefined behaviour.  COMPILE_OPTION_DEFAULT is
not a const because `RubyVM::InstructionSequence.compile_option=`
touches its internals on-the-fly.  There is no way to meet the
constraints quoted above.

Using ternary operator here was a mistake at the first place.  Let's
just replace it with a normal `if` statement.
2020-02-06 11:46:51 +09:00
卜部昌平 34fd7241e4 fine-grained #ifdef guard for Sparc systems
There are cases when sizeof(int) == sizeof(long) == sizeof(size_t).  On
such cases however int and long are incompatible types in theory.  We
should not assume typedef long size_t, because on Solaris size_t is
actually a typedef of int.

This reduces compiler warnings on such situations.
2020-02-06 11:46:51 +09:00
卜部昌平 72bbf60f3a do not assume GCC for __builtin_setjmp
Namely recent Sun C compiler has this function, and is not a GCC.
Meanwhile the code without RUBY_JMP_BUF assumes GCC.  We have to define
the macro when we detect __builtin_setjmp for non-GCC compilers.
2020-02-06 11:46:51 +09:00
卜部昌平 3b69552a5c add predefined macros for Doxygen
Predefined macros are practices not very well recommended, but can be
better than having no documents at all.  Without those predefined
macros, Doxygen confused for instace PUREFUNC(int foo()) to be a
declaration of PUREFUNC, not foo.
2020-02-06 11:46:51 +09:00
卜部昌平 7c20a2c83c emacs mode addition
Now that we have C++ header files, why not let their indents follow our
way.
2020-02-06 11:46:51 +09:00
git d16f4220da * 2020-02-06 [ci skip] 2020-02-06 10:38:41 +09:00
Jean Boussier 26ffd6e409 Increase the frozen_strings table initial size
It was set to 1000 in a4a2b9be7a.

However on ruby-2.7.0p0, there are much more than 1k frozen string right after boot:

```
$ ruby -robjspace -e 'p ObjectSpace.each_object(String).select { |s| s.frozen? && ObjectSpace.dump(s).include?(%{"fstring":true})}.uniq.count'
5948
```
2020-02-06 10:38:21 +09:00
git 940cd3b916 * 2020-02-05 [ci skip] 2020-02-05 09:42:29 +09:00
Nobuyoshi Nakada 0226d72e95
Fixed the output from separated test in parallel test
To output to the STDOUT of the parent process according to the
parallel test protocol, should send to the `MiniTest::Unit.output`
instead of each own STDOUT.
2020-02-05 09:39:14 +09:00
Nobuyoshi Nakada 6fe44576b9
Fixed FD leaks 2020-02-05 09:30:12 +09:00
Nobuyoshi Nakada c6cd4206df
Get rid of nested string interpolations to be editor-friendly 2020-02-05 08:53:21 +09:00
NARUSE, Yui 390a9d3b72 just use STDOUT 2020-02-04 21:51:57 +09:00
Kazuhiro NISHIYAMA 3c7a09ece8
Add call-seq to Pathname#open from File.open
before:
```
  open(p1 = v1, p2 = v2, p3 = v3)
```
2020-02-04 20:56:13 +09:00
NARUSE, Yui 9b9a621ae3 On Windows it cannot receive fd except 0..2 2020-02-04 20:54:48 +09:00
NARUSE, Yui 0529fead36 assert_separately uses their own pipe instead of stdout 2020-02-04 19:30:11 +09:00