Commit graph

64552 commits

Author SHA1 Message Date
David Rodríguez
7b5a779576 Remove unnecessary stuff from base test case 2020-06-17 21:16:56 +09:00
David Rodríguez
66b0677bcf Tweaks to play nicer with ruby-core parallelized tests 2020-06-17 21:16:56 +09:00
David Rodríguez
106d616cc8 Make sure to only reset "dummy" $LOADED_FEATURES
Namely, those generated under `/tmp`.

The previous approach was brittle and broken in the case of ruby-core,
because under that setup, the current folder is in the original
`$LOAD_PATH`, and dummy features are created under `./tmp`, so they were
failing to be reset.
2020-06-17 21:16:56 +09:00
David Rodríguez
f5459acd79 Make sure tmp folder exists before calling Dir.tmpdir
This was guaranteed by our gitignore setup where a `tmp/` folder is
always present right after cloning the repository, but was not
guaranteed under the ruby-core setup.

This alternative approach should always work.
2020-06-17 21:16:56 +09:00
David Rodríguez
97819759de Revert "Revert "[rubygems/rubygems] Use a local temporary directory""
This reverts commit 20971d0df4.
2020-06-17 21:16:56 +09:00
David Rodríguez
dd1bfbc061 Remove unneeded code
This was added ~8 years to fix some json warning but I'm pretty sure
it's not needed anymore.

This has caused several issues in both ruby-core and rdoc test suite and
it doesn't make much sense to me these days so let's kill it.
2020-06-17 21:16:56 +09:00
Kazuhiro NISHIYAMA
7325bed2b4
Show filesystem encoding in failure message
`test_cjk_in_path` failed on mswinci yet.

20200616T192319Z.fail.html.gz
```
  1) Failure:
WEBrick::TestFileHandler#test_cjk_in_path [D:/tmp/mswin-build20200617-120024-1brdn58/ruby/test/webrick/utils.rb:72]:
exceptions on 2 threads:
webrick log start:
  [2020-06-17 06:12:53] ERROR `/あ.txt' not found.

