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

62065 Коммитов

Автор SHA1 Сообщение Дата
Yusuke Endoh bed17974a1 test/webrick/test_filehandler.rb: no `.encode("filesystem")` if US-ASCII
http://ci.rvm.jp/logfiles/brlog.trunk-theap-asserts.20200618-002305
```
I, [2020-06-18T00:28:11.661066 #31625]  INFO -- :   1) Failure:
I, [2020-06-18T00:28:11.661157 #31625]  INFO -- : WEBrick::TestFileHandler#test_cjk_in_path [/tmp/ruby/v3/src/trunk-theap-asserts/test/webrick/utils.rb:72]:
I, [2020-06-18T00:28:11.661216 #31625]  INFO -- : exceptions on 1 threads:
I, [2020-06-18T00:28:11.661269 #31625]  INFO -- : U+3042 from UTF-8 to US-ASCII
```
2020-06-18 09:37:54 +09:00
Yusuke Endoh 35a6741816 Revert "[DOC] Added Exception.exception to Exception.new [ci skip]"
This reverts commit 957825639c.

Do not use [ci skip]!!!!
2020-06-18 09:19:43 +09:00
Yusuke Endoh 2d817e0564 test/webrick/test_filehandler.rb: Second try to fix the CI error
93e6fa1d31 failed to fix the issue.
I suspect that the request path must be encoded as filesystem encoding.
2020-06-18 09:14:13 +09:00
Nobuyoshi Nakada 957825639c
[DOC] Added Exception.exception to Exception.new [ci skip] 2020-06-18 09:00:34 +09:00
Nobuyoshi Nakada e14cba354c
[DOC] argument to Exception#excepton is optional [ci skip] 2020-06-18 08:59:47 +09:00
Nobuyoshi Nakada cc46d514dc
$(PREP) is needed to run $(MINIRUBY) 2020-06-18 01:42:12 +09:00
git 41a4c80d28 * 2020-06-18 [ci skip] 2020-06-18 01:16:21 +09:00
Takashi Kokubun e544a3a23c
Remove obsoleted opt_call_c_function insn (#3232)
* Remove obsoleted opt_call_c_function insn

* Keep opt_call_c_function with DEFINE_INSN_IF
2020-06-17 09:16:01 -07:00
Yusuke Endoh e30ff63fd4 test/rubygems/test_gem_package.rb: Skip a test when TMPDIR is too long
to suppress the following failure:

https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20200617T130007Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/android29-x86_64/ruby-master/log/20200617T131443Z.fail.html.gz
```
1) Failure:
TestGemPackage#test_extract_symlink_parent_doesnt_delete_user_dir
[/export/home/chkbuild/chkbuild-gcc/tmp/build/20200617T130007Z/ruby/test/rubygems/test_gem_package.rb:620]:
--- expected
+++ actual
@@ -1 +1 @@
-"installing into parent path /export/home/chkbuild/chkbuild-gcc/tmp/build/20200617T130007Z/ruby/tmp/test_rubygems_15916/extract/user/dir of /export/home/chkbuild/chkbuild-gcc/tmp/build/20200617T130007Z/ruby/tmp/test_rubygems_15916/extract/subdir is not allowed"
+"installing into parent path link/dir of /export/home/chkbuild/chkbuild-gcc/tmp/build/20200617T130007Z/ruby/tmp/test_rubygems_15916/extract/subdir is not allowed"
```

These CI environments use very long TMPDIR for some reason.
The test case creates a directory in TMPDIR and attempts to add a
symbolic link to the path into a tarball.  However, tar format limits
the maximum length up to 99, so the path is truncated.
This truncation makes the path check of `Gem::Package#install_location`
pass through, and then the check of `#mkdir_p_safe` raises an error.
The error message is slightly different from the expected value, so the
test fails.

I'm unsure what to do, so I tentatively skip the test when TMPDIR is
long.  I'll create a ticket into rubygems bug tracker.
2020-06-17 23:28:51 +09:00
David Rodríguez b1d74afd3a Speed up setup test by not installing docs
This also makes this test consistent with the other tests in this file.
2020-06-17 21:16:56 +09:00
David Rodríguez 3d8e0d8e50 Skip `test_gem_package_task` if `rake` not present
Instead of erroring.
2020-06-17 21:16:56 +09:00
David Rodríguez 967dba157c Simplify handling of a `LoadError`
The `LoadError` has a `path` reader in all supported rubies.
2020-06-17 21:16:56 +09:00
David Rodríguez e0337ce597 Remove unnecessary explicit `rake` activation 2020-06-17 21:16:56 +09:00
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.

https://rubyci.org/logs/mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-master/log/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