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

725 Коммитов

Автор SHA1 Сообщение Дата
David Rodríguez 5c35fedaf2 [rubygems/rubygems] Remove unnecessary rescue and loading of bundler
https://github.com/rubygems/rubygems/commit/7ecc216505
2020-06-05 07:32:42 +09:00
Takashi Kokubun 967ae6278f
Run rb_syswait on exec failure
not only when !w but also when w == WAITPID_LOCK_ONLY.
See also: f7c0cc3692 and a226434206.
We thought this change was an oversight in the latter commit.

Without this change, the test fails like:

$ make test-all TESTS="../test/ruby/test_process.rb -n test_exec_failure_leaves_no_child" RUN_OPTS="--jit"
...
  1) Failure:
TestProcess#test_exec_failure_leaves_no_child [/home/k0kubun/src/github.com/ruby/ruby/test/ruby/test_process.rb:2493]:
Expected [[26799, #<Process::Status: pid 26799 exit 127>]] to be empty.

Co-Authored-By: Yusuke Endoh <mame@ruby-lang.org>
2020-05-10 00:59:55 -07:00
Takashi Kokubun a6f8589914
Workaround a zombie process created by Open3
with MJIT worker enabled

The problem:

```
$ ruby -ropen3 --jit -e 'Open3.capture2e("cmake") rescue nil;binding.irb'
irb(main)[01:0]> Process.waitall
=> [[10656, #<Process::Status: pid 10656 exit 127>]]

$ ruby -ropen3 -e 'Open3.capture2e("cmake") rescue nil;binding.irb'
irb(main)[01:0]> Process.waitall
=> []
```

Not sure why it's happening yet, but first I'd like to prevent trunk-mjit-wait
from failing like http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2929075.
2020-05-09 22:36:34 -07:00
Yusuke Endoh 3bf0d2bb92 test/rubygems/test_gem_ext_cmake_builder.rb: make sure cmake available
just for a case.  In addition, this change suppresses unused variable
warning.
2020-05-10 14:18:25 +09:00
Hiroshi SHIBATA da345adc1c
`Open3.capture2e` raises exception when the command is not present. 2020-05-08 14:27:41 +09:00
Hiroshi SHIBATA ac2c07e983 Revert "[rubygems/rubygems] Remove unneeded global teardown"
This reverts commit 93d1588c782ab9d61699f98b6c64d7f0ab8121c0.
2020-05-08 14:13:29 +09:00
Hiroshi SHIBATA ceacb06311 Revert "[rubygems/rubygems] Remove unneeded teardown"
This reverts commit 0da416ab170dbe1cbd530a5a7c5e8128910014b2.
2020-05-08 14:13:29 +09:00
David Rodríguez 07d4ad935d [rubygems/rubygems] Remove unneeded teardown
Tests using credentials shouldn't be leaving side effects.

https://github.com/rubygems/rubygems/commit/975bcafdfc
2020-05-08 14:13:29 +09:00
David Rodríguez 93293043f1 [rubygems/rubygems] Remove unneeded global teardown
Instead, make each test cleanup after itself.

https://github.com/rubygems/rubygems/commit/e0aba9d64f
2020-05-08 14:13:29 +09:00
Hiroshi SHIBATA 4e436e605c [rubygems/rubygems] Removed needless setup to clear credential
https://github.com/rubygems/rubygems/commit/4f694f4fb7
2020-05-08 14:13:29 +09:00
Hiroshi SHIBATA ab1b31ffe0 [rubygems/rubygems] Also added credential_setup to the some of tests
https://github.com/rubygems/rubygems/commit/2ac557d008
2020-05-08 14:13:29 +09:00
Hiroshi SHIBATA 58af4c0a1f [rubygems/rubygems] Split credential helper as credential_setup and use it
https://github.com/rubygems/rubygems/commit/b0c55c76ca
2020-05-08 14:13:29 +09:00
David Rodríguez 18ac783ea6 [rubygems/rubygems] Revert adding loaded specs to `Gem::Specification.stubs` and `Gem::Specification.stubs_for`
The rationale is that:

* The change has caused realworld issues. See for example
https://github.com/ruby/did_you_mean/issues/117 and specifically [this
comment](https://github.com/ruby/did_you_mean/issues/117#issuecomment-482733159)
for a great explanation of the issue it caused for `did_you_mean`.

* The change also causes problems for our development workflows. For
example, because of it, our `bundler` specs cannot currently be run with
`bin/rake` and we have to use `bin/rspec` or `bin/parallel_spec`
directly. The explanation for this is:

  - Our specs install test dependencies to `tmp` before running specs.
  - `rake` is one of these test dependencies.
  - Before installing each test dependency, we check whether it has
  matching installed specs: 2bbcdcde08/bundler/spec/support/rubygems_ext.rb (L109-L114).

  - Normally, if `rake` has not yet been installed to `tmp`, this check
  fails and `rake` is installed, but since the loaded specs are now
  added to `Gem::Specification.stubs` and `rake`'s specification _is_
  loaded because we're running through `bin/rake`, the check incorrectly
  assumes that `rake` is already installed to `tmp` and skips
  installation.
  - At a later point the specs check whether `rake` is actually
  installed and fail if it's not: 2bbcdcde08/bundler/spec/support/builders.rb (L372-L383)

Essentially, both of the issues are the same. If at runtime we change
the location of gems, we'll _want_ to not consider loaded specifications
when dealing with the new gem location, because the loaded
specifications have not been loaded from there. Loaded specifications is
something different from installed stub specifications and those should
not be mixed.

The PR still seemed to have fixed an issue, so I did my archaeology job
and investigated the original issue to double check if reverting is ok.
The logs for the original error can be found here:
https://ci.appveyor.com/project/rubygems/rubygems/build/1172/job/ogubyucpljcv22ux.

So I installed ruby 2.4.4, checked out the commit reference before the
offending PR, and the exact error reproduced. 🎉

```
$ rake test
/home/deivid/Code/rubygems/lib/rubygems/resolver.rb:231:in `search_for': Unable to resolve dependency: user requested 'bundler (= 1.16.2)' (Gem::UnsatisfiableDependencyError)
  from /home/deivid/Code/rubygems/lib/rubygems/resolver.rb:283:in `block in sort_dependencies'
  from /home/deivid/Code/rubygems/lib/rubygems/resolver.rb:277:in `each'
  from /home/deivid/Code/rubygems/lib/rubygems/resolver.rb:277:in `sort_by'
  from /home/deivid/Code/rubygems/lib/rubygems/resolver.rb:277:in `with_index'
  from /home/deivid/Code/rubygems/lib/rubygems/resolver.rb:277:in `sort_dependencies'
  from /home/deivid/Code/rubygems/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:52:in `block in sort_dependencies'
  from /home/deivid/Code/rubygems/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:69:in `with_no_such_dependency_error_handling'
  from /home/deivid/Code/rubygems/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:51:in `sort_dependencies'
  from /home/deivid/Code/rubygems/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:165:in `initial_state'
  from /home/deivid/Code/rubygems/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:106:in `start_resolution'
  from /home/deivid/Code/rubygems/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:64:in `resolve'
  from /home/deivid/Code/rubygems/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb:42:in `resolve'
  from /home/deivid/Code/rubygems/lib/rubygems/resolver.rb:188:in `resolve'
  from /home/deivid/Code/rubygems/lib/rubygems/request_set.rb:396:in `resolve'
  from /home/deivid/Code/rubygems/lib/rubygems/request_set.rb:408:in `resolve_current'
  from /home/deivid/Code/rubygems/lib/rubygems.rb:243:in `finish_resolve'
  from /home/deivid/Code/rubygems/lib/rubygems/rdoc.rb:13:in `<top (required)>'
  from /home/deivid/Code/rubygems/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
  from /home/deivid/Code/rubygems/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
  from /home/deivid/Code/rubygems/lib/rubygems/test_case.rb:1563:in `<top (required)>'
  from /home/deivid/Code/rubygems/test/rubygems/test_bundled_ca.rb:2:in `require'
  from /home/deivid/Code/rubygems/test/rubygems/test_bundled_ca.rb:2:in `<top (required)>'
  from /home/deivid/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/rake_test_loader.rb:15:in `require'
  from /home/deivid/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/rake_test_loader.rb:15:in `block in <main>'
  from /home/deivid/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/rake_test_loader.rb:4:in `select'
  from /home/deivid/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!
Command failed with status (1)

Tasks: TOP => test
```

Now the explanation of the error:

* Rubygems base `TestCase` class requires `bundler` because some tests
use `bundler`:
2bbcdcde08/lib/rubygems/test_case.rb (L26)

* That `require` (our custom rubygems require) would activate the
default bundler spec (1.16.1 for ruby 2.4.4) but then overwrite it with
a 1.16.2 version (the locally provided bundler those days) due to [this
old
hack](9f7bf0ac3a/lib/bundler/version.rb (L7-L23)).

* Rubygems base `TestCase` class requires `rubygems/rdoc`:
2bbcdcde08/lib/rubygems/test_case.rb (L1536)

* And that file ends up calling `Gem.finish_resolve`:
2bbcdcde08/lib/rubygems/rdoc.rb (L13)

* `Gem.finish_resolve` adds the currently loaded specs to the
resolution:
2bbcdcde08/lib/rubygems.rb (L235)

* That means it would try to resolve bundler 1.16.2, but no
specification for that version was installed since the default was
1.16.1. That explains why upgrading to rubygems 2.7.7 fixed the issue,
since it provided bundler 1.16.2 by default so there was not bundler
version discrepancy.

After understanding the error, I conclude that:

* Only this part of the original patch was actually needed to resolve
the error, not any of the changes in `Gem::Specification.stubs` and
`Gem::Specification.stubs_for`:

```diff
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index f1cd3d274c..92c848e870 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -13,6 +13,15 @@ else
   require 'rubygems'
 end

+# If bundler gemspec exists, add to stubs
+bundler_gemspec = File.expand_path("../../../bundler/bundler.gemspec", __FILE__)
+if File.exist?(bundler_gemspec)
+  Gem::Specification.dirs.unshift File.dirname(bundler_gemspec)
+  Gem::Specification.class_variable_set :@@stubs, nil
+  Gem::Specification.stubs
+  Gem::Specification.dirs.shift
+end
+
 begin
   gem 'minitest'
 rescue Gem::LoadError
```

So, I propose to revert adding loaded specification to
`Gem::Specification.stubs` and `Gem::Specification.stubs_for` because I
think it's safe, it fixes the issues caused by their addition, and it
simplifies `Gem::Specification` code, which is already complicated
enough.

https://github.com/rubygems/rubygems/commit/5269cd617c
2020-05-08 14:13:29 +09:00
Vít Ondruch 46462200af [rubygems/rubygems] Test that two calls to `stub_for` returns the same (cached) instance.
https://github.com/rubygems/rubygems/commit/00b3f55562
2020-05-08 14:13:29 +09:00
Vít Ondruch acc86570dd [rubygems/rubygems] Let `@@stubs_by_name` to be incrementally populated again.
Originally, the call to `.stubs_for` allowed to incrementally populate
the `@@stubs_by_name` (especially see the `"#{name}-*.gemspec"` pattern
in 4fa03bb7aac9f25f44394e818433fdda9962ae8d). Now it looks like it
expects that all stubs are loaded, but the `.stubs_for` still matches
the .gemspec files by the `name` pattern:

6d45e0f7ac/lib/rubygems/specification.rb (L845)

I think this was done by mistake incrementally by PR #1239 and
4cee8ca9199ac7b3ab8647e0b78615f55d3eb02b. I think the best option is to
get back to the original implementation, to let RubyGems incrementally
populate the array. Other option would be to replace the logic in
`.stub_for` by call to `.stubs`, but the means the performance
improvement from the original commit was lost.

https://github.com/rubygems/rubygems/commit/4d0e18185a
2020-05-08 14:13:29 +09:00
David Rodríguez c832e3faa4 [rubygems/rubygems] Require open3 before using it
Otherwise if this test file is run in isolation, this test will fail.

https://github.com/rubygems/rubygems/commit/79da003948
2020-05-08 14:13:29 +09:00
David Rodríguez 0e195c82c1 [rubygems/rubygems] Remove old `gauntlet_rubygems` file on rubygems upgrade
The file was removed at
65b709b095,
shipped with rubygems 2.6.5.

https://github.com/rubygems/rubygems/commit/739159a120
2020-05-08 14:13:29 +09:00
David Rodríguez c982c5efac [rubygems/rubygems] Skip flaky tests on jruby
I believe these are most certainly due to a problem outside of rubygems.
I'm skipping these at least until webrick officially supports jruby
(defining "officially" as "webrick's CI passes on jruby").

https://github.com/rubygems/rubygems/commit/4fca025358
2020-05-08 14:13:29 +09:00
David Rodríguez 314d7f897c Remove `builder` gem requirement for `gem regenerate_index`
This requirement was introduced 14 years ago in
7ce7039b390440754954df5efea619e9f57ef823, and I don't think it's
necessary anymore. I made several tests introducing UTF-8 characters in
gemspec files and generating indexes out of them, and couldn't find any
issues. Gemspecs are read with UTF-8 encoding these days.
2020-05-08 14:13:29 +09:00
David Rodríguez b5a0db8be0 [rubygems/rubygems] Remove unnecessary code from remote fetcher tests
This code is not necessary and has the bad side effect of causing
test failures in cascade once a single test inside the file fails.

See https://github.com/rubygems/rubygems/runs/538978838 for an example.

https://github.com/rubygems/rubygems/commit/2291d32915
2020-05-08 14:13:29 +09:00
David Rodríguez a433b82f13 [rubygems/rubygems] Now `Dir.tmpdir` is fixed and there's never such a folder
https://github.com/rubygems/rubygems/commit/44ebbded12
2020-05-08 14:13:29 +09:00
bronzdoc 7fb694fdb0 [rubygems/rubygems] Show gemspec location when a Gem::MissingSpecError is raised while trying to activate a gem
https://github.com/rubygems/rubygems/commit/4da54a8e8b
2020-05-08 14:13:29 +09:00
David Rodríguez 4a417b08ae [rubygems/rubygems] Fix incorrect bundler version being required
In ruby 2.7.0, there's a slight change in bundler's default gemspec file
where the executable folder of the bundler gem is `libexec` instead of
`exe`. I made that change in https://github.com/ruby/ruby/pull/2380 to
try to simplify the integration of the `bundler` gem with upstream,
minimizing the number of changes that need to be made to the gemspec to
adapt to the structure of ruby-core.

That worked ok, expected for this issue. The new name of the folder
including the executable files uncovered a bug in rubygems, which is the
following:

* In order to be able to use newer versions of default gems, `rubygems`
ships with a customized `require` that has knowledge about which files
belong to which default gem. If one of these files is required,
`rubygems` will detect that and activate its gem mechanism to choose the
newest version of the corresponding default gem present in the system
(unless a different version has already been activated). It's this part
of the custom require:

ea3e6f194d/lib/rubygems/core_ext/kernel_require.rb (L77-L85)

* In order to do that, `rubygems` registers a map of default gems and
their files when it is first required:

ea3e6f194d/lib/rubygems.rb (L1247-L1276)

As explained in the method's header, two types of default gem
specifications are supported. One of the formats is the style used by
some ruby-core gemspec files, where paths inside the `spec.files` array
don't include the `spec.require_paths` part. So in this "old style", if
a gem ships with a `lib/bundler.rb` file, it will be registered in this
array as `spec.files = ["bundler.rb"]`, not as `spec.files =
["lib/bundler.rb"]`. The `Gem.register_default_spec` method "detects"
this style by making sure that none of the files in the `spec.files`
array start with any of the `spec.require_paths`.

* Since in ruby 2.7 the default specification file of the `bundler` gem
includes a `libexec/bundle` file, this check would no longer work
correctly, because even though the specification file is still "old
style", it has one registered file which starts with "lib", one of the
"require paths" of the gem.

* This means that the gem is incorrectly detected as "new style", but
since none of the paths start with "lib/", no files are actually
registered, so the gem is not being considered a default gem, and thus
the default version is always used with no possibility of being
"upgraded".

The fix of the problem is simple: check that no files start with `lib/`
(or any other require paths), instead of with "lib" which doesn't
exclude other potential "non requirable folder" starting with lib, like
in the `bundler` case.

https://github.com/rubygems/rubygems/commit/94df740c2b
2020-05-08 14:13:29 +09:00
Nobuyoshi Nakada 6e80cabb90 [rubygems/rubygems] Specify explicit separator not to be affected by $;
https://github.com/rubygems/rubygems/commit/1cea3d4dce
2020-05-08 14:13:29 +09:00
David Rodríguez ece1690105 [rubygems/rubygems] Install man files when bundler installed as a default gem
https://github.com/rubygems/rubygems/commit/28d6d77d81
2020-05-08 14:13:29 +09:00
David Rodríguez 5400811db9 [rubygems/rubygems] Refactor dummy file creation
https://github.com/rubygems/rubygems/commit/665099fe53
2020-05-08 14:13:29 +09:00
David Rodríguez 74867e2dc1 [rubygems/rubygems] Fix super weird code style
https://github.com/rubygems/rubygems/commit/f1a5815896
2020-05-08 14:13:29 +09:00
David Rodríguez ed1e4504a4 [rubygems/rubygems] Follow the pattern of other test files for foo.pem
https://github.com/rubygems/rubygems/commit/a43cffddad
2020-05-08 14:13:29 +09:00
David Rodríguez 1090456370 [rubygems/rubygems] Move helper methods to private section of the test file
https://github.com/rubygems/rubygems/commit/b85db66e2d
2020-05-08 14:13:29 +09:00
David Rodríguez 53b548f438 [rubygems/rubygems] Install existing gems as regular gems
https://github.com/rubygems/rubygems/commit/a0880d78a8
2020-05-08 14:13:29 +09:00
David Rodríguez 6438c5848d [rubygems/rubygems] Remove misleading comments
`site_dir`, or `vendor_dir`, is the location where the default version
of bundler & rubygems gets installed. These folders are placed directly
in the LOAD_PATH, so they cannot hold any nested gem directory
structure. So a single copy of either rubygems or bundler can be placed
in these folders.

What the tests are actually testing is the TODO comment that I'm
removing: that installing the default copy of bundler doesn't affect any
already installed copies of bundler as regular gems.

https://github.com/rubygems/rubygems/commit/7ca8831d72
2020-05-08 14:13:29 +09:00
David Rodríguez 373d01bb7d [rubygems/rubygems] Remove unnecessary line
https://github.com/rubygems/rubygems/commit/1d0981809a
2020-05-08 14:13:29 +09:00
David Rodríguez c58d69e698 [rubygems/rubygems] Condense some artificially broken lines
Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com>

https://github.com/rubygems/rubygems/commit/5f390478c7
2020-05-08 14:13:29 +09:00
David Rodríguez a49a131163 [rubygems/rubygems] Extract `gem_make_out` contents to a variable
Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com>

https://github.com/rubygems/rubygems/commit/5f2b7474eb
2020-05-08 14:13:29 +09:00
David Rodríguez b1541606a2 [rubygems/rubygems] Fix incorrect `gem uninstall --all` message
Currently `gem uninstall --all` shows the following incorrect message
after completion:

```
INFO:  Uninstalled all gems in
```

Now it shows something that actually makes sense like:

```
INFO:  Uninstalled all gems in /home/deivid/Code/rubygems/tmp/test_rubygems_6986/gemhome
```

https://github.com/rubygems/rubygems/commit/8fa05e8f8c
2020-05-08 14:13:29 +09:00
David Rodríguez acb793b71c [rubygems/rubygems] Make cmake tests less verbose on jruby
These tests work on jruby, but the flags to the system command used to
detect whether `cmake` is present seem to be ignored on jruby and the
output is printed to screen instead of being sent to /dev/null. This
results in very verbose tests, like this:

```
$ rake TESTOPTS=--name=TestGemExtCmakeBuilder#test_self_build
(... warnings skipped ...)
Skipping `gem cert` tests on jruby.
Skipping Gem::Security tests on jruby.
Run options: --name=TestGemExtCmakeBuilder#test_self_build --seed 16839

# Running:

/home/deivid/Code/rubygems/test/rubygems/test_gem_ext_cmake_builder.rb:13: warning: system does not support options in JRuby yet: {:out=>"/dev/null", :err=>[:child, :out]}
Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>

Specify a source directory to (re-)generate a build system for it in the
current working directory.  Specify an existing build directory to
re-generate its build system.

Run 'cmake --help' for more information.

.

Finished in 0.387301s, 2.5820 runs/s, 20.6558 assertions/s.

1 runs, 8 assertions, 0 failures, 0 errors, 0 skips
Coverage report generated for Unit Tests to /home/deivid/Code/rubygems/coverage. 2258 / 8832 LOC (25.57%) covered.
```

By using `Open3`, we get the test output clean:

```
$ rake TESTOPTS=--name=TestGemExtCmakeBuilder#test_self_build
(... warnings skipped ...)
Skipping `gem cert` tests on jruby.
Skipping Gem::Security tests on jruby.
Run options: --name=TestGemExtCmakeBuilder#test_self_build --seed 22605

# Running:

.

Finished in 0.381959s, 2.6181 runs/s, 20.9446 assertions/s.

1 runs, 8 assertions, 0 failures, 0 errors, 0 skips
Coverage report generated for Unit Tests to /home/deivid/Code/rubygems/coverage. 2258 / 8832 LOC (25.57%) covered.

```

https://github.com/rubygems/rubygems/commit/531ce37ea3
2020-05-08 14:13:29 +09:00
David Rodríguez 676d816ef1 [rubygems/rubygems] Refactor ruby command line building for tests
https://github.com/rubygems/rubygems/commit/43819b6973
2020-05-08 14:13:29 +09:00
Brandon Fish 1635394347 [rubygems/rubygems] Update test_realworld_default_gem to use rubygems project sources
https://github.com/rubygems/rubygems/commit/7506f7eb07
2020-05-08 14:13:29 +09:00
David Rodríguez 9042787508 [rubygems/rubygems] Remove unnecessary `@@ruby` variable
https://github.com/rubygems/rubygems/commit/5f20647ec1
2020-05-08 14:13:29 +09:00
David Rodríguez c6979feb02 [rubygems/rubygems] Remove unneeded explicit requires
https://github.com/rubygems/rubygems/commit/583316bf49
2020-05-08 14:13:29 +09:00
David Rodríguez df39476a12 [rubygems/rubygems] Remove unneeded dups
https://github.com/rubygems/rubygems/commit/2f072e3dc7
2020-05-08 14:13:29 +09:00
David Rodríguez fd5e4ca41f [rubygems/rubygems] Remove unneeded untainting
https://github.com/rubygems/rubygems/commit/ff223d8489
2020-05-08 14:13:29 +09:00
David Rodríguez 1039c32de6 [rubygems/rubygems] Simplify nested require exceptions
https://github.com/rubygems/rubygems/commit/7fbef2f0e3
2020-05-08 14:13:29 +09:00
David Rodríguez 43daf4d288 [rubygems/rubygems] Fix ruby warning about unused local variables
https://github.com/rubygems/rubygems/commit/cca2fccd95
2020-05-08 14:13:29 +09:00
David Rodríguez 2ece4d96f0 [rubygems/rubygems] Fix ruby warnings about a shadowed variable
https://github.com/rubygems/rubygems/commit/5cfb3252d9
2020-05-08 14:13:29 +09:00
Josef Šimánek a0c4d14acf [rubygems/rubygems] Fix symlink RubyGems test problems for non-admin user.
https://github.com/rubygems/rubygems/commit/75f672ff0e
2020-05-08 14:13:29 +09:00
Dmytro Shyrshov 03fe7da186 [rubygems/rubygems] Allow spaces in file headers during octal check
https://github.com/rubygems/rubygems/commit/e9e25731d8
2020-05-08 14:13:29 +09:00
David Rodríguez 427eb2b93f [rubygems/rubygems] Remove unnecessary DIR constant
We have `__dir__` which is the same thing.

https://github.com/rubygems/rubygems/commit/f89776427f
2020-05-08 07:38:50 +09:00
David Rodríguez 1ede0c15a1 [rubygems/rubygems] Move stuff to the instance level
I don't know why it was living at the class level. At first I thought it
would be to reuse some server instances between tests, but they seem to
be cleaned up after every test anyways, so I don't think any of it is
needed.

https://github.com/rubygems/rubygems/commit/04bee71216
2020-05-08 07:38:50 +09:00
David Rodríguez 0b40279d7d Normalize heredoc case in rubygems code base 2020-05-08 07:38:50 +09:00
Benoit Daloze 31663e9e64 [rubygems/rubygems] These specs seem to work just fine on jruby
https://github.com/rubygems/rubygems/commit/a0219b9f27
2020-05-08 07:38:50 +09:00
Benoit Daloze 1464719f5f [rubygems/rubygems] Only run the $SAFE test on MRI < 2.7
* Other Ruby implementations don't support $SAFE.

https://github.com/rubygems/rubygems/commit/9a4ba16efa
2020-05-08 07:38:50 +09:00
Olle Jonsson bb3d80bbbe [rubygems/rubygems] Autoload name_tuple.rb before use
- Resolver asked Molinillo to resolve-then-activate, which led to using Gem::NameTuple before any require had been passed

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>

https://github.com/rubygems/rubygems/commit/e11782b0c8
2020-05-08 07:38:50 +09:00
Josef Šimánek 832a7b0458 [rubygems/rubygems] Add gem build test to check for removed methods.
https://github.com/rubygems/rubygems/commit/c07b9cf4f1
2020-05-08 07:38:50 +09:00
Josef Šimánek 856cbbdd52 [rubygems/rubygems] Track removed methods calls and warn during build time.
move rubyforge_project= to removed methods

https://github.com/rubygems/rubygems/commit/223f7fd470
2020-05-08 07:38:50 +09:00
Josef Šimánek 4dd46dbad0 [rubygems/rubygems] Deprecate rubyforge_project attribute only during build time.
https://github.com/rubygems/rubygems/commit/c44eb21648
2020-05-08 07:38:50 +09:00
Josef Šimánek 60cafe8ea9 [rubygems/rubygems] Revert deprecation of deprecate method for now.
https://github.com/rubygems/rubygems/commit/965eee1741
2020-05-08 07:38:50 +09:00
bronzdoc 0e85a39dc7 [rubygems/rubygems] Restore and deprecate old deprecate method
https://github.com/rubygems/rubygems/commit/024267fa60
2020-05-08 07:38:50 +09:00
bronzdoc 7db538a7c9 [rubygems/rubygems] Rename version horizon deprecation methods
https://github.com/rubygems/rubygems/commit/6afd914fda
2020-05-08 07:38:50 +09:00
bronzdoc 361ed8d0a6 [rubygems/rubygems] Avoid "ambiguous first argument" warning
https://github.com/rubygems/rubygems/commit/984bb9b815
2020-05-08 07:38:50 +09:00
bronzdoc ff37dd7e9e [rubygems/rubygems] Modify files to use new version horizon deprecations
https://github.com/rubygems/rubygems/commit/4fe5bb5bf3
2020-05-08 07:38:50 +09:00
David Rodríguez b8ef5ed8bd [rubygems/rubygems] Remove minitest compatibility code
https://github.com/rubygems/rubygems/commit/24213b97d8
2020-05-08 07:38:50 +09:00
David Rodríguez b72c56681e [rubygems/rubygems] Use newer module Minitest name
https://github.com/rubygems/rubygems/commit/2890622479
2020-05-08 07:38:50 +09:00
David Rodríguez 5b77fc8abe [rubygems/rubygems] Remove commented out code
https://github.com/rubygems/rubygems/commit/42aa0d7ebc
2020-04-28 11:04:40 +09:00
Yusuke Endoh 2c2b0d4ec1 [rubygems/rubygems] Make the test suite pass under `umask 077`
Some tests had failed under `umask 077` mode.  As far as I investigated,
there is no actual bug.  All failures were caused by tests that create a
wrong-permission file or expect wrong permission.

This changeset fixes the tests.

https://github.com/rubygems/rubygems/commit/078213e527
2020-04-28 10:57:21 +09:00
Hiroshi SHIBATA 5c6269c459
Support XDG_* (#2174)
* Support XDG_CONFIG_HOME for gemrc.

* Support XDG_DATA_HOME for .gem

* Added test for XDG_DATA_HOME

* Do not reuse environmental variable.

* Unify .rdoc path to RDoc.home.

* Support XDG_DATA_HOME for .rdoc

* Ignore exists?

* Extracted config_home path

* Use XDG_CONFIG_HOME for default credential path

* Fixed inconsistency location.

* Fixed the broken tests.

* Support XDG_CONFIG_HOME for irbrc

* Introduce Gem.cache_home as XDG_CACHE_HOME

* Use Gem.cache_home instead of Gem.config_home for the credential file of RubyGems.

* Initialized the old configurations

* Fixed test failure related the configuration initialization

* restore XDG_DATA_HOME

* Fixed the broken examples of bundler with XDG_*

* Do not modify environmental variable on test file

* Use XDG_DATA_HOME insted of XDG_CACHE_HOME for credential file

* stub out Gem.data_home

* Move dir accessor to defaults.rb file

* Use XDG_DATA_HOME for signed gem features

* Use XDG_DATA_HOME for spec cache

* Do not rely on Gem.user_home

* Gem.user_home is always exists. Don't need to use FileUitls.mkdir_p

* Bump support version to RubyGems 3.2.0+

* Removed the needless fallback configuration

* Fixed the inconsistency methods that are find_config_file and config_file

* Use Gem.configuration.credentials_path instead of hard-coded path

* gem_path is always provided

* Removed the duplicated code of find_home

* Also removed the duplicated code of user_home

* use Gem::UNTAINT instead of untaint for surpressing the warnings

* Use File.directory

* Restore XDG_DATA_HOME

* Use File.write
2020-04-23 19:16:06 +09:00
David Rodríguez 9d5e7d6c67 [rubygems/rubygems] Revert "Remove Gem::DependencyInstaller#find_gems_with_sources"
This reverts commit 04c79d3eb9d9803d9fae78575b125b325b97206e.

Final removal is postponed until next year until we find a better way to
manage deprecations.

https://github.com/rubygems/rubygems/commit/3e1cf918a5
2020-03-30 12:54:58 +09:00
David Rodríguez 061add792e
[rubygems/rubygems] Enable `Style/ExtraSpacing` and auto-correct
https://github.com/rubygems/rubygems/commit/6fa0b1b679
2020-03-30 12:48:23 +09:00
David Rodríguez c16815cca7
[rubygems/rubygems] Remove weird spacing from error messages
https://github.com/rubygems/rubygems/commit/9e21fe7f58
2020-03-30 12:48:18 +09:00
David Rodríguez 4cd90c7bc0
[rubygems/rubygems] Remove weird spacing between receiver and method
https://github.com/rubygems/rubygems/commit/d45cd34a67
2020-03-30 12:48:13 +09:00
David Rodríguez b34721aa04
[rubygems/rubygems] Consistently left align tokenizer test columns
Makes it easier to rubocop.

https://github.com/rubygems/rubygems/commit/26b31248ae
2020-03-30 12:48:06 +09:00
David Rodríguez ba9dcdab36
[rubygems/rubygems] Enable Style/PercentLiteralDelimiters cop in rubygems
So it matches the style used by bundler.

https://github.com/rubygems/rubygems/commit/ab0580fd65
2020-03-30 12:42:10 +09:00
Yusuke Endoh 1b3339528c Skip a test that attempts to remove the current directory on Solaris 2020-03-24 17:43:33 +09:00
Yusuke Endoh 12a3671a9b test/rubygems: Try not only /usr/bin/env but also /bin/env
RubyGems chooses available one from the two: /usr/bin/env or /bin/env

20b0d60948/lib/rubygems/installer.rb (L38)

So, it is good not to hard-code /usr/bin/env in tests.

This is a retry of 65201c054a which was
accidentally deleted by 96064e6f1c
2020-03-24 17:21:55 +09:00
David Rodríguez 96064e6f1c
Sync rubygems with current master (#2889) 2020-03-24 15:39:24 +09:00
Yusuke Endoh 377c63366f test/rubygems/test_gem_commands_setup_command.rb: Allow /bin/env
Follow up of 65201c054a
2020-02-13 10:16:04 +09:00
Yusuke Endoh 65201c054a test/rubygems: Try not only /usr/bin/env but also /bin/env
RubyGems chooses available one from the two

20b0d60948/lib/rubygems/installer.rb (L38)

So, it is good not to hard-code /usr/bin/env in tests.
2020-02-12 17:33:41 +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
Yusuke Endoh 0fa43b0c1b test/rubygems/test_gem_remote_fetcher.rb: Remove a duplicated test
https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu1604/ruby-master/log/20200203T003005Z.log.html.gz
```
/home/hsbt/chkbuild/tmp/build/20200203T003005Z/ruby/test/rubygems/test_gem_remote_fetcher.rb:485: warning: method redefined; discarding old test_fetch_path_socket_error
/home/hsbt/chkbuild/tmp/build/20200203T003005Z/ruby/test/rubygems/test_gem_remote_fetcher.rb:167: warning: previous definition of test_fetch_path_socket_error was here
```
2020-02-03 11:51:10 +09:00
Hiroshi SHIBATA 600a715c9b
Merge the current master branch of rubygems/rubygems.
Just started to develop RubyGems 3.2.0.
2020-02-01 11:14:57 +09:00
Jeremy Evans ff96565686 Update tests for full keyword argument separation 2020-01-02 18:40:45 -08:00
Hiroshi SHIBATA e672494cd7
Merge RubyGems 3.1.2 2019-12-20 11:50:32 +09:00
Hiroshi SHIBATA 980ddca47e
Prepare to release rubygems-3.1.0 2019-12-15 16:48:52 +09:00
Hiroshi SHIBATA ab1f3d63b0
Fixed a typo 2019-12-13 22:10:28 +09:00
Hiroshi SHIBATA 2ef5f012c1
Added explicitly loading `Gem::Command` class 2019-12-13 22:00:28 +09:00
Hiroshi SHIBATA 82cc2843a9
Prepare to release RubyGems 3.1.0 final version. 2019-12-13 20:19:33 +09:00
Kazuhiro NISHIYAMA cf948a3d3f Do not load q.rb in build directory 2019-12-11 12:35:51 +09:00
Kazuhiro NISHIYAMA 1ed0212bcf Do not load files in build directory
related https://bugs.ruby-lang.org/issues/16177
2019-12-11 12:35:51 +09:00
Hiroshi SHIBATA 7d463e360b Merge RubyGems 3.1.0.pre3
* Fix gem pristine not accounting for user installed gems. Pull request
    #2914 by Luis Sagastume.
  * Refactor keyword argument test for Ruby 2.7. Pull request #2947 by
    SHIBATA Hiroshi.
  * Fix errors at frozen Gem::Version. Pull request #2949 by Nobuyoshi
    Nakada.
  * Remove taint usage on Ruby 2.7+. Pull request #2951 by Jeremy Evans.
  * Check Manifest.txt is up to date. Pull request #2953 by David Rodríguez.
  * Clarify symlink conditionals in tests. Pull request #2962 by David
    Rodríguez.
  * Update command line parsing to work under ps. Pull request #2966 by
    David Rodríguez.
  * Properly test `Gem::Specifications.stub_for`. Pull request #2970 by
    David Rodríguez.
  * Fix Gem::LOADED_SPECS_MUTEX handling for recursive locking. Pull request
    #2985 by MSP-Greg.
2019-11-11 16:59:49 +09:00
Nobuyoshi Nakada 390293525a
Remove binary data at installation
And revert "Relaxed warning assertions",
6f9be8505d.
2019-11-11 12:20:03 +09:00
Nobuyoshi Nakada 6f9be8505d
Relaxed warning assertions 2019-11-11 12:09:19 +09:00
Yusuke Endoh 7bf51ced55 test/rubygems/test_gem.rb: early failure when there is /tmp/Gemfile
Some test cases in rubygems assume that /tmp/Gemfile does not exist.
If it does, they fail with very difficult-to-understand message:

```
[ 149/2108] TestGemBundlerVersionFinder#test_bundler_version_with_bundle_update_bundler = 0.00
  1) Failure:
TestGemBundlerVersionFinder#test_bundler_version_with_bundle_update_bundler [/home/mame/work/ruby/test/rubygems/test_gem_bundler_version_finder.rb:38]:
Expected Gem::Version.new("2.0.2") to be nil.
```

I spent one hour to debug this issue.  To prevent the same accident,
this change makes the test suite stop when /tmp/Gemfile explicitly.
2019-10-29 14:40:26 +09:00
Hiroshi SHIBATA 51a31b86e9 [rubygems/rubygems] Also bump test variable
https://github.com/rubygems/rubygems/commit/97e9768612
2019-10-15 20:56:33 +09:00
Nobuyoshi Nakada 6f522455bf [rubygems/rubygems] Do not compare with unreliable Gem::Specification::TODAY
https://gist.github.com/ko1/a88834d744a0682711dab53fd9015a04#file-brlog-trunk-nopara-20191005-235153-L393-L472

https://github.com/rubygems/rubygems/commit/707408d8e7
2019-10-10 14:51:48 +09:00
Nobuyoshi Nakada dc2b301994 [rubygems/rubygems] Restrict possible date range
https://github.com/rubygems/rubygems/commit/1bd77f53df
2019-10-10 14:51:47 +09:00
Nobuyoshi Nakada 3e3cc0885a
Now keyword parameter warnings are suppressed by 871005bdd2
This reverts commits:

* 2a490d5660
  Suppress assert_match warnings.

* d4a86e407e
  Assert warnings message for the last argument is keyword parameter.
2019-10-05 11:30:05 +09:00
Nobuyoshi Nakada 6dfe0c9dcd
[rubygems/rubygems] The date might have advanced since TODAY has been set
https://bugs.ruby-lang.org/issues/16189

https://github.com/rubygems/rubygems/commit/e331222163
2019-10-05 10:50:02 +09:00
bronzdoc b659c1b92f
[rubygems/rubygems] Add Gem::Dependency#identity method
https://github.com/rubygems/rubygems/commit/05146bb2fd
2019-10-05 10:50:02 +09:00
Nobuyoshi Nakada 871005bdd2
[rubygems/rubygems] Suppress keywords warning in ruby 2.7
https://github.com/rubygems/rubygems/commit/892bfc11fe
2019-10-05 10:50:02 +09:00
Nobuyoshi Nakada 39e8d5e1cd
[rubygems/rubygems] Use dedicated assertion methods
For better messages at failures.

https://github.com/rubygems/rubygems/commit/971455b16e
2019-10-05 10:50:01 +09:00
Nobuyoshi Nakada f8104d9e9f
[rubygems/rubygems] Fixed assertion arguments
It is `assert_eqal(expected, actual)`.

https://github.com/rubygems/rubygems/commit/1d6197a090
2019-10-05 10:50:01 +09:00
Hiroshi SHIBATA 2a490d5660
Suppress assert_match warnings. 2019-09-26 18:24:20 +09:00
Hiroshi SHIBATA d4a86e407e
Assert warnings message for the last argument is keyword parameter. 2019-09-26 18:07:17 +09:00
David Rodríguez a2af473018
[rubygems/rubygems] Make sure our modifications to kernel.warn work
And test the fix we're adding.

https://github.com/rubygems/rubygems/commit/6f86637b98
2019-09-26 17:48:01 +09:00
Hiroshi SHIBATA 966915d807
[rubygems/rubygems] indent
https://github.com/rubygems/rubygems/commit/8cdb2fd66f
2019-09-26 17:48:01 +09:00
bronzdoc 0b65a7a19e
[rubygems/rubygems] Fix test_gem_attr
https://github.com/rubygems/rubygems/commit/7c5b66f9ef
2019-09-26 17:48:01 +09:00
f 73633683c5
[rubygems/rubygems] add tests
https://github.com/rubygems/rubygems/commit/8a7e27381c
2019-09-26 17:48:01 +09:00
David Rodríguez ea5b136155
[rubygems/rubygems] Fix underscore version for bundler itself
Previously it wouldn't play nice with the bundler version finder.

https://github.com/rubygems/rubygems/commit/d8bb81556d
2019-09-26 17:48:01 +09:00
bronzdoc d1c97ceb86
[rubygems/rubygems] Update expectation in test_to_ruby_with_rsa_key
https://github.com/rubygems/rubygems/commit/2e65f7d4ae
2019-09-26 17:48:01 +09:00
bronzdoc 8f2379b0c5
[rubygems/rubygems] Make ruby_code method handle OpenSSL::PKey::RSA objects
https://github.com/rubygems/rubygems/commit/b1d825ab3a
2019-09-26 17:48:00 +09:00
Ellen Marie Dash 508afe2c26
[rubygems/rubygems] Set SOURCE_DATE_EPOCH env var if not provided.
Fixes #2290.

1. `Gem::Specification.date` returns SOURCE_DATE_EPOCH when defined,
2. this commit makes RubyGems set it _persistently_ when not provided.

This combination means that you can build a gem, check the build time,
and use that value to generate a new build -- and then verify they're
the same.

https://github.com/rubygems/rubygems/commit/d830d53f59
2019-09-26 17:48:00 +09:00
Daniel Berger 8436b2717c
[rubygems/rubygems] Add a gem attr to the Gem::Package class.
https://github.com/rubygems/rubygems/commit/5b81f364ae
2019-09-26 17:48:00 +09:00
David Rodríguez d9e6315177
[rubygems/rubygems] Bump rubocop to 0.74.0 and fix new offenses
https://github.com/rubygems/rubygems/commit/d4fc383497
2019-09-05 18:48:15 +09:00
bronzdoc 565828a778 [rubygems/rubygems] Fix Layout/SpaceAroundOperators: Operator = should be surrounded by a single space.
https://github.com/rubygems/rubygems/commit/eaa38ebeb1
2019-09-05 18:43:45 +09:00
bronzdoc b11cfed4c4 [rubygems/rubygems] Error out if there are multiple gemspecs and no gemspec is specified
https://github.com/rubygems/rubygems/commit/547947bbf0
2019-09-05 18:43:21 +09:00
bronzdoc 400d693863 [rubygems/rubygems] Remove useless gem setup
https://github.com/rubygems/rubygems/commit/c8913e37a7
2019-09-05 18:43:12 +09:00
bronzdoc 6cacbf542c [rubygems/rubygems] Test building a gem with multiple gemspec without a gem name specified
https://github.com/rubygems/rubygems/commit/38c72fd145
2019-09-05 18:43:04 +09:00
bronzdoc a02da1012b [rubygems/rubygems] Build the first gemspec we found if no gemspec is specified
https://github.com/rubygems/rubygems/commit/ab186266b7
2019-09-05 18:42:56 +09:00
bronzdoc bcf51dd763 [rubygems/rubygems] Improve gemspec assignment and error message
https://github.com/rubygems/rubygems/commit/dc70c5a192
2019-09-05 18:42:49 +09:00
David Rodríguez fea91d69a3 [rubygems/rubygems] Don't fail when `uninstall --all` with default gem
Instead, display an informative message saying that uninstallation of
specific versions is being skipped because of being default gems.

https://github.com/rubygems/rubygems/commit/b44845aa1d
2019-09-05 18:42:26 +09:00
David Rodríguez f9f6a3d793 [rubygems/rubygems] Little refactor to avoid rubocop's false positive
Otherwise it detects duplicate methods here, because it doesn't see that
we are reopening the class in two different places.

https://github.com/rubygems/rubygems/commit/ae3fb47f5f
2019-09-05 18:42:18 +09:00
Hiroshi SHIBATA 37d0e6e471
Skip teardown with JRuby 2019-08-17 18:20:50 +09:00
Hiroshi SHIBATA dd16f8524c
Revert "Revert "[rubygems/rubygems] [Require] Ensure -I beats a default gem""
This reverts commit 75d29db8f9.
2019-08-17 15:12:45 +09:00
Hiroshi SHIBATA 75d29db8f9
Revert "[rubygems/rubygems] [Require] Ensure -I beats a default gem"
This reverts commit 00cd5d74ce.
2019-08-17 08:52:39 +09:00
Hiroshi SHIBATA f30d38bdd0
Move lib directory to the last of $LOAD_PATH on ruby repository.
https://github.com/rubygems/rubygems/pull/1868 changes the behavior
  of require when it used with -I options. Therefore, the options of
  ruby repository was different from rubygems/rubygems.
2019-08-17 07:47:19 +09:00
Alexander Pakulov 25a327d41b
[rubygems/rubygems] Do not mutate uri.query during s3 signature creation
https://github.com/rubygems/rubygems/commit/c0275ee537
2019-08-17 07:35:48 +09:00
David Rodríguez 5998012a0c
[rubygems/rubygems] Autoswitch to exact bundler version if present
https://github.com/rubygems/rubygems/commit/bb02953a97
2019-08-17 07:35:48 +09:00
David Rodríguez 1ac6890bd0
[rubygems/rubygems] Fix removing unresolved default spec files from map
https://github.com/rubygems/rubygems/commit/7964917bbc
2019-08-17 07:35:48 +09:00
bronzdoc 89ad5df979
[rubygems/rubygems] Replace domain parameter in Gem::Command#show_lookup_failure with a parameter to suppress suggestions
https://github.com/rubygems/rubygems/commit/760b7d834f
2019-08-17 07:35:48 +09:00
Samuel Giddins 00cd5d74ce
[rubygems/rubygems] [Require] Ensure -I beats a default gem
https://github.com/rubygems/rubygems/commit/6fbda98eb3
2019-08-17 07:35:48 +09:00
David Rodríguez d4feeb1936
[rubygems/rubygems] Make test also assert the gems that it should load
https://github.com/rubygems/rubygems/commit/a6375920bf
2019-08-17 07:35:48 +09:00
David Rodríguez bb2a65800d
[rubygems/rubygems] Use `assert_require`
For consistency with the other specs.

https://github.com/rubygems/rubygems/commit/44b93aec4c
2019-08-17 07:35:48 +09:00
Benoit Daloze 86ac51c301 [rubygems/rubygems] Use the standard RUBY_ENGINE_VERSION instead of JRUBY_VERSION
* RUBY_ENGINE and RUBY_ENGINE_VERSION are defined on every modern Ruby.
* There is no such constant as TRUFFLERUBY_VERSION or RBX_VERSION.

https://github.com/rubygems/rubygems/commit/431d0aefdd
2019-08-05 18:45:24 +09:00
Benoit Daloze 2ea2108a9f [rubygems/rubygems] Fix error handling of #with_engine_version
* If settings constants fail, show that exception instead of getting
  another one due to variables being unset and hiding the real cause.

https://github.com/rubygems/rubygems/commit/f38cd67874
2019-08-05 18:45:18 +09:00
David Rodríguez f9dac1bd54 [rubygems/rubygems] Cleanup after testing `rake package`
Sometimes it happens to me that my local tests start failing because I
pull some file removals or renames into my local copy, and those are
still present on my last copy of pkg/. In those cases, the test about
`rake package` will fail with something like the following:

````

Failure:
TestRakePackage#test_builds_ok [/home/deivid/Code/rubygems/test/rubygems/test_rake_package.rb:13]:
Expected `rake package` to work, but got errors:

```
cd pkg/rubygems-update-3.1.0.pre1
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
rake aborted!
Gem::InvalidSpecificationException: ["test/rubygems/test_rake_package.rb"] are not files

Tasks: TOP => package => gem => pkg/rubygems-update-3.1.0.pre1.gem
(See full trace by running task with --trace)

 ```

If you have added or removed files, make sure you run `rake update_manifest` to update the `Manifest.txt` accordingly.
Expected: true
  Actual: false
````

So, make sure, package is always built from scratch.

https://github.com/rubygems/rubygems/commit/4e2cc9eb26
2019-08-05 18:45:11 +09:00
bronzdoc 87bc29fe28 [rubygems/rubygems] Revert cadb66037d9b58c80fc795f39384d533229a1f73
https://github.com/rubygems/rubygems/commit/5c3158d975
2019-08-05 18:44:53 +09:00
Yusuke Endoh 4979ba38fa test/rubygems/test_gem_remote_fetcher.rb: suppress deprecation warnings 2019-07-31 11:27:59 +09:00
Hiroshi SHIBATA 4afd897524
File.exists? is deprecated. 2019-07-31 07:47:03 +08:00
Hiroshi SHIBATA 2a81d3a26a
[rubygems/rubygems] Skip integration test for rake package task.
https://github.com/rubygems/rubygems/commit/ca8afc01a3
2019-07-31 07:47:02 +08:00
bronzdoc a51661d378
[rubygems/rubygems] Drop support for 'gem env packageversion'
https://github.com/rubygems/rubygems/commit/be962ca0c4
2019-07-31 07:47:02 +08:00
David Rodríguez 62e2b2e66f
[rubygems/rubygems] Improve `rake package` test error message
https://github.com/rubygems/rubygems/commit/be962ca0c4
2019-07-31 07:47:02 +08:00
David Rodríguez 61893ddf75
[rubygems/rubygems] Get `rake package` tested
https://github.com/rubygems/rubygems/commit/006cdd4084
2019-07-31 07:47:02 +08:00
David Rodríguez 497efa0ec9
[rubygems/rubygems] Enable `Layout/AlignArray` cop
https://github.com/rubygems/rubygems/commit/1ea674d8f7
2019-07-31 07:47:02 +08:00
bronzdoc 3cc814bdf6
[rubygems/rubygems] Remove warning: shadowing outer local variable - spec
https://github.com/rubygems/rubygems/commit/70c5c17a5f
2019-07-31 07:47:02 +08:00
Vít Ondruch a3b784b3a0
[rubygems/rubygems] Move default specifications dir definition out of BasicSpecification.
This was never the right place. The method got there just by evolution,
not by design. Move it within default methods, where it suits better.

Since this method is presumably used just internally, it should be safe
to deprecate it and remove later.

https://github.com/rubygems/rubygems/commit/0c0dd9458a
2019-07-31 07:47:02 +08:00
bronzdoc a34168f2ac
[rubygems/rubygems] Autorequire was used by old RubyGems, it is neither supported nor functional.
https://github.com/rubygems/rubygems/commit/cadb66037d
2019-07-31 07:47:02 +08:00
Nobuyoshi Nakada a2f0331c4e
[rubygems/rubygems] Simplify #to_ruby code
Separate #add_runtime_dependency and #add_development_dependency
availability condition from #specification_version availability,
which is not related to directly.
Also check if the former method is available, instead of comparing
the version.

https://github.com/rubygems/rubygems/commit/5cccc2b836
2019-07-31 07:47:02 +08:00
Alexander Pakulov 5947ea31ca
[rubygems/rubygems] Missing dependency
https://github.com/rubygems/rubygems/commit/79b62c233a
2019-07-31 07:47:02 +08:00
Alexander Pakulov 0d596c1ab2
[rubygems/rubygems] Making Gem::S3URISigner.sign method smaller with helper methods
https://github.com/rubygems/rubygems/commit/2a96494d91
2019-07-31 07:47:01 +08:00
Alexander Pakulov 4a8c2dd419
[rubygems/rubygems] Extracting sign_s3_url & s3_source_auth into a separate S3URISigner class
https://github.com/rubygems/rubygems/commit/c30d21ec7a
2019-07-31 07:47:01 +08:00
Alexander Pakulov bd78eabcf3
[rubygems/rubygems] Addressing PR comments
https://github.com/rubygems/rubygems/commit/fb62d3043c
2019-07-31 07:47:01 +08:00
bronzdoc 6bd7772361
[rubygems/rubygems] Rename Gem::Package.metadata to Gem::Package.raw_spec
https://github.com/rubygems/rubygems/commit/a76f25dff0
2019-07-31 07:47:01 +08:00
Alexander Pakulov 38daeded66
[rubygems/rubygems] Upgrading S3 source signature to AWS SigV4
https://github.com/rubygems/rubygems/commit/f289788ca5
2019-07-31 07:47:01 +08:00
bronzdoc 688ccc9602
[rubygems/rubygems] Move metadata method to Gem::Package
https://github.com/rubygems/rubygems/commit/2c9cfcb666
2019-07-31 07:47:01 +08:00
Daniel Berger 8103d46a4d
[rubygems/rubygems] Add a package attr_reader to Gem::Installer.
Add some basic specs for the package attr_reader.

https://github.com/rubygems/rubygems/commit/68af2a0ee3
2019-07-31 07:47:01 +08:00
bronzdoc 5eacb4c52e
[rubygems/rubygems] Remove conflict.rb code that was supposed to be removed in Rubygems 3
https://github.com/rubygems/rubygems/commit/6d5f743a89
2019-07-31 07:47:01 +08:00
David Rodríguez 0ca494fc80
[rubygems/rubygems] Silence deprecations when gemdeps is used in tests
Because we can't control 3rd party gems using deprecated rubygems
behavior, and thus outputting warnings to the screen.

https://github.com/rubygems/rubygems/commit/6912ebf20a
2019-07-31 07:47:00 +08:00
bronzdoc 673ef894ac
[rubygems/rubygems] Return early if filename is empty
https://github.com/rubygems/rubygems/commit/1b9ab33083
2019-07-31 07:47:00 +08:00
bronzdoc 7990d8dc50
[rubygems/rubygems] Set config_file_name to the value of ENV["GEMRC"] if available
https://github.com/rubygems/rubygems/commit/471239f1fa
2019-07-31 07:47:00 +08:00
Nobuyoshi Nakada 99fb637c41 [rubygems/rubygems] Make `@@project_dir` constants per files
https://github.com/rubygems/rubygems/commit/955174658f
2019-07-24 18:15:54 +08:00
Nobuyoshi Nakada 99680f81e8 [rubygems/rubygems] Resolve `@@project_dir` from test file paths
`Dir.pwd` may differ from the source path.  Test directories and
files should be resolved from test file paths.

https://github.com/rubygems/rubygems/commit/e18e7c81b4
2019-07-24 18:15:47 +08:00
Nobuyoshi Nakada 6ffef8d459
Clean up temporary expired cert file 2019-07-02 15:02:16 +09:00
Hiroshi SHIBATA 56660de3c6 Merge rubygems master from upstream.
I picked the commit from 3c469e0da538428a0ddd94f99aa73c32da22e8ba
2019-06-01 13:50:41 +03:00
Yusuke Endoh e04d10b28f test/rubygems/test_gem_stream_ui.rb (test_ask_for_password): extend the timeout
for Solaris.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10s/ruby-master/log/20190528T191908Z.fail.html.gz
2019-05-29 13:01:53 +09:00
Yusuke Endoh ae2a904ce9 Update the certificate files to make the test pass on Debian 10
The old certificate files (for example, test/rubygems/ca_cert.pem) were
signed by SHA1.  This message digest is considered too weak and rejected
by OpenSSL 1.1.1 or later.  Because of this, the test suite does not
pass on Debian 10.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-master/log/20190527T123003Z.fail.html.gz#test%2Frubygems

This change regenerates the files.
A shell script for the regeneration (util/create_certs.sh) is also
added.
2019-05-28 10:07:29 +09:00
Yusuke Endoh f20af9543f test/rubygems/test_gem_stream_ui.rb (test_ask): extend the timeout
for Solaris.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10s/ruby-master/log/20190525T211908Z.fail.html.gz
2019-05-26 15:23:21 +09:00
Nobuyoshi Nakada 18e43e8231
Fix fd leak
merged https://github.com/rubygems/rubygems/pull/2765
2019-05-16 14:58:57 +09:00
David Rodríguez d0a5467320 Update rubygems with latest upstream changes
Closes: https://github.com/ruby/ruby/pull/2154
2019-04-28 11:07:45 +09:00
hsbt f28be7e02d Merge rubygems/rubygems from upstream.
The current master branch is
  97b264f0fa

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-02 11:48:18 +00:00
k0kubun c1dce92373 Merge https://github.com/rubygems/rubygems/pull/2684
to make CI stable. See the PR for details.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 11:46:21 +00:00
nobu aef24ecbe9 Renamed duplicate test
Import rubygems/rubygems#2678

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 03:53:31 +00:00
hsbt 4c1952f4bf Ignore to handle the different platform
When `GEM_HOME` was shared with CRuby and JRuby. RubyGems try to
  handle both platforms. It should be ignored the different platform.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-07 11:24:48 +00:00
hsbt d4303528d3 Skip malicious extension test with mswin platform.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-06 02:08:20 +00:00
hsbt 08f8cfe14e Merge RubyGems upstream: 56c0bbb69e4506bda7ef7f447dfec5db820df20b
It fixed the multiple vulnerabilities.
  https://blog.rubygems.org/2019/03/05/security-advisories-2019-03.html

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-05 03:32:58 +00:00
hsbt 4ae3df42f7 Merge RubyGems master@9be7858f7f17eae3058204f3c03e4b798ba18b9c
This version contains the some style changes by RuboCop.

    * 9d810be0ed
    * 61ea98a727
    * 795893dce3
    * 9be7858f7f

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-14 12:59:03 +00:00
hsbt 3dc6efbe9c Merge rubygems master targeted RubyGems 3.1.0.
1172320540

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-22 06:28:04 +00:00
hsbt 6e7213f427 Merge rubygems-3.0.2.
https://blog.rubygems.org/2019/01/01/3.0.2-released.html

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-01 04:53:52 +00:00
nobu 8cfbaf943e Restore SOURCE_DATE_EPOCH
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-25 13:33:51 +00:00
hsbt ae19a18996 Merge RubyGems 3.0.1 from rubygems/rubygems.
It fixed the issues of RubyGems 3.0.0.
  https://blog.rubygems.org/2018/12/23/3.0.1-released.html

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-23 00:20:49 +00:00
hsbt 92e726628e Merge RubyGems 3.0.0 from upstream.
https://blog.rubygems.org/2018/12/19/3.0.0-released.html

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-19 07:20:17 +00:00
naruse 67f59eb4ab fix r66163
OpenSSL maybe aren't loaded in rubygems.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-14 08:01:40 +00:00
hsbt 7f9bf068fc Merge rubygems@21f12a8 from upstream.
* [BudlerVersionFinder] set .filter! and .compatible? to match only on major versions https://github.com/rubygems/rubygems/pull/2515
  * Fix broken symlink that points to ../* https://github.com/rubygems/rubygems/pull/2516

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12 05:07:50 +00:00
k0kubun cbff19443d test_gem_package_task.rb: suppress random failure
by Bundler.

http://ci.rvm.jp/results/trunk-vm-asserts@silicon-docker/1500762

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06 23:16:01 +00:00
k0kubun 70a385a4f6 Re-commit r65722
which was accidentally reverted by r65904

158562dabb

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-04 11:45:05 +00:00
hsbt a94cbf81e1 Merge rubygems master@221bdea
* Fixed https://github.com/rubygems/rubygems/pull/2506

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-04 08:00:57 +00:00
hsbt 7a46a3b941 Merge rubygems-3.0.0.beta3.
* [GSoC] Multi-factor feature for RubyGems https://github.com/rubygems/rubygems/pull/2369

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-01 11:01:00 +00:00
hsbt 5dbc6583c9 Merge rubygems upstream from 2c499655f2
https://github.com/rubygems/rubygems/pull/2493

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-28 03:08:14 +00:00
k0kubun 655257273a Revert "test_gem_remote_fetcher.rb: give up testing MJIT here"
This reverts commit d12bcfc186.

pause on --jit-wait looks not working... I'll fix that first.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-22 03:39:07 +00:00
k0kubun d12bcfc186 test_gem_remote_fetcher.rb: give up testing MJIT here
because we can't configure timeout for remote fetcher.

We've sometimes hit timeout.
https://app.wercker.com/ruby/ruby/runs/mjit-test2/5bf5213c183106002857d355?step=5bf530de63e94600071b0785
https://app.wercker.com/ruby/ruby/runs/mjit-test2/5be3d719567ae90007681ed6?step=5be43b3887436a0006d00d21

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-21 11:33:25 +00:00
hsbt 5335ce0e06 Merge master branch from rubygems/rubygems upstream.
* Enable Style/MethodDefParentheses in Rubocop
    https://github.com/rubygems/rubygems/pull/2478
  * Enable Style/MultilineIfThen in Rubocop
    https://github.com/rubygems/rubygems/pull/2479
  * Fix required_ruby_version with prereleases and improve error message
    https://github.com/rubygems/rubygems/pull/2344
  * Fix bundler rubygems binstub not properly looking for bundler
    https://github.com/rubygems/rubygems/pull/2426

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-21 10:20:47 +00:00
k0kubun 158562dabb test_gem_stream_ui.rb: loosen timeout for --jit-wait
https://app.wercker.com/ruby/ruby/runs/mjit-test2/5beba9be183106002852f8a6?step=5bebc1a087436a0006f94a22

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-14 07:38:05 +00:00
nobu adb723bce7 `+` sign in the path of ruby needs to be escaped
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07 11:38:08 +00:00
hsbt 67da45a1f3 Merge rubygems-3.0.0.beta2.
* It enabled `USE_BUNDLER_FOR_GEMDEPS` for using gemdeps of rubygems.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-03 12:31:51 +00:00
hsbt 3e047420d6 Merge upstream from rubygems/rubygems master branch.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-31 03:23:30 +00:00
k0kubun e38a0b4606 revisit more MJIT test skips
r65308 passed both trunk-mjit and trunk-mjit-wait CIs. MJIT copy job
looks working fine. Then this commit skips 5 more tests. Some of them
were skipped in a very early stage and may still need to be skipped, but
I want to confirm them since they haven't been changed for a long time.

And this prefers having inline information on `RubyVM::MJIT.enabled?`.
This commit makes it easier to confirm whether there's suspicious test
skip by RubyVM::MJIT.enabled? or not.

After this commit, tentatively we're not skipping tests for MJIT other
than `assert_no_memory_leak` ones.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-22 15:49:22 +00:00
hsbt 615ac35934 Merge rubygems master branch from github.com/rubygems/rubygems.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-22 00:27:02 +00:00
k0kubun e91be25644 revert revert of r65285
because CI was actually hitting another one.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21 23:20:32 +00:00