webrick log end.
<"200"> expected but was
<"404">.
---
<[]> expected but was
<["[2020-06-17 06:12:53] ERROR `/\xE3\x81\x82.txt' not found.\n"]>.
```
2020-06-17 12:08:34 +09:00
卜部昌平
af6e63a9df rb_method_name_error: delete unused code
If you look at the code flow (break -> goto), this assignment never
makes any sense.  Should just remove.

I _guess_ this behaviour is unintended.  Original code at commit
4dc1a21809 did something.  It might be
the code flow that is buggy.  However rubyspec already includes this
particular edge case at ruby/core/module/undef_method_spec.rb.  I don't
think we can change the way it is any longer.
2020-06-17 10:06:01 +09:00
Nobuyoshi Nakada
ccb7a4b9f2
Replaced accessors of Struct with invokebuiltin 2020-06-17 08:18:46 +09:00
Koichi Sasada
b06d7c5521
ISeq created with callback is special, translation cannot be applied 2020-06-17 08:18:45 +09:00
Alan Wu
4dba8b4027
Assert iclass property and remove dead code
Iclass objects are never made from other iclass objects.
2020-06-16 17:45:45 -04:00
git
b50e74b4f8 * 2020-06-17 [ci skip] 2020-06-17 02:14:20 +09:00
S.H
eaf76be087
Remove unused else if statements in int_even_p func (#3220)
* remove else if & rb_funcall

* fix int_even_p impl

* fix rb_int_odd_p implementation
2020-06-16 10:13:54 -07:00
Akinori MUSHA
b877928ca5 Fix the ArgumentError message in shellsplit
Change "double quote" to just "quote" because the message is about any type of quotes.
2020-06-16 23:23:13 +09:00
Akinori MUSHA
68e4310344 Improve the document of Shellwords
- Improve careless examples
  - Insert `--` before a file name for cat(1)
  - Insert `-e` before a search pattern for grep(1)

- Add a caution about passing an arbitrary argument to a command
2020-06-16 23:15:51 +09:00
Nobuyoshi Nakada
318d52e820
Revert "Replaced accessors of Struct with invokebuiltin"
This reverts commit 19cabe8b09,
which didn't support tool/lib/iseq_loader_checker.rb.
2020-06-16 18:44:58 +09:00
Nobuyoshi Nakada
26c179d7e7
Check argument to ObjectSpace._id2ref
Ensure that the argument is an Integer or implicitly convert to,
before dereferencing as a Bignum.  Addressed a regression in
b99833baec.

Reported by u75615 at https://hackerone.com/reports/898614
2020-06-16 18:25:35 +09:00
Nobuyoshi Nakada
19cabe8b09
Replaced accessors of Struct with invokebuiltin 2020-06-16 18:24:02 +09:00
S.H
84160dc29b
Add static modifier for rb_int_ceil & rb_int_floor (#3217) 2020-06-16 17:47:59 +09:00
Nobuyoshi Nakada
d9c8804045
Update without touch-unicode-files 2020-06-16 12:29:02 +09:00
Nobuyoshi Nakada
466d3e68da
Just update sources in CI without fetching
Also install external libraries only, extract-gems does not work
unless base ruby is available.
2020-06-16 12:15:55 +09:00
git
b52862d35f * 2020-06-16 [ci skip] 2020-06-16 00:29:55 +09:00
Nobuyoshi Nakada
e384707296
Updated builtin type names
Fixnum and Bignum have been unified to Integer already.
2020-06-16 00:26:17 +09:00
Josef Šimánek
7a571103f2 Exit with non-zero status on disabled gem system update. 2020-06-15 21:20:37 +09:00
Josef Šimánek
3ab1cfc325 Add Gem.disable_system_update_message to disable gem update --system if needed. 2020-06-15 21:20:37 +09:00
David Rodríguez
49c42b6012 Remove encoding magic comments
They are no longer needed since ruby 2.0.
2020-06-15 21:20:37 +09:00
David Rodríguez
2b4abcff90 Deprecate Gem::Util.silent_system
There's better tools for this job.
2020-06-15 21:20:37 +09:00
David Rodríguez
afce7eb39e Replace Gem::Util.silent_system with better tools 2020-06-15 21:20:37 +09:00
David Rodríguez
c61031d6b6 Remove modelines for consistency
No other files in the repo include this.
2020-06-15 21:20:37 +09:00
David Rodríguez
4784264729 Remove random code 2020-06-15 21:20:37 +09:00
David Rodríguez
955f1837a1 Use space inside block braces everywhere
To make rubygems code style consistent with bundler.
2020-06-15 21:20:37 +09:00
David Rodríguez
ef481c120c Fix ruby-head failing tests
In `ruby-head` (where system rubygems already has the `XDG` standard
implementation), some tests currently depend on the presence of a
`~/.gem` folder in the home of the user that runs the tests. If that
file is present, tests pass, otherwise they don't.

For example, the following passes if you have a `~/.gem` folder but
fails otherwise with:

```
$ rake TESTOPTS="--name=/TestGemCommandsGenerateIndexCommand#test_execute$\|TestGemCommandsUpdateCommand#test_execute_user_install/ -v"
Run options: "--name=/TestGemCommandsGenerateIndexCommand#test_execute$|TestGemCommandsUpdateCommand#test_execute_user_install/" -v --seed 17318

# Running:

TestGemCommandsGenerateIndexCommand#test_execute = 0.02 s = .
TestGemCommandsUpdateCommand#test_execute_user_install = /rubygems/test/rubygems/test_gem_commands_update_command.rb:412: warning: instance variable @user_install not initialized
0.04 s = F

Finished in 0.095337s, 20.9783 runs/s, 20.9783 assertions/s.

  1) Failure:
TestGemCommandsUpdateCommand#test_execute_user_install [/rubygems/test/rubygems/test_gem_commands_update_command.rb:414]:
user_install must be set on the installer

2 runs, 2 assertions, 1 failures, 0 errors, 0 skips
rake aborted!
Command failed with status (1)

Tasks: TOP => default => test
(See full trace by running task with --trace)

