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

1889 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 03f86565a6
Silent backtrace from cve_2019_8325_spec.rb
Since the change at f310ac1cb2 to show
the backtraces by default, this test started to show the backtraces.
As the backtraces are not the subject of this test, silence them by
using Gem::SilentUI.
2022-08-07 17:57:52 +09:00
David Rodríguez 466a760e18 [rubygems/rubygems] Fix yanked gems being unintentionally update when other gems are unlocked
This is a regression from a change intended to raise errors when user
puts a gem under an incorrect source in the Gemfile by mistake. To fix
the issue, we revert the change that caused it and implement it in a
different way that restores the resolver independency from real
specifications. Now it deals only with names and versions and does not
try to materialize anything into real specifications before resolving.

https://github.com/rubygems/rubygems/commit/d2bf1b86eb
2022-08-06 15:41:46 +09:00
Alan Wu c433d36b5b Test that File.read defaults to text mode
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-08-05 14:34:08 -04:00
David Rodríguez 5a9db23734 [rubygems/rubygems] Automatically remove "ruby" from lockfile if incomplete
https://github.com/rubygems/rubygems/commit/69d0b4e10b
2022-08-05 16:36:42 +09:00
David Rodríguez 851b3aa7dd [rubygems/rubygems] Fix `bundle outdated --strict`
It should be an alias of `--filter-strict`.

`--update-strict` is essentially a dummy option with no special behavior
associated and should be deprecated.

