Commit graph

61888 commits

Author SHA1 Message Date
Colby Swandale
6f9faa66fa [rubygems/rubygems] update question text
f14c8a5ec2
2020-06-18 19:14:15 +09:00
Hiroshi SHIBATA
cc059b16b2 Manually cherry-picked at 80260b3496 2020-06-18 19:14:15 +09:00
David Rodríguez
9be1baedbc [rubygems/rubygems] Remove unnecessary bundle install
These specs doesn't really need an installed bundle, they only need a
`Gemfile`.

06c85683ae
2020-06-18 19:14:15 +09:00
David Rodríguez
61b6f53337 [rubygems/rubygems] Make helpers raise by default
ade0c441d5
2020-06-18 19:14:15 +09:00
David Rodríguez
529a9e8a1f [rubygems/rubygems] Fix a couple of specs that were loading an incorrect bundler
We have a check on an `at_exit` hook that checks that system bundler is
never loaded instead of our development copy. The check was failing in
these cases, but in a silent way because the errors were being swallowed.

This commit changes these specs to make sure they load the right
bundler.

cd1c1bc297
2020-06-18 19:14:15 +09:00
David Rodríguez
5d78fb1c9a [rubygems/rubygems] Change spec to do the right thing on bundler 3
On bundler 3, the `--deployment` flag doesn't exist, so the `bundle
install --deployment` command was failing silently and the spec was
verifying a different scenario.

Change the spec to work the same regardless of bundler's major version.

Also, from the spec description it was not apparently that a specific
case involving deployment mode was being tested, so I reworded it to
make it more apparent.

3e33e2b927
2020-06-18 19:14:15 +09:00
David Rodríguez
974c40c842 [rubygems/rubygems] Fix some sudo specs to do the right thing on bundler 3
On bundler 3, where the default install path is `.bundle`, these specs
were trying to change permissions of the
`.bundle/ruby/<ruby_abi_version>` folder, which didn't exist yet,so the
permission changing command was failing and the spec was not testing the
right thing.

Change the specs so that the permissions are correctly changed, by first
configuring the local path to be `.bundle` (which creates the `.bundle`
folder), and then changing permissions of the `.bundle` folder
explicitly, which exists already.

2833162fb0
2020-06-18 19:14:15 +09:00
David Rodríguez
5454415750 [rubygems/rubygems] Fix spec to test the right thing on bundler 3
Bundler 3 installs by default to `.bundle`. That means that, because the
`bar` gem was not previously available at this location but as a system
gem, the initial `bundle install` was silently failing. As a
consequence, the spec was not testing the exact scenario it meant to
test.

202399521c
2020-06-18 19:14:15 +09:00
David Rodríguez
9939f4ad43 [rubygems/rubygems] Remove bad bundle install
This spec is specifically testing for the case where there's no
`Gemfile.lock` file and it's only doing the expected thing because the
`bundle install` command is silently failing. Remove the `bundle
install` to reduce confusion.

ec39fbde0e
2020-06-18 19:14:15 +09:00
David Rodríguez
8d7ed194cb [rubygems/rubygems] Simplify bundle update --ruby specs
They don't need to run that many commands, and the new version is also
more readable in my opinion.

efff3e3210
2020-06-18 19:14:15 +09:00
David Rodríguez
66b327af56 [rubygems/rubygems] Fix redundant commands
They are preceded by `install_gemfile` calls, which mean `bundle
install` is being run twice for no reason.

d2b2d10862
2020-06-18 19:14:15 +09:00
David Rodríguez
cceb77f57b [rubygems/rubygems] Fix unintended Gemfile installation
This command is failing because of the same reason that the subsequent
`bundle exec` is failing: the gemspec is invalid. The `bundle install`
here deviates the `bundle exec` focus from the test and is unnecessary:
all we need is a `Gemfile` that will trigger the `bundle exec`, so let's
create and avoid the extra command.

eb83cf6cf1
2020-06-18 19:14:15 +09:00
David Rodríguez
6aafea2d99 [rubygems/rubygems] Remove failing command that doesn't affect the spec
This command was silently failing but doesn't really affect the outcome
of the spec.

7880d08146
2020-06-18 19:14:15 +09:00
David Rodríguez
a8f9a97d49 [rubygems/rubygems] Remove broken test
It turns out that this test is checking essentially nothing useful. The
paperclip gem doesn't exist in our setup, so initial install is failing
and the test is only checking that calling `bundle check` 3 times on a
broken setup always returns the same thing.

I went to the history of this test:

* 105654a31e
* ae53be1f87
* d19f4a7b32
* 092f169d01
* 36878435b5

And have finally decided to remove it since I'm not sure changing it to
something else will lead to testing something useful and not already
tested.

6184322967
2020-06-18 19:14:15 +09:00
David Rodríguez
acd82bd923 [rubygems/rubygems] Fix silently broken spec
This spec was broken. The second `bundle install` was silently failing.
This means that the spec was actually checking an scenario completely
different from the one that was supposed to be tested. And also a very
dummy one: that running `bundle cache` twice doesn't cache a completely
unrelated gem.

f11a5d2df9
2020-06-18 19:14:15 +09:00
David Rodríguez
b0f07aff0b [rubygems/rubygems] Remove incorrect tags
The inner specs have separated specs for the `< 3` and `= 2` cases, so
this outer tag is incorrect.

61e905ca27
2020-06-18 19:14:15 +09:00
David Rodríguez
8c686475c8 [rubygems/rubygems] Migrate some specs to use "the new way"
The commands these specs run were throwing warnings in bundler 2, and
failing on bundler 3, effectively testing a different scenario to what
they were supposed to.

97ac1ced49
2020-06-18 19:14:15 +09:00
David Rodríguez
94fc709dd1 [rubygems/rubygems] s/rails_fail/rails_pinned_to_old_activesupport/
The `rails_fail` name is misleading because there's no specific reason
why such a gem would need to fail. As a matter of fact, `bundle
install`'ing a Genfile with only that dependency like the spec the
previous commit adds is not expected to fail.

b947f40701
2020-06-18 19:14:15 +09:00
David Rodríguez
f8f3f11ed5 [rubygems/rubygems] Fix only_update_to_newer_versions regression
The `only_update_to_newer_versions` feature flag will enable some new
behaviour in bundler 3 (or maybe earlier if we decide to consider it a
bug fix) that prevents `bundle update` from unexpectedly downgrading
direct dependencies.

This seems reasonable, but the current implementation is adding
additional requirements for all locked dependencies, not only from the
ones in the `Gemfile`. That causes some situations where the `Gemfile`
is edited and will resolve to older versions to start failing.

This commit fixes the problem by making sure extra requirements are
added exclusively for direct dependencies in the `Gemfile`, not for all
direct dependencies in the lock file.

128b4596e1
2020-06-18 19:14:15 +09:00
Nobuyoshi Nakada
a447563cf8
[DOC] Added Exception.exception to Exception.new [ci skip] 2020-06-18 11:36:21 +09:00
Nobuyoshi Nakada
cf1ee151b1
Read in ASCII-8BIT to get rid of invalid encoding error 2020-06-18 11:36:21 +09:00
Yusuke Endoh
5755397064 test/webrick/test_filehandler.rb: implicitly fall back to UTF-8
33588714/job/hcgin7xo3sarr0r2
```
  2) Failure:
WEBrick::TestFileHandler#test_cjk_in_path
[D:/a/ruby/ruby/src/test/webrick/utils.rb:72]:
exceptions on 1 threads:
U+3042 to WINDOWS-1252 in conversion from UTF-8 to WINDOWS-1252
```
2020-06-18 10:18:32 +09:00
Yusuke Endoh
82354afbf9 test/webrick/test_filehandler.rb: remove unused variable 2020-06-18 09:40:44 +09:00
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:

20200617T130007Z.fail.html.gz
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.

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