```

This is because the very initial `require` of the default `did_you_mean`
gem that ruby does on startup runs _before_  the global `setup` hook of
our tests run. During this require `Gem.data_home` and its value is
memoized to a path in the real users home (not the fake user's home that
our tests setup, since that code hasn't run yet). Then that memoized
value is used when looking for the default folders to look for gems, and
since there's no `~/.gem` folder, its value is actually used as part of
the `Gem.user_dir` folder in `Gem::Specification.dirs` (this is how
we've approached backwards compatibility for the `XDG` feature). That
means dummy test gems with the `--user-install` flag are installed to
global, real locations and everything is messed up.

This commit fixes the issue by resetting the `Gem.data_home` value in
case it has already been memoized.
2020-06-15 19:48:25 +09:00
David Rodríguez
c3ecd1cbd3 Revert "Revert "[rubygems/rubygems] Remove unneeded global teardown""
This reverts commit ac2c07e983.
2020-06-15 19:48:25 +09:00
David Rodríguez
3a2628025e Revert "Revert "[rubygems/rubygems] Remove unneeded teardown""
This reverts commit ceacb06311.
2020-06-15 19:48:25 +09:00
Nobuyoshi Nakada
2a20c17982
Prefer String#each_byte when using a block 2020-06-15 16:20:56 +09:00
Yusuke Endoh
8f99bfa26d tool/lib/minitest/unit.rb: Reproducible shuffle of test suites
... based on CRC32 of names of the test suites.

Formerly, `make test-all` randomized the order of the test suites by
using `Array#shuffle`.  It also shows `--seed N` to reproduce the order,
but it was not reproducible when a suite set is different.

This change sorts the suites by CRC32 hash of the suite names with a
salt generated by the seed.
2020-06-15 13:56:01 +09:00
David Rodríguez
094fb6ae0d Accommodate process title spec to ruby-core setup
I'm guessing the commands under ruby-core setup are very long, so the
title gets truncated. Use a shorter title, since the test doesn't really
care.
2020-06-15 12:38:39 +09:00
David Rodríguez
117b504b98 Fix most exec specs
The `gem_command` helper was failing to require `support/hax.rb`, which
takes care of making sure rubygems actually picks up the right `ruby`
executable under ruby-core setup (`ENV["RUBY"]`). This caused binstubs
to be generated with a wrong shebang, and that caused `bundle exec` to
not work. The error message was pretty confusing though due to
https://bugs.ruby-lang.org/issues/16952.
2020-06-15 12:38:39 +09:00
David Rodríguez
f5f6415f26 A help message to tool/sync_default_gems.rb 2020-06-15 12:37:37 +09:00
Kazuhiro NISHIYAMA
93e6fa1d31 Use filesystem encoding in do_GET of filehandler
Try to fix 404 error on mswinci.

20200614T225859Z.fail.html.gz
```
  1) Failure:
WEBrick::TestFileHandler#test_cjk_in_path [D:/tmp/mswin-build20200615-24932-11ykstf/ruby/test/webrick/utils.rb:72]:
exceptions on 2 threads:
webrick log start:
  [2020-06-15 09:48:29] ERROR `/あ.txt' not found.

webrick log end.
<"200"> expected but was
<"404">.
---
<[]> expected but was
<["[2020-06-15 09:48:29] ERROR `/\xE3\x81\x82.txt' not found.\n"]>.
```
2020-06-15 11:25:33 +09:00
Takashi Kokubun
80bd3aa32b
Try using longer read_timeout for --jit-wait
failure on TestFTP.

When we skip a test, the place to hang (long wait for compilation)
just moves to another test and it doesn't seem to finish.
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3003055
2020-06-14 15:01:15 -07:00
git
c8111c7eb5 * 2020-06-15 [ci skip] 2020-06-15 00:00:12 +09:00
Nobuyoshi Nakada
b8804010fb
Remove non-US-ASCII characters [ci skip] 2020-06-14 23:59:48 +09:00
Nobuyoshi Nakada
d23917dd85
Support arguments of singleton method 2020-06-14 16:09:00 +09:00
Nobuyoshi Nakada
b22bfdaa9a
Fixed up rest, keywords, keyword rest and block arguments 2020-06-14 16:08:33 +09:00
Takashi Kokubun
997133d595
Make __builtin_cexpr! and __builtin_cstmt! work again
with Ripper.

a3e6f52c17 introduced __builtin_cexpr! and
__builtin_cstmt!, but nobody has used them and then they broke on
79292b3088 by undefined `params`.

This patch fixes the undefined `params`, but still we're not using them
yet.
2020-06-13 23:48:34 -07:00
Kazuhiro NISHIYAMA
454e8120db Add ubuntu-20.04 and rename to ubuntu-18.04 from ubuntu-latest 2020-06-14 14:00:37 +09:00
Kazuki Tsujimoto
97614c5521
apinfo/fpinfo should always be non-NULL 2020-06-14 13:16:16 +09:00
Kazuki Tsujimoto
ddded1157a
Introduce find pattern [Feature #16828] 2020-06-14 09:24:36 +09:00
Kazuki Tsujimoto
f7906a7e31
push_pktbl is needed for hash pattern, not for array pattern 2020-06-14 09:23:43 +09:00