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

59229 Коммитов

Автор SHA1 Сообщение Дата
Jeremy Evans 47c97e1e84 Do not lose existing constant visibility when autoloading
This copies the private/deprecate constant visibility across the
autoload.  It still is backwards compatible with setting the
private/deprecate constant visibility in the autoloaded file.
However, if you explicitly set public constant in the autoloaded
file, that will be reset after the autoload.

Fixes [Bug #11055]
2019-12-03 17:31:49 +02:00
git b96d559c69 * 2019-12-04 [ci skip] 2019-12-04 00:27:58 +09:00
Jeremy Evans 5c2c396685 Check interrupts before starting thread
Fixes a hang when Thread.new calls Thread.new in a loop.

Fixes [Bug #13688]
2019-12-03 17:27:34 +02:00
KOSAKI Motohiro 7f2cd2ae6f fix typo 2019-12-03 10:50:16 +00:00
Yusuke Endoh a1f98cd4c1 vm_args.c: make the keyword deprecation message helpful
```
$ ./miniruby -e 'def foo(kw: 1); end; h = {kw: 1}; foo(h)'
-e:1: warning: The last argument is used as the keyword parameter
-e:1: warning: for `foo' defined here; maybe ** should be added to the call?
```
2019-12-03 17:56:50 +09:00
Yusuke Endoh 409e4ab740 tool/lib/test/unit/parallel.rb: fail explicitly when failing to get io
`(ulimit -n 30; make test-tool)` fails with unexplicit message:
"undefined method `write' for nil:NilClass" due to lack of stdout.

This change makes it explicit.  [Bug #5577]
2019-12-03 17:26:12 +09:00
Nobuyoshi Nakada e42d9d8df8
Fixed the inverted condition 2019-12-03 14:51:14 +09:00
Nobuyoshi Nakada 9165fcdfa3
Wrap statements in AS_IF properly 2019-12-03 14:46:54 +09:00
aycabta 027e847cd2 Fix auto-indent behavior correctly 2019-12-03 13:02:50 +09:00
Nobuyoshi Nakada 14a17063a1
Fixed stack overflow [Bug #16382]
Get rid of infinite recursion in expanding a load path to the real
path while loading a transcoder.
2019-12-03 08:51:50 +09:00
Yusuke Endoh 8bddf1bc9b mjit.c: fix a mismatch of malloc'ed type
Coverity Scan found this issue.
2019-12-03 08:02:38 +09:00
Benoit Daloze 424ad9a493 Make more attempts to check for the precision of Process.times
* Process.clock_getres specs use 10_000 but that's quite slow for
  the Process.times spec.
2019-12-02 21:23:10 +01:00
git c688487fae * 2019-12-03 [ci skip] 2019-12-03 01:41:22 +09:00
aycabta a92560132b Support incremental search by last determined word
In the incremental search by C-r, search word is saved when it's determined. In
the next incremental search by C-r, if a user presses C-r again with the empty
search word, the determined previous search word is used to search.
2019-12-03 01:39:59 +09:00
aycabta bce38f706e The C-r in vi command mode is also incremental search 2019-12-03 01:39:59 +09:00
Takashi Kokubun a47d6c256f
Fix random failure on getusage-missing environments
`* 1e6` makes a spurious result about floating point number's precision.

```
irb(main)[01:0]> 16.028
=> 16.028
irb(main)[02:0]> (16.028 * 1e6)
=> 16027999.999999998
```
2019-12-02 00:17:41 -08:00
Kazuhiro NISHIYAMA 1a88adcd75 Fix Leaked file descriptor in test/did_you_mean
de74d2c3b0/checks?check_suite_id=336910877#step:19:131
```
Leaked file descriptor: NameErrorExtensionTest#test_correctable_error_objects_are_dumpable: 7 : #<File:test_name_error_extension.rb>
```
2019-12-02 16:25:43 +09:00
Takashi Kokubun 185f760873
Debug random failure of ruby-spec on ci.rvm.jp 2019-12-01 23:23:40 -08:00
Nobuyoshi Nakada 9afaf139f2
Revert "builtin_binary.inc needs miniruby itself for RubyVM.each_builtin"
This reverts commit 2615030c52,
which doesn't work when cross compiling, except for mingw.
2019-12-02 14:15:42 +09:00
Nobuyoshi Nakada 2615030c52
builtin_binary.inc needs miniruby itself for RubyVM.each_builtin 2019-12-02 14:03:57 +09:00
Nobuyoshi Nakada a7b9f085ff
Disable _FORTIFY_SOURCE on mingw for now
It causes a link error due to some `__*_chk` functions on mingw.
2019-12-02 13:20:00 +09:00
Nobuyoshi Nakada b1c92363a7
Wait for the main thread to start reading by Queue
Otherwise, the written data to pty before the reading started may
be just lost.
2019-12-02 13:17:05 +09:00
Takashi Kokubun de74d2c3b0
Simplify variable declaration by C99 2019-12-01 17:32:50 -08:00
aycabta 103b04128f Support incremental search again by C-r in incremental search 2019-12-02 04:18:22 +09:00
Takashi Kokubun b3ea0980db
Check MJIT support in one place
to fix test failure on trunk-no-mjit
https://gist.github.com/ko1/32ab982ffd7555988818773c08f97123
2019-12-01 10:53:59 -08:00
Takashi Kokubun 6bc8b4d8ea
Skip --jit-debug= test on mswin
it fails like
https://ci.appveyor.com/project/ruby/ruby/builds/29235837/job/v0apdjj4qx8afars
2019-12-01 10:51:05 -08:00
aycabta c7f05310a2 Process Backspace key in incremental search correctly 2019-12-02 03:30:38 +09:00
aycabta e15b0313a7 Search history to back in the middle of histories 2019-12-02 03:09:41 +09:00
KOSAKI Motohiro 4d7a6d04b2 Avoid unnecessary tzset() call
Akatsuki reported ENV['TZ'] = 'UTC' improved 7x-8x faster on following code.
t = Time.now; 100000.times { Time.new(2019) }; Time.now - t
https://hackerslab.aktsk.jp/2019/12/01/141551

commit 4bc1669127(reduce tzset) dramatically improved this situation. But still,
TZ=UTC is faster than default.

This patch removs unnecessary tzset() call completely.

Performance check
  ----------------------
test program: t = Time.now; 100000.times { Time.new(2019) }; Time.now - t
before:         0.387sec
before(w/ TZ):  0.197sec
after:          0.162sec
after(w/ TZ):   0.165sec

OK. Now, Time creation 2x faster *and* TZ=UTC doesn't improve anything.
We can forget this hack completely. :)

Side note:
This patch slightly changes Time.new(t) behavior implicitly. Before this patch, it might changes
default timezone implicitly. But after this patch, it doesn't. You need to reset TZ
(I mean ENV['TZ'] = nil) explicitly.
But I don't think this is big impact. Don't try to change /etc/localtime on runtime.

Side note2: following test might be useful for testing "ENV['TZ'] = nil".
  -----------------------------------------
% cat <<'End' | sudo sh -s
rm -f /etc/localtime-; cp -a /etc/localtime /etc/localtime-
rm /etc/localtime; ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
./ruby -e '
p Time.new(2000).zone # JST
File.unlink("/etc/localtime"); File.symlink("/usr/share/zoneinfo/America/Los_Angeles", "/etc/localtime")
p Time.new(2000).zone # JST (ruby does not follow /etc/localtime modification automatically)
ENV["TZ"] = nil
p Time.new(2000).zone # PST (ruby detect /etc/localtime modification)
'
rm /etc/localtime; cp -a /etc/localtime- /etc/localtime; rm /etc/localtime-
End
2019-12-01 16:34:26 +00:00
git 43811cc3b3 * 2019-12-02 [ci skip] 2019-12-02 00:05:20 +09:00
aycabta 7f0d51704a Remove obsolete code 2019-12-02 00:03:59 +09:00
aycabta 8cb3f29abf The ed_search_prev_history should always search to backward 2019-12-01 23:54:57 +09:00
aycabta f1cfc7da18 Reline::HISTORY can take Range object 2019-12-01 23:54:57 +09:00
Benoit Daloze 617a3735ae Update to ruby/spec@dcf4955 2019-12-01 14:11:42 +01:00
Benoit Daloze 60d362b0bb Update to ruby/mspec@aa28e95 2019-12-01 14:11:40 +01:00
Nobuyoshi Nakada ab516e263c
[ruby/spec] Fix failures with LC_ALL=C
https://github.com/ruby/spec/commit/51047687c0
https://github.com/ruby/spec/commit/2b87b467cc
2019-12-01 21:55:51 +09:00
Nobuyoshi Nakada 4e03a7298b
Constified mjit_init 2019-12-01 20:26:28 +09:00
Nobuyoshi Nakada cb760f36aa
Constified 2019-12-01 19:29:04 +09:00
Takashi Kokubun 91af5542b5
Fix a mistake excluding NULL in the end 2019-12-01 02:00:08 -08:00
Takashi Kokubun 8a677a6e80
Workaround missing strndup on Windows
https://ci.appveyor.com/project/ruby/ruby/builds/29230976/job/c910t37313edb97k
2019-12-01 01:35:31 -08:00
Takashi Kokubun 3e2753ad2e
Use build dir for testing --jit-debug
to fix failure like https://github.com/ruby/ruby/runs/327745536
2019-12-01 01:25:55 -08:00
Takashi Kokubun a19d625e66
Allow specifying arbitrary MJIT flags by --jit-debug
This is a secret feature for me. It's only for testing and any behavior
with this flag override is unsupported.

I needed this because I sometimes want to add debug options but do not
want to disable optimizations, for using Linux perf.
2019-12-01 00:58:47 -08:00
Nobuyoshi Nakada bdc62dfc8e
Fixed type of an index variable 2019-12-01 14:38:33 +09:00
Yuki Nishijima 9914d6e992 Relax test strictness for error message from KeyError 2019-11-30 23:26:09 -05:00
Yuki Nishijima cc7455dd1e Relax test requirements for DYM's verbose formatter 2019-11-30 22:29:02 -05:00
Koichi Sasada 56faa13a1c remove spaces to pass a test.
23d7f4c5e1 breaks a test which expect
to match error message. To avoid this failure, use #strip for expect
and actual results.
2019-12-01 12:24:50 +09:00
git 23d7f4c5e1 * remove trailing spaces. [ci skip] 2019-12-01 11:08:39 +09:00
Yuki Nishijima 0fef526606 Do not call 'gem "did_you_mean"' for now
This will slow down the time that the +require+ method takes to load DYM,
but this has caused a build failure in a certain situation:

  https://ci.appveyor.com/project/ruby/ruby/builds/29214253/job/r9u9c8p95tnlftt3#L24965

which is reported as a separate bug:

  https://bugs.ruby-lang.org/issues/16382?next_issue_id=16381

For now this commit should fix the builds, but we should come back and
add back the 'gem' call.
2019-11-30 21:08:19 -05:00
Kevin Deisz 171803d5d3 Promote did_you_mean to default gem
At the moment, there are some problems with regard to bundler + did_you_mean because of did_you_mean being a bundled gem. Since the vendored version of thor inside bundler and ruby itself explicitly requires did_you_mean, it can become difficult to load it when using Bundler.setup. See this issue: https://github.com/yuki24/did_you_mean/issues/117#issuecomment-482733159 for more details.
2019-11-30 21:08:19 -05:00
David Rodríguez a2fc6a51dd [ruby/fileutils] Fix test failure under ruby 2.4
`Exception#full_message` is only defined on ruby 2.5.0 and above.

https://github.com/ruby/fileutils/commit/a8968f41ed
2019-12-01 08:23:05 +09:00