https://github.com/rubygems/rubygems/commit/ec1e5d83c8
2022-08-03 16:33:53 +09:00
David Rodríguez 35c65e7ba6 [rubygems/rubygems] Fix conservative updates regardless of `--strict`
https://github.com/rubygems/rubygems/commit/c9a1d69a8d
2022-08-03 16:33:52 +09:00
Hiroshi SHIBATA 71794a75db Merge rubygems/bundler HEAD
Pick from 8331e63263
2022-08-03 13:14:10 +09:00
Jean Boussier e3aabe93aa Implement Queue#pop(timeout: sec)
[Feature #18774]

As well as `SizedQueue#pop(timeout: sec)`

If both `non_block=true` and `timeout:` are supplied, ArgumentError
is raised.
2022-08-02 11:04:28 +02:00
David Rodríguez 3e4fedca4e [rubygems/rubygems] Preserve the previous behavior of raising an error when in frozen mode
https://github.com/rubygems/rubygems/commit/6e35a6edfe
2022-08-02 16:10:19 +09:00
David Rodríguez bc90090672 [rubygems/rubygems] Check for errors in error stream
https://github.com/rubygems/rubygems/commit/7b0f7804f2
2022-08-02 16:10:18 +09:00
David Rodríguez f4f681463f [rubygems/rubygems] Don't discard candidates matching ruby metadata
Do dependency filtering and materialization in one step. Before,
dependency filtering would not consider ruby metadata so it would
discard variants that end up not being materializable in the end.

https://github.com/rubygems/rubygems/commit/0c0d40d417

Co-authored-by: Ian Ker-Seymer <ian.kerseymer@shopify.com>
2022-08-02 16:10:18 +09:00
David Rodríguez 13305bf0c9 [rubygems/rubygems] Fix crash when running `bundle outdated` in debug mode
Previously it would crash like this:

````
$ /Users/deivid/.asdf/installs/ruby/3.1.2/bin/ruby -I/Users/deivid/Code/rubygems/rubygems/bundler/spec -r/Users/deivid/Code/rubygems/rubygems/bundler/spec/support/artifice/fail.rb -r/Users/deivid/Code/rubygems/rubygems/bundler/spec/support/hax.rb /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/bin/bundle outdated --patch --strict --filter-patch
Running `bundle outdated --filter-patch --patch --strict` with bundler 2.4.0.dev
Found changes from the lockfile, re-resolving dependencies because bundler is unlocking Using a local server, bundler won't use the CompactIndex API
Fetching source index from file:///Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/remote4/
Resolving dependencies...
--- ERROR REPORT TEMPLATE -------------------------------------------------------

```
RuntimeError: LazySpecification has not been materialized yet (calling :loaded_from [])
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/lazy_specification.rb:147:in `method_missing'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:214:in `gem_column_for'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:174:in `block in print_gems_table'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:173:in `map'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:173:in `print_gems_table'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:123:in `run'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli.rb:420:in `outdated'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli.rb:31:in `dispatch'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli.rb:25:in `start'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/exe/bundle:48:in `block in <top (required)>'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/exe/bundle:36:in `<top (required)>'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/bin/bundle:25:in `load'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/bin/bundle:25:in `<main>'
```
````

https://github.com/rubygems/rubygems/commit/23c46f3b57
2022-08-01 23:14:23 +09:00
David Rodríguez 5c13adb746 [rubygems/rubygems] Fix comment incorrectly copied from another spec
https://github.com/rubygems/rubygems/commit/9be5eae9cf
2022-08-01 23:14:22 +09:00
David Rodríguez 030050cdfa [rubygems/rubygems] Make `--standalone` play nice with `--local`
I'm not sure if using relative paths in the generated script is best for
this case, since it makes the script not movable, but that can be
improved later.

https://github.com/rubygems/rubygems/commit/7f5bdbb842
2022-07-30 04:24:25 +09:00
Hiroshi SHIBATA bfd09b1116 Merge rubygems master from 446cc57a7c 2022-07-29 15:46:15 +09:00
Benoit Daloze 6582df26dc Update to ruby/spec@cbfaf51 2022-07-27 17:18:25 +02:00
Benoit Daloze 44f42413e6 Update to ruby/mspec@290e36a 2022-07-27 17:18:23 +02:00
moe c3d9849df9 [rubygems/rubygems] Add ignore_funding_requests config flag
https://github.com/rubygems/rubygems/commit/ab302f72c9
2022-07-27 05:39:40 +09:00
David Rodríguez 163e3f075f [rubygems/rubygems] Use main as default branch for Bundler specs
https://github.com/rubygems/rubygems/commit/482077d185
2022-07-27 01:04:11 +09:00
Hiroshi SHIBATA 9e6d07f346 Merge rubygems/bundler HEAD
Merge from 2af2520b4a
2022-07-26 14:38:17 +09:00
Jeremy Evans 7223c0da15 Do not chomp trailing line separator IO#each with nil separator and chomp
nil separator means no sepator, so chomp should not remove a line
separator.

Partially Fixes [Bug #18770]
2022-07-21 12:55:24 -07:00
Jeremy Evans 12ac8971a3 Do not have class/module keywords look up ancestors of Object
Fixes case where Object includes a module that defines a constant,
then using class/module keyword to define the same constant on
Object itself.

Implements [Feature #18832]
2022-07-21 08:28:05 -07:00
Takuya Noguchi 631b34ef95 [rubygems/rubygems] Bundler: change error/warning message for multiple global sources
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

https://github.com/rubygems/rubygems/commit/316564b8fc
2022-07-19 23:51:47 +09:00
David Rodríguez 01560e1c53 [rubygems/rubygems] Improve error message when gems cannot be found
Include the source of each gem.

https://github.com/rubygems/rubygems/commit/a0bed2fb79
2022-07-18 19:07:47 +09:00
Takuya Noguchi 5081d0dd5c [rubygems/rubygems] bundler: fix typo in inline RuboCop config
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

https://github.com/rubygems/rubygems/commit/e11f5a143b
2022-07-17 18:27:00 +09:00
David Rodríguez ef2d673052 [rubygems/rubygems] Show a proper error if extension dir is not writable
Instead of showing the bug report template.

https://github.com/rubygems/rubygems/commit/0c8b6f7dd5
2022-07-17 17:47:23 +09:00
David Rodríguez 76de7a92b9 [rubygems/rubygems] Fix misleading error if compact index cannot be copied
Previously if `~/.bundle/cache/compact_index/rubygems.org.*/version`
were owned by root with read-only access, `bundle install` would fail
with a misleading error message. For example:

```
There was an error while trying to write to `/tmp/bundler-compact-index-20220711-1823-npllre/versions`. It is
likely that you need to grant write permissions for that path.
```

This happened because the EACCESS error was caught by
`SharedHelpers.filesystem_access`, which makes it look like the target
directory is at fault instead of the source.

We can't simply drop this guard because that causes the opposite
problem: the permission error appears to come from the source instead of
the target, since `CompactIndexClient::Cache#lines` also wraps read
access errors.

Instead, bring a minimal implementation of `FileUtils.cp` and nest calls
to `SharedHelpers.filesystem_access` properly.

https://github.com/rubygems/rubygems/commit/320822c070

Co-authored-by: Stan Hu <stanhu@gmail.com>
2022-07-14 15:06:09 +09:00
Hiroshi SHIBATA 437a5ae9d6 Merge RubyGems and Bundler master 2022-07-13 14:11:55 +09:00
David Rodríguez 7dd0a22588 [rubygems/rubygems] Fix `simulate_windows` helper
It should also set the proper class variable so that `Gem.win_platform?`
returns true.

https://github.com/rubygems/rubygems/commit/0fbf6904d1
2022-07-08 02:22:35 +09:00
David Rodríguez 7b78aba53a [rubygems/rubygems] Account for default gems not having remote when caching
https://github.com/rubygems/rubygems/commit/b93d4de2ff
2022-07-02 19:41:02 +09:00
Nobuyoshi Nakada 0f06b8fa3e Relax `not_before` limit
Use the value as similar as other tests below.
Trying to fix sporadic “not yet valid” failures on some CIs.
2022-07-02 14:46:38 +09:00
Nobuyoshi Nakada c684b1aa26
Fix TODO in stringio/truncate_spec.rb 2022-07-01 09:08:25 +09:00
Koichi Sasada 5df20a5da5 stop CI failures.
302f353fd9 seems break the rubyspec.

@nobu please check it.
2022-07-01 01:45:39 +09:00
Kazuhiro NISHIYAMA 4b1f337ef2
Add more check to debug failures 2022-06-30 15:36:34 +09:00
David Rodríguez f9f85a513b [rubygems/rubygems] Print error messages just once in verbose mode
When running a command with the `--verbose` flag that ends up raising a
`BundlerError`, Bundler will unnecessarily print the error twice.

This commit fixes the issue by removing the duplicate logging.

https://github.com/rubygems/rubygems/commit/689004a164
2022-06-27 23:35:45 +09:00
Jeremy Evans c3eb0437f2 Fix Process.clock_gettime specs on OpenBSD 2022-06-26 12:39:16 -07:00
Benoit Daloze d3d5ef0cca Update to ruby/spec@ab32a1a 2022-06-26 14:50:14 +02:00
Benoit Daloze f616e81637 Update to ruby/mspec@78b5d86 2022-06-26 14:50:13 +02:00
David Rodríguez a782d76fbe [rubygems/rubygems] Fix pending Bundler specs
When testing under the ruby/ruby setup, mkmf.rb needs to the `$extout`
global variable set properly.

This is because, in this particular case, the `ruby.h` header needed to
compile extensions is constructed from
`$(extout)/include($arch)/ruby/config.h` but `$extout` is not set by
default.

I tried to fix this in mkmf.rb itself but I couldn't figure it. But
setting it externally to workaround the issue fixes the specs, so I'll
start with that. Also setting it externally causes issues when running
specs upstream against Ruby 2.3 (I guess because of some difference with
Ruby 2.3 mkmf.rb implementation). So I'm avoiding doing it on Ruby 2.3 to
woraround that.

https://github.com/rubygems/rubygems/commit/d782984585
2022-06-26 11:16:11 +09:00
David Rodríguez 12a5fa408b Sync RubyGems & Bundler with upstream repo 2022-06-24 10:52:02 +09:00
David Rodríguez 6f229da2c0 [rubygems/rubygems] Fix standalone script generation for statically linked dev ruby
https://github.com/rubygems/rubygems/commit/4d0d7b3c97
2022-06-23 18:17:37 +09:00
David Rodríguez 4f5eb48dea [rubygems/rubygems] Fix `bundle package --no-install` no longer skipping install
This is a regression from https://github.com/rubygems/rubygems/commit/cf749f8ffabd. The
funny thing is that we have a spec for this feature, so it was unclear
how we regressed here. It turns out there was a bug in one of our
negative matchers checking that gems ARE NOT included in a bundle.

This commit fixes the bug in the negative matcher and reverts
https://github.com/rubygems/rubygems/commit/cf749f8ffabd (with a slightly simpler diff).

https://github.com/rubygems/rubygems/commit/3f9a4ff32a
2022-06-23 18:17:08 +09:00
Nobuyoshi Nakada 883d13dc41 [Feature #18788] Spec for options as `String` to `Regexp.new`
Co-Authored-By: Janosch Müller <janosch.mueller@betterplace.org>
2022-06-20 19:35:12 +09:00
Nobuyoshi Nakada 39dc455b51 Spec update for warnning suspicious flag to `Regexp.new` 2022-06-20 19:35:12 +09:00
citrusmoose 8d689294d0 [rubygems/rubygems] Fix extension paths in generated standalone script
The paths for extensions of gems would contain the hardcoded ruby
version on which the extension was built. This will replace it with
runtime ruby version like the parent version directory. It will make the
standalone script compatible between different ruby version installations.

https://github.com/rubygems/rubygems/commit/a9dae93d5d
2022-06-20 16:04:47 +09:00
Jean Boussier eca31d24d6 [Bug #18813] Warn when autoload has to lookup in parent namespace
This is a verbose mode only warning.
2022-06-18 14:49:02 +02:00
David Rodríguez 78425d7e74 [rubygems/rubygems] Unset ENV set by official Ruby docker images
So that it does not interfere with our specs.

https://github.com/rubygems/rubygems/commit/1029714e21
2022-06-17 17:05:52 +09:00
Alan Wu e46292197f Fix spec version guard
Follow up for 278fefb962
2022-06-16 16:34:14 -04:00
Nobuyoshi Nakada 278fefb962 ENV.merge! support multile arguments [Feature #18279] 2022-06-17 01:22:24 +09:00
David Rodríguez d417c1ddc5 [rubygems/rubygems] Revert "Support running specs with asdf version manager"
This reverts commit https://github.com/rubygems/rubygems/commit/4b2d09af5bc7.

https://github.com/rubygems/rubygems/commit/90ca7a7163
2022-06-15 21:10:55 +09:00
David Rodríguez e09bdc11ec [rubygems/rubygems] Support running specs with asdf version manager
The `asdf-ruby` plugin sets `RUBYLIB` to require some code to reshim
after installing gems. This interferes with our specs.

Reset that, but leave any "internal" entries in places, because the
ruby-core test setup also uses RUBYLIB.

https://github.com/rubygems/rubygems/commit/4b2d09af5b
2022-06-15 18:14:21 +09:00
David Rodríguez d0bf31e6cf [rubygems/rubygems] Don't on gemspecs with invalid `require_paths`, just warn
These gemspecs already work most of the times. When they are installed
normally, the require_paths in the gemspec stub line becomes actually
correct, and the incorrect value in the real gemspec is ignored. It only
becomes an issue in standalone mode.

In Ruby 3.2, `Kernel#=~` has been removed, and that means that it
becomes harder for us to gracefully deal with this error in standalone
mode, because it now happens earlier due to calling `Array#=~` for this
invalid gemspec (since require_paths is incorrectly an array of arrays).

The easiest way to fix this is to actually make this just work instead
by automatically fixing the issue when reading the packaged gemspec.

https://github.com/rubygems/rubygems/commit/d3f2fe6d26
2022-06-12 02:02:20 +09:00
David Rodríguez f50432fba8 [rubygems/rubygems] Relax performance spec limit
https://github.com/rubygems/rubygems/commit/eab417d0ce
2022-06-07 21:04:53 +09:00
David Rodríguez eb5a01970f [rubygems/rubygems] Add test cases from SHA1 RFC and improve test failure message
I found that the current test cases did not cover the bitwise AND
performed on modified words after each iteration
(7e5765a66c/bundler/lib/bundler/digest.rb (L50))

https://github.com/rubygems/rubygems/commit/c8de819fee
2022-06-02 22:23:42 +09:00
David Rodríguez 1d924ae410 [rubygems/rubygems] Remove leftover debugging puts
https://github.com/rubygems/rubygems/commit/7c6f15040d
2022-06-02 19:30:48 +09:00
Ellen Marie Dash 1177665e62 [rubygems/rubygems] Fix `bundle remove` by invalidating cached `Bundle.defintion`.
Prior to this commit, `bundle add GEM_NAME` updated the lockfile,
but `bundle remove GEM_NAME` left GEM_NAME in the lockfile.

By invalidating the cached `Bundle.definition`, the existing code
handles that without a problem.

https://github.com/rubygems/rubygems/commit/aa0794d6a9
2022-06-01 19:01:18 +09:00
David Rodríguez 0a6b9924bd [rubygems/rubygems] Fix generated standalone script for default gems
The installer is actually rewriting the spec's full gem path to be the
one of the newly installed gem, however the accessor was not properly
working for `StubSpecification` instances, and default gems are always
of this type, because they are always present locally.

Fix the accessor to properly update the underlying full specification.

https://github.com/rubygems/rubygems/commit/efa41babfa
2022-06-01 17:07:35 +09:00
David Rodríguez fd83b8887f [rubygems/rubygems] Skip duplicated dependency warning for gemspec dev deps
Generally this warning is skipped for gemspec development dependencies.
I think because it's common to override them in the Gemfile to change
the source, for example.

But the order of conditions was not correct and the warning was still
being printed in one case.

https://github.com/rubygems/rubygems/commit/da9d1d6a3f
2022-06-01 00:14:31 +09:00
David Rodríguez e2b421d679 [rubygems/rubygems] Give better conflict resolution advice
This alternative really uses only the Gemfile, and can never end up
being absurd, because it will never be suggested when there's no
lockfile, and it suggests deleting the lockfile.

https://github.com/rubygems/rubygems/commit/5d154dd50e
2022-05-31 16:13:52 +09:00
David Rodríguez d6684f063b [rubygems/rubygems] Fix crash when commenting out a mirror in configuration
https://github.com/rubygems/rubygems/commit/2d99277328
2022-05-30 17:43:12 +09:00
David Rodríguez ea31c5bcd1 [rubygems/rubygems] Fix crash when installing gems with symlinks
If BUNDLE_PATH is configured to a symlinked path, installing gems with
symlinks would crash with an error like this:

```
Gem::Package::SymlinkError: installing symlink 'man/man0/README.markdown' pointing to parent path /usr/home/stevewi/srv/mail/lib/tools/.vendor/ruby/3.1.0/gems/binman-5.1.0/README.markdown of /srv/mail/lib/tools/.vendor/ruby/3.1.0/gems/binman-5.1.0 is not allowed
```

This commit fixes the problem by changing the bundle path to be the
realpath of the configured value, right after we're sure the path has
been created.

https://github.com/rubygems/rubygems/commit/3cd3dd142a
2022-05-30 17:42:39 +09:00
David Rodríguez 0d7d8f3777 [rubygems/rubygems] No need to use `FileUtils` to create symlinks
https://github.com/rubygems/rubygems/commit/70ff7cee9f
2022-05-30 17:42:38 +09:00
David Rodríguez 7001e34323 [rubygems/rubygems] Fix failing spec on Windows
https://github.com/rubygems/rubygems/commit/8e68c57457
2022-05-30 17:42:37 +09:00
Jeremy Evans 12e34a4276 Update rubyspec for stringio bug fix 2022-05-29 21:25:05 -07:00
David Rodríguez 08b82e6b40 [rubygems/rubygems] Ignore `Errno::EROFS` errors when creating `bundler.lock`
Apparently old versions of MacOS would set `GEM_HOME` to a `/System`
folder, and trying to create a file there raises `Errno::EROFS`.

We ignore the error. Any permission issues should be better handled
further down the line.

https://github.com/rubygems/rubygems/commit/ef90c071d0
2022-05-30 00:27:43 +09:00
David Rodríguez 373dabe00a [rubygems/rubygems] Ignore `Errno::EPERM` errors when creating `bundler.lock`
This kind of error can happen when setting `GEM_HOME` to a path
under MacOS System Integrity Protection.

We ignore the error. Any permission issues should be better handled
further down the line.

https://github.com/rubygems/rubygems/commit/174cb66863
2022-05-29 22:19:35 +09:00
David Rodríguez 6778d321a7 [rubygems/rubygems] Show better error when previous installation fails to be removed
Instead of guessing on the culprit.

We actually have a helper, `Bundler.rm_rf`, with exactly the behavior
that we want:

* Allow the passed folder to not exist.
* No exception swallowing other than that.

https://github.com/rubygems/rubygems/commit/5fa3e6f04a
2022-05-27 17:26:22 +09:00
David Rodríguez 633608ebd4 [rubygems/rubygems] Fix crash when printing resolution conflicts on metadata requirements
https://github.com/rubygems/rubygems/commit/b69e1e9374
2022-05-24 21:24:57 +09:00
Jean Boussier 65122d09d5 [Feature #18595] Alias String#-@ as String#dedup 2022-05-20 11:31:59 -07:00
Hiroshi SHIBATA aeea88174d
Merge RubyGems and Bundler HEAD
125415593e
2022-05-20 17:32:19 +09:00
David Rodríguez 6850e3c42e [rubygems/rubygems] Fix locale dependent spec failure
https://github.com/rubygems/rubygems/commit/1fd818743e
2022-05-20 07:05:19 +09:00
David Rodríguez 4c9ddaac0d [rubygems/rubygems] Fix `Gemfile.lock` versions leaking to `bundler/inline` install output
The lockfile is completely ignored in inline mode, yet the previous
output would suggest it wasn't.

https://github.com/rubygems/rubygems/commit/763125a745
2022-05-13 15:23:56 +09:00
David Rodríguez 8f1a8e68ba [rubygems/rubygems] Fix error message on metadata mismatches
Previously we were removing not installable specs. However, if those are
the only ones, that would result in a bad error message. If we still
choose them as a last resort, Bundler will later check metadata right
before installing a give a proper error.

This is a regression of https://github.com/rubygems/rubygems/commit/565549260be5 and the
fix is to revert that commit.

https://github.com/rubygems/rubygems/commit/bc18912257
2022-05-11 16:55:49 +09:00
David Rodríguez c582d9862a [rubygems/rubygems] Tweak negative expectations
The follow a tweak on the yank message.

https://github.com/rubygems/rubygems/commit/f6817bfe58
2022-05-11 16:55:48 +09:00
David Rodríguez 54b1548760 [rubygems/rubygems] Extract a `next_ruby_minor` helper method for specs
https://github.com/rubygems/rubygems/commit/66eae0ef1d
2022-05-11 16:55:47 +09:00
David Rodríguez 00e5e827b1 [rubygems/rubygems] Cleanup old legacy code
https://github.com/rubygems/rubygems/commit/531d6b5fee
2022-05-09 21:25:23 +09:00
David Rodríguez 42538ad710 [rubygems/rubygems] Fix missing space in spec
https://github.com/rubygems/rubygems/commit/fabc357e70
2022-05-04 06:45:16 +09:00
Hiroshi SHIBATA 1056489ea3 Merge 3f7d0352e8 2022-04-28 19:08:49 +09:00
Hiroshi SHIBATA 678d58c850 Merge rubygems master 1e4eda741d732ca1bd7031aef0a16c7348adf7a5 2022-04-28 19:08:49 +09:00
David Rodríguez 5250210aa9 [rubygems/rubygems] Fix missing required rubygems version when using old APIs
A while ago, we fixed resolution when using old dependency endpoints to
also consider metadata dependencies, by requesting the full gemspec from
the marsahaled index, which includes this information as opposed to
these old APIs. This has made resolution slower, but correct, but also
introduced the issue that some old marshaled gemspecs don't include the
`required_rubygems_version` field because they were created with a
RubyGems version that predates its addition.

Use a default value in this case.

https://github.com/rubygems/rubygems/commit/5dc94afcc0

Co-authored-by: Ilya Dudarenko <i.dudarenko@tinkoff.ru>
2022-04-28 15:44:02 +09:00
Benoit Daloze 45cf4f2187 Update to ruby/spec@3affe1e 2022-04-25 14:53:54 +02:00
Benoit Daloze 6ae81d49b5 Update to ruby/mspec@215497e 2022-04-25 14:53:51 +02:00
Tim Smith 810b9c344a Resolve several markedown warnings
- Spaces before and after blocks.
- Single spaces after sentences everywhere

Signed-off-by: Tim Smith <tsmith@mondoo.com>
2022-04-19 08:32:37 +09:00
Kazuhiro NISHIYAMA 50f3e93c80
Fix a typo 2022-04-17 20:57:46 +09:00
Bobby McDonald ccb0572ff9 [rubygems/rubygems] Add modern rubies to the platforms
https://github.com/rubygems/rubygems/commit/5462322f8f
2022-04-16 08:23:21 +09:00
Nobuyoshi Nakada 9e58c3c519
Get rid of type aliasing 2022-04-07 19:07:24 +09:00
Nobuyoshi Nakada 23090cf681
Suppress an unused function 2022-04-07 18:01:10 +09:00
Jeremy Evans 0b091fdac6
Raise RuntimeError if Kernel#binding is called from a non-Ruby frame
Check whether the current or previous frame is a Ruby frame in
call_trace_func and rb_tracearg_binding before attempting to
create a binding for the frame.

Fixes [Bug #18487]

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2022-04-06 19:14:03 -07:00
Jeremy Evans d1d48cb690 Revert "Raise RuntimeError if Kernel#binding is called from a non-Ruby frame"
This reverts commit 343ea9967e.

This causes an assertion failure with -DRUBY_DEBUG=1 -DRGENGC_CHECK_MODE=2
2022-04-01 07:22:49 -07:00
Jeremy Evans fbaadd1cfe
Do not autosplat array in block call just because keywords accepted
If the block only accepts a single positional argument plus keywords,
then do not autosplat.  Still autosplat if the block accepts more
than one positional argument in addition to keywords.

Autosplatting a single positional argument plus keywords made sense
in Ruby 2, since a final positional hash could be used as keywords,
but it does not make sense in Ruby 3.

Fixes [Bug #18633]
2022-03-30 11:03:56 -07:00
Jeremy Evans d8dfabbfe6 Fix spec description
Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2022-03-29 18:14:33 -07:00
Jeremy Evans 9c1d32a7ad Make TracePoint#enable with block target current thread by default
If TracePoint#enable is passed a block, it previously started
the trace on all threads.  This changes it to trace only the
current thread by default.  To limit the scope of the change,
the current thread is only used by default if target and
target_line are both nil.  You can pass target_thread: nil
to enable tracing on all threads, to get the previous
default behavior.

Fixes [Bug #16889]
2022-03-29 18:14:33 -07:00
Benoit Daloze 8db4f25bf4 Update to ruby/spec@aaf998f 2022-03-28 17:47:04 +02:00
Jeremy Evans 343ea9967e Raise RuntimeError if Kernel#binding is called from a non-Ruby frame
Check whether the current or previous frame is a Ruby frame in
call_trace_func before attempting to create a binding for the frame.

Fixes [Bug #18487]

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2022-03-24 12:31:07 -07:00
David Rodríguez 39606a774e [rubygems/rubygems] Maybe this is now fixed
https://github.com/rubygems/rubygems/commit/d9c442e54c
2022-03-24 20:22:00 +09:00
Nobuyoshi Nakada 1357b14750
Now all extension libraries must consider the ABI header 2022-03-24 08:59:24 +09:00
Jun Aruga 1ff174bfd1 [rubygems/rubygems] Fix a test for `bin/bundle update --bundler` to pass on ruby/ruby.
Consider the case that the latest Bundler version on RubyGems is higher than
the `system_bundler_version` (= `Bundler::VERSION`) in `make test-bundler` on
ruby/ruby.

See <https://bugs.ruby-lang.org/issues/18643>.

https://github.com/rubygems/rubygems/commit/bfa2f72cfa
2022-03-23 00:01:17 +09:00
Benoit Daloze 1fd1f7bbfc Fix Markdown syntax in spec/README.md 2022-03-21 17:40:42 +01:00
Jeremy Evans b6804d62f8 Make Proc#parameters support lambda keyword for returning parameters as if lambda
This makes it easier to use Proc#parameters to build wrappers.

Implements [Feature #15357]
2022-03-17 11:52:02 -07:00
Nobuyoshi Nakada e660b934b9
A positional Hash is not keyword arguments [Bug #18632] 2022-03-17 20:53:41 +09:00
Yuta Saito e9553a8cac spec: skip specs where set TZ environment variable for WASI
WASI doesn't respect TZ env var for now
2022-03-17 17:44:41 +09:00
Yuta Saito 7023b3d394 spec: disable a part of Kernel.open spec where spawns a process for WASI
WASI doesn't provide a way to spawn a new process
2022-03-17 17:33:12 +09:00
Yuta Saito e499d32689 spec: disable part of require_relative spec where uses symlink for WASI
cap-std, an underlying sandbox implementation of WASI in wasmtime, doesn't
allow to create a symlink to an absolute path to enforce sandbox restriction.

See also: 257867a1d3
2022-03-17 12:26:19 +09:00
Yuta Saito b1bcad5e3a spec: skip '~' test for wasi due to lack of shell 2022-03-14 23:05:15 +09:00
Yuta Saito fe2e5c13f9 spec: skip ruby_exe tests for wasi due to lack of subprocess 2022-03-14 23:04:13 +09:00
Martin Dürst 267f0089d3 clarify meaning of version guards for Unicode version specs [ci skip] 2022-03-14 08:39:06 +09:00
Benoit Daloze 1b571d0abf Fix guards for unicode versions specs 2022-03-13 13:27:47 +01:00
Martin Dürst 45187a0fcd comment out failing Unicode/Emoji version checks temporarily 2022-03-13 10:52:24 +09:00
Martin Dürst 9b545b0caf update specs to check for Unicode Version 14.0.0/Emoji Version 14.0 2022-03-13 09:19:52 +09:00
Alex Gittemeier 943efa8ca6 [rubygems/rubygems] Add newline to validate_platforms! message when platform is missing
When I run bundle install with BUNDLE_DEPLOYMENT=true in the environment
on a different platform than I usually do development, I get the
following output to the console (wrapped exactly as shown):

Your bundle only supports platforms ["x86_64-darwin-19"] but your local platform
is x86_64-linux. Add the current platform to the lockfile with `bundle lock
--add-platform x86_64-linux` and try again.

Because the way the message wraps, its not as simple as copying the
suggested command to the clipboard because it contains a newline:

    $ bundle lock
    Writing lockfile to [...]/Gemfile.lock
    $ --add-platform x86_64-linux

Adding a newline right before the command forces the command in the
error message to be on the same line, which facilitates copy-pasting the
command in the message.

https://github.com/rubygems/rubygems/commit/4cf6989b11
2022-03-08 03:40:30 +09:00
David Rodríguez 156079a85d [rubygems/rubygems] Make `--strict` flag of `update` and `outdated` commands consistent
Previously they had slightly different behavior when combined with
conservative updating flags.

The correct behavior is the `--update-strict` option, so `--script` now
does that, The `--update-strict` option is left there for now but I will
deprecate it later.

https://github.com/rubygems/rubygems/commit/ab42046229
2022-03-06 22:17:00 +09:00
Nobuyoshi Nakada c757c4e054
sitelibdir makes no sense in ruby itself 2022-03-04 15:56:03 +09:00
Benoit Daloze 3b21818db1 Update to ruby/spec@82cd3a3 2022-03-03 14:43:14 +01:00
Benoit Daloze 1dc6bed0ca Update to ruby/mspec@bd47c2a 2022-03-03 14:43:11 +01:00
Yuta Saito bd1507b2f6 spec: skip ext's extension spec for --with-static-linked-ext
`resolve_feature_path` doesn't return .so when the given ext is linked
statically by --with-static-linked-ext
2022-02-28 17:59:33 +09:00
Hiroshi SHIBATA ff3d7b720e Merge RubyGems and Bundler master 2022-02-28 11:39:20 +09:00
Nobuyoshi Nakada e82f5db789
Deprecate the unintentional ability to parse `Symbol` 2022-02-26 02:42:35 +09:00
David Rodríguez 7b676b3ce3 [rubygems/rubygems] Fix corrupted lockfile when using `gemspec` and multiple sources
https://github.com/rubygems/rubygems/commit/9712262d90
2022-02-11 18:20:20 +09:00
Sven Schwyn a271acf822 [rubygems/rubygems] Fix typo in multiple gemfiles warning
https://github.com/rubygems/rubygems/commit/bc69d19097
2022-02-10 08:38:09 +09:00
Dan Jensen 0b2f6b942b [rubygems/rubygems] Skip "seller shipped" notification after delivery
If a Shipment has been delivered, there is no point in notifying the
buyer that the seller shipped. Instead, we should simply notify the
buyer that the shipment was delivered. This is relevant in cases where
the seller is late to mark a Shipment as shipped, so the first EasyPost
Tracker update marks it as delivered, or in cases where the seller
fails to mark as shipped and the buyer marks it as delivered.

This fixes a Shipment event handler so the buyer notification for
shipment is no longer invoked if the Shipment is already delivered.

https://github.com/rubygems/rubygems/commit/09c2cadc86
2022-02-01 20:07:18 +09:00
David Rodríguez 517d7c3221 Sync latest Bundler & RubyGems 2022-02-01 08:09:23 +09:00
Benoit Daloze e0c5488ff9 Update to ruby/spec@902ab83 2022-01-28 14:42:38 +01:00
Benoit Daloze bb5f710887 Update to ruby/mspec@49adc2f 2022-01-28 14:42:36 +01:00
David Rodríguez c925d3b668 [rubygems/rubygems] Fix `force_ruby_platform` ignored when lockfile includes the current specific platform
https://github.com/rubygems/rubygems/commit/9ca371adf8
2022-01-26 13:09:31 +09:00
Ngan Pham 42ef3fcaef [rubygems/rubygems] Use Gem::Platform.local instead of RUBY_PLATFORM
In certain places, we want to display the platform name with
`Gem::Platform.local` instead of `RUBY_PLATFORM`.

Fixes https://github.com/rubygems/rubygems/issues/5264

https://github.com/rubygems/rubygems/commit/bdd1848ae8
2022-01-26 02:24:30 +09:00
David Rodríguez 342e7a094a [rubygems/rubygems] Fix spec to not touch the network
And not depend on the state of rack's master branch, in particular, on
their Ruby support range.

https://github.com/rubygems/rubygems/commit/9ea4baffac
2022-01-25 22:12:33 +09:00
David Rodríguez cd806e19b7 [rubygems/rubygems] Remove unnecessary comment
https://github.com/rubygems/rubygems/commit/ef4e5c6169
2022-01-25 22:12:33 +09:00
Kazuhiro NISHIYAMA bb955096d8
Fix a typo [ci skip] 2022-01-23 21:56:39 +09:00
Yusuke Nakamura 7353f950c3 [rubygems/rubygems] Change generated namespaced test class name in minitest
* `foo` => `TestFoo`
* `foo_bar` => `TestFooBar`
* `foo-bar` => `Foo::TestBar`

https://github.com/rubygems/rubygems/commit/353cdd61c3
2022-01-20 01:04:53 +09:00
Yusuke Nakamura 26e0450ba9 [rubygems/rubygems] Add spec to class name definition in newgem spec
https://github.com/rubygems/rubygems/commit/5f698fc4a0
2022-01-20 01:04:53 +09:00
Yusuke Nakamura 4451313252 [rubygems/rubygems] Update generated minitest file style
foo     => test/test_foo.rb
foo-bar => test/foo/test_bar.rb
foo_bar => test/test_foo_bar.rb

https://github.com/rubygems/rubygems/commit/c795e5d40d
2022-01-20 01:04:52 +09:00
Yusuke Nakamura 4e955b2e37 [rubygems/rubygems] Create minitest file to underscored path in "bundle gem" command
...with dashed gem name

In "bundle gem" command with dashed name gem (e.g. foo-bar) generates
`test/test_foo/bar.rb`, but this file contains undefined class `TestFoo`
and moreover, does not include in "bundle exec rake test" target.

Therefore, intentially the first test after gem created is fail, but in
case of gem name contains dash character is not.

The change doings...
(when "bundle gem foo-bar" called)

* create `test/test_foo_bar.rb`
* define `TestFooBar` class in `test/test_foo_bar.rb`

https://github.com/rubygems/rubygems/commit/5d9a69fc0f
2022-01-20 01:04:52 +09:00
Hiroshi SHIBATA d22511fd75 Merge rubygems/rubygems HEAD.
Picked at 12aeef6ba9a3be0022be9934c1a3e4c46a03ed3a
2022-01-19 15:01:44 +09:00
David Rodríguez e7249294fb
[rubygems/rubygems] Fix regression with old marshaled specs having null required_rubygems_version
https://github.com/rubygems/rubygems/commit/91f07a0208
2022-01-19 11:20:36 +09:00
David Rodríguez 39c36a5cf4
[rubygems/rubygems] Fix skipped spec on Windows
https://github.com/rubygems/rubygems/commit/bf0f4b98ee
2022-01-19 11:20:36 +09:00
Kazuhiro NISHIYAMA 2dc365db79
Fix spec failures on ruby 3.1
Because Module#const_added is ruby 3.2 feature
2022-01-15 13:30:20 +09:00
Jeremy Evans a93cc3e23b Make Hash#shift return nil for empty hash
Fixes [Bug #16908]
2022-01-14 12:17:57 -08:00
Jeremy Evans ca3d405242 Fix constant assignment evaluation order
Previously, the right hand side was always evaluated before the
left hand side for constant assignments.  For the following:

```ruby
lhs::C = rhs
```

rhs was evaluated before lhs, which is inconsistant with attribute
assignment (lhs.m = rhs), and apparently also does not conform to
JIS 3017:2013 11.4.2.2.3.

Fix this by changing evaluation order.  Previously, the above
compiled to:

```
0000 putself                                                          (   1)[Li]
0001 opt_send_without_block                 <calldata!mid:rhs, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0003 dup
0004 putself
0005 opt_send_without_block                 <calldata!mid:lhs, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0007 setconstant                            :C
0009 leave
```

After this change:

```
0000 putself                                                          (   1)[Li]
0001 opt_send_without_block                 <calldata!mid:lhs, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0003 putself
0004 opt_send_without_block                 <calldata!mid:rhs, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0006 swap
0007 topn                                   1
0009 swap
0010 setconstant                            :C
0012 leave
```

Note that if expr is not a module/class, then a TypeError is not
raised until after the evaluation of rhs.  This is because that
error is raised by setconstant.  If we wanted to raise TypeError
before evaluation of rhs, we would have to add a VM instruction
for calling vm_check_if_namespace.

Changing assignment order for single assignments caused problems
in the multiple assignment code, revealing that the issue also
affected multiple assignment.  Fix the multiple assignment code
so left-to-right evaluation also works for constant assignments.

Do some refactoring of the multiple assignment code to reduce
duplication after adding support for constants. Rename struct
masgn_attrasgn to masgn_lhs_node, since it now handles both
constants and attributes. Add add_masgn_lhs_node static function
for adding data for lhs attribute and constant setting.

Fixes [Bug #15928]
2022-01-14 11:00:26 -08:00
Jean Boussier 8d05047d72 Add a Module#const_added callback
[Feature #17881]

Works similarly to `method_added` but for constants.

```ruby
Foo::BAR = 42 # call Foo.const_added(:FOO)
class Foo::Baz; end # call Foo.const_added(:Baz)
Foo.autoload(:Something, "path") # call Foo.const_added(:Something)
```
2022-01-14 11:30:07 +01:00
Vyacheslav Alexeev d0a0637948 [rubygems/rubygems] Use `Fiddle` in `bundle doctor` to check for dynamic library presence
https://github.com/rubygems/rubygems/commit/ecd495ce1b
2022-01-13 18:16:05 +09:00
Benoit Daloze 4053e8ba0d Update to ruby/spec@226cfdc 2022-01-10 16:29:54 +01:00
Benoit Daloze 8abfc10605 Update to ruby/mspec@3ea3d32 2022-01-10 16:29:53 +01:00
Kazuhiro NISHIYAMA 5e7cd480f9
Fix spec failure on ruby 3.1
Because https://github.com/ruby/ruby/pull/5148 merged after Ruby 3.1.0 released.

13241b71a5 did not fix proc spec yet.

https://github.com/ruby/actions/runs/4718820699?check_suite_focus=true#step:18:173
```
  1)
  Proc#parameters adds * rest arg for "star" argument FAILED
  Expected [[:req, :x], [:rest]] == [[:req, :x], [:rest, :*]]
  to be truthy but was false
  /home/runner/work/actions/actions/snapshot-ruby_3_1/spec/ruby/core/proc/parameters_spec.rb:85:in `block (3 levels) in <top (required)>'
  /home/runner/work/actions/actions/snapshot-ruby_3_1/spec/ruby/core/proc/parameters_spec.rb:3:in `<top (required)>'
```
2022-01-06 10:14:11 +09:00
Jeremy Evans 791343b5bb Remove Refinement#{extend_object,append_features,prepend_features}
Also make include, prepend, and extend raise a TypeError if one
of the modules is a refinement.

Implements [Feature #18270]
2022-01-05 10:59:03 -08:00
Kazuhiro NISHIYAMA 13241b71a5
Fix failures on ruby 3.1
Because https://github.com/ruby/ruby/pull/5148 merged after Ruby 3.1.0 released.

https://github.com/ruby/actions/runs/4705986643?check_suite_focus=true#step:18:144
```
  1)
  Method#parameters adds * rest arg for "star" argument FAILED
  Expected [[:rest]] == [[:rest, :*]]
  to be truthy but was false
  /home/runner/work/actions/actions/snapshot-ruby_3_1/spec/ruby/core/method/parameters_spec.rb:228:in `block (3 levels) in <top (required)>'
  /home/runner/work/actions/actions/snapshot-ruby_3_1/spec/ruby/core/method/parameters_spec.rb:4:in `<top (required)>'

  2)
  Proc#parameters adds * rest arg for "star" argument FAILED
  Expected [[:req, :x], [:rest]] == [[:req, :x], [:rest, :*]]
  to be truthy but was false
  /home/runner/work/actions/actions/snapshot-ruby_3_1/spec/ruby/core/proc/parameters_spec.rb:85:in `block (3 levels) in <top (required)>'
  /home/runner/work/actions/actions/snapshot-ruby_3_1/spec/ruby/core/proc/parameters_spec.rb:3:in `<top (required)>'
```
2022-01-05 08:18:47 +09:00
Nobuyoshi Nakada 5074aa1984 [rubygems/rubygems] Test the actual checksums of the mock gems
https://github.com/rubygems/rubygems/commit/2b42630959
2022-01-04 14:59:18 +09:00
Nobuyoshi Nakada 0bfb406b75 [rubygems/rubygems] Fix the test to use the mock gem path
"NUL.*" means the NUL device on Windows, as well as mere "NUL",
and no data is read.

https://github.com/rubygems/rubygems/commit/e2c7d22745
2022-01-04 14:59:17 +09:00
Nobuyoshi Nakada 8f9623741a [rubygems/rubygems] Append a newline to the checksum file
https://github.com/rubygems/rubygems/commit/48ea2778e9
2022-01-04 14:59:17 +09:00
Nobuyoshi Nakada c2e8e1f6a4 [rubygems/rubygems] Fix checksum
Calculate the checksum of the content, not the given pathname at
the build time itself.

https://github.com/rubygems/rubygems/commit/b60ee97ee9
2022-01-04 14:59:16 +09:00
卜部昌平 980bf94f02
Kernel#=~: delete
Has been deprecated since ebff9dc10e.
2022-01-03 22:33:38 +09:00