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

66923 Коммитов

Автор SHA1 Сообщение Дата
Jeremy Evans 4fc9ddd7b6 Update Capturing and Anchors sections of regexp documention
Document that only first 9 numbered capture groups can use the \n
backreference syntax.  Document \0 backreference.  Document \K anchor.

Fixes [Bug #14500]
2021-07-27 12:30:43 -07:00
Jeremy Evans 35e467080c Make Float#floor with ndigits argument handle error
The previous implementation could result in a returned
float that is 1/(10**ndigits) too low.  First try adding
one before dividing, and if that results in a value that is
greater than the initial number, then try the original
calculation.

Spec added for ciel, but the issue doesn't appear to affect
ciel, at least not for the same number.  If the issue does
effect ciel, a similar fix could probably work for it.

Fixes [Bug #18018]
2021-07-27 11:00:45 -07:00
git 338b604b32 * 2021-07-28 [ci skip] 2021-07-28 02:48:15 +09:00
Jeremy Evans a6dc48f86a Fix infinite loop in ensure after NoMemoryError
VM patch from wanabe.

Test based on example from buzztaiki (Taiki Sugawara).

Test fails when compiles with -DRUBY_DEBUG, as that can
can use rb_bug instead of NoMemoryError, which doesn't
allow testing this case. Test also fails on MingW, as
RangeError is used instead of NoMemoryError. Skip the
test in either case.

Fixes [Bug #15779]
2021-07-27 10:47:53 -07:00
Jeremy Evans 230111802c
[ruby/find] Add Errno::EINVAL to list of ignored errors
This error can occur on Windows for certain filenames on certain
code pages.

Fixes [Bug #14591]

https://github.com/ruby/find/commit/0a474d1027
2021-07-27 21:20:31 +09:00
Nobuyoshi Nakada acfec23bec
Remove probably unintented symlinks 2021-07-27 18:49:28 +09:00
Martin Dürst 26b1e6fca8 Deal with Unicode ranges in the file emoji-sequences.txt
Detect Unicode ranges and loop over them.
This fixes issue #18028.
2021-07-27 18:14:20 +09:00
Hiroshi SHIBATA c3d31377b3
Bump unicode version for Ruby 3.1 2021-07-27 18:00:32 +09:00
Hiroshi SHIBATA 6656309fe2
Fix test failure for parallel testing 2021-07-27 17:34:13 +09:00
Hiroshi SHIBATA b875a85c53
Added missing require for URI::WS class 2021-07-27 17:33:18 +09:00
Martin Dürst 3010b40477 Adjust test/ruby/enc/test_emoji_breaks.rb to handle Emoji Version 13.1
Deal with the issue that the emoji files in emoji/13.1 have Unicode
Emoji version 13.1, but at the same time the files in 13.0.0/ucd/emoji
are still at Emoji version 13.0. Specifically:
- Add a version attribute to TestEmojiBreaks::BreakFile
- Take the version for emoji-variant-sequences.txt from the Unicode
  version, removing the last two characters.
- Improve information in exceptions for file name and version mismatches.
2021-07-27 17:10:49 +09:00
Martin Dürst 01e98d8785 Change Unicode Emoji Version from 13.0 to 13.1 2021-07-27 17:10:49 +09:00
Hiroshi SHIBATA d3d68aa842
[ruby/uri] User assert_ractor for test case of Ractor
https://github.com/ruby/uri/commit/bbf8b44dba
2021-07-27 16:57:03 +09:00
Benoit Daloze 1cf111774f
[ruby/uri] Add proper Ractor support to URI
* Using a module to map scheme name to scheme class, which also works with Ractor.
* No constant redefinition, no ObjectSpace, still fast lookup for initial schemes.

https://github.com/ruby/uri/commit/883567fd81
2021-07-27 16:54:27 +09:00
Benoit Daloze 090d799c24
[ruby/uri] Revert "Fix to support Ruby 3.0 Ractor"
* This reverts commit 1faa4fdc161d7aeebdb5de0c407b923beaecf898.
* It has too many problems, see https://github.com/ruby/uri/pull/22 for discussion.

https://github.com/ruby/uri/commit/b959da2dc9
2021-07-27 16:54:26 +09:00
kvokka a288c21a5d
[ruby/uri] Fix to support Ruby 3.0 Ractor
https://github.com/ruby/uri/commit/1faa4fdc16
2021-07-27 16:54:26 +09:00
Nobuyoshi Nakada 82191da2a2 Predefine recursive key ID 2021-07-27 15:40:27 +09:00
Nobuyoshi Nakada 03e7fc895e Extracted repeatedly defined IDs 2021-07-27 15:40:27 +09:00
Nobuyoshi Nakada 537e824561 Don't redefine #rb_intern over and over again 2021-07-27 15:40:27 +09:00
Nobuyoshi Nakada 6329da588b Use predefined IDs 2021-07-27 15:40:27 +09:00
Nobuyoshi Nakada 0754cc4888 Added intern_ids.rb 2021-07-27 15:40:27 +09:00
Samuel Williams 13f8521c63 Fix potential hang when joining threads.
If the thread termination invokes user code after `th->status` becomes
`THREAD_KILLED`, and the user unblock function causes that `th->status` to
become something else (e.g. `THREAD_RUNNING`), threads waiting in
`thread_join_sleep` will hang forever. We move the unblock function call
to before the thread status is updated, and allow threads to join as soon
as `th->value` becomes defined.
2021-07-27 18:23:30 +12:00
Nobuyoshi Nakada cd49940cff
Run in a separated process to run finalizers certainly 2021-07-27 14:55:20 +09:00
Yusuke Endoh 2de7c29b37 test/ruby/test_parse.rb: Prevent an "unused variable" warning 2021-07-27 13:41:58 +09:00
Nobuyoshi Nakada 2d0a1e5f61
Try GC more during suppressing the warning 2021-07-27 12:30:06 +09:00
Nobuyoshi Nakada ed51e8b8fa
Make GCed during suppressing the warning
Consume the VM stack more, to make the target object get GCed with
more probability during suppressing the warning.
2021-07-27 11:47:11 +09:00
git 5b27c1a15b * 2021-07-27 [ci skip] 2021-07-27 09:57:09 +09:00
Daniel Niknam bd8daa8523
[rubygems/rubygems] Remove the warning for not defining a gem server source
Bundler has deprecated gemfiles without a global source and this feature
is now obsolete. `Bundler::Definition#has_rubygems_remotes?` is removed
because it's not used anymore.

https://github.com/rubygems/rubygems/commit/d29dd2cb7b
2021-07-27 09:25:57 +09:00
Daniel Niknam 49176e8c8c
[rubygems/rubygems] Refactor Bundler::Dsl#check_rubygems_source_safety to improve readability
`check_rubygems_source_safety` is responsible for:

1. if there are multiple global sources
  - for bundle 3.x raise an error
  - for bundle 2.x print a warning
2. print a warning if there is no explicit global source

The second responsibility was added recently and now the logic could be
extracted to improve readability. Conditions are still live in the `check_rubygems_source_safety` method
since we don't want to call both functions always and that would help us achieve that.

https://github.com/rubygems/rubygems/commit/f3d7e946ee
2021-07-27 09:25:57 +09:00
Daniel Niknam 1ef360230e
[rubygems/rubygems] Deprecate Gemfile without an explicit global source
Raise a warning when parsing a Gemfile and it doesn't have a global source. Gemfiles like this, specially now that rubygems sources are are no longer merged into a single source for security, are very confusing because they generate a different lockfile depending on the gems you have locally installed. This is because bundler always use an implicit global source that defaults to locally installed gems.

https://github.com/rubygems/rubygems/commit/b7523ad21c
2021-07-27 09:25:57 +09:00
Daniel Niknam 2f9e0cf181
[rubygems/rubygems] Explicitly define a global source for tests
This is in preparation for deprecating source-less gemfiles.

https://github.com/rubygems/rubygems/commit/d6493fa3e2
2021-07-27 09:25:57 +09:00
Daniel Niknam b500e8fab4
[rubygems/rubygems] Implement Bundler::SourceList#implicit_global_source?
This method is created to tell whether any global source exist in the object or not and it will be used by `Bundler:Dsl` to print a warning if no global source has been defined in the Gemfile.

https://github.com/rubygems/rubygems/commit/422fec4438
2021-07-27 09:25:57 +09:00
Daniel Niknam 91a3f06e98
[rubygems/rubygems] Implement Bundler::Source::Rubygems#no_remotes?
This method is created to tell whether any remote exist in the object or not and it will be used by `Bundler:SourceList` to tell if a global source has been defined implicitly or not.

https://github.com/rubygems/rubygems/commit/47e3ff0e47
2021-07-27 09:25:56 +09:00
David Rodríguez 095b5bbcc1
[rubygems/rubygems] Lazily load shellwords
https://github.com/rubygems/rubygems/commit/ef6388656a
2021-07-27 09:25:56 +09:00
David Rodríguez 350f4a0b66
[rubygems/rubygems] Rubygems doesn't need to load the `base64` library
https://github.com/rubygems/rubygems/commit/fe723c0f7f
2021-07-27 09:25:56 +09:00
David Rodríguez 960023ff54
[rubygems/rubygems] Rubygems doesn't need to load the `resolv` library
https://github.com/rubygems/rubygems/commit/8bf41f53cc
2021-07-27 09:25:56 +09:00
David Rodríguez 9cddc0ec94
[rubygems/rubygems] Lazily load `shellwords` library
https://github.com/rubygems/rubygems/commit/e5532ef886
2021-07-27 09:25:56 +09:00
David Rodríguez 9ac89fe35e
[rubygems/rubygems] The `--quiet` should still display warnings
The is the previous intentional behaviour until
ca0676cb1c.

In my opinion, that previous behaviour was better and should be
restored, because we want our users to always see warnings and fix them.
And the original issue that motivated the change is fixable by other
means, namely through `BUNDLE_SILENCE_ROOT_WARNING`, or through
`BUNDLE_SILENCE_DEPRECATIONS` in general. Finally, the --quiet option is
still documented as "only print errors and warnings".

So this PR essentially reverts
ca0676cb1c
for the above reasons.

https://github.com/rubygems/rubygems/commit/35f2254dfc
2021-07-27 09:25:56 +09:00
David Rodríguez 24aca87def
[rubygems/rubygems] Make `--quiet` spec independent on the specific warning
We'll be removing the warning about no gem sources, so this spec will no
longer test that warnings are hidden by `--quiet`.

Test that in another way so that we don't lose the coverage when we
drop the specific warning about no gem server sources.

https://github.com/rubygems/rubygems/commit/cce4f86d28
2021-07-27 09:25:56 +09:00
Nobuyoshi Nakada 803c60858e
[rubygems/rubygems] Check requirements classes
Mitigate the security risk:
https://devcraft.io/2021/01/07/universal-deserialisation-gadget-for-ruby-2-x-3-x.html

https://github.com/rubygems/rubygems/commit/141c2f4388
2021-07-27 09:25:56 +09:00
David Rodríguez 88e46cf6b8
[rubygems/rubygems] Remove all `syck` traces from `rubygems`
After reading [this blog
post](https://blog.rubygems.org/2011/08/31/shaving-the-yaml-yak.html),
published almost 10 years ago already, my understanding is that this
problem could come up in two ways:

* Rubygems.org serving corrupted gemspecs". As far as I understand this
was fixed in rubygems.org a lot time ago, since
https://github.com/rubygems/rubygems.org/pull/331.

* Clients having a ten years old gemspec cache with some of these bad
gemspecs. In this case, there's no easy solution but I think ten years
is enough and rebuilding the cache should do the trick.

So, I think it's time we remove this.

https://github.com/rubygems/rubygems/commit/afcb15d556
2021-07-27 09:25:56 +09:00
David Rodríguez 6bcedabfdd
[rubygems/rubygems] Remove `gem install` hint when installing a gem fails
A fresh `gem install` might not reproduce the exact `bundle install`
environment that originally caused the error. It also makes it harder
for the user to troubleshoot the error since she needs to run a separate
command.

Instead, show the original error and backtrace directly.

https://github.com/rubygems/rubygems/commit/49c2abfec6
2021-07-27 09:25:55 +09:00
David Rodríguez 6eb6f740f2
[rubygems/rubygems] Show a backtrace in case gem installation fails
For example, due to extension compilation issues.

https://github.com/rubygems/rubygems/commit/adbe55bb6a
2021-07-27 09:25:55 +09:00
David Rodríguez 4271f4aea5
[rubygems/rubygems] Fix bundler binstub version selection
To mimic built-in rubygems behaviour, only thing that should be
approximated is the lockfile version. Other alternatives like
`BUNDLER_VERSION` should be respected exactly.

https://github.com/rubygems/rubygems/commit/dbd667d4bc
2021-07-27 09:25:55 +09:00
Daniel Niknam 90899c50c2
[rubygems/rubygems] Remove LoadError message in regards to requiring a relative file
Ruby 1.9.2 removed "." from LOAD_PATH for robustness and security reasons.
This code was introduced by 56fc830e19 commit
to helping users understand the issue and had a guard condition to include the message for `RUBY_VERSION >= "1.9"`.
However, the guard condition was removed as part of the "Ruby version leftover" cleanup by
8c9cf76e41

Ruby 1.9 development was ended a long time ago and this message is not useful anymore.

https://github.com/rubygems/rubygems/commit/a23609b15a
2021-07-27 09:25:55 +09:00
Andrew Haines 705b1bdef2
[rubygems/rubygems] Fix interrupt handling in Bundler workers
The existing interrupt handling using `SharedHelpers.trap` fails when the previous
handler for a signal is not callable (for example, when it is the string "DEFAULT").

Instead, we now handle interrupts by aborting the process when worker threads are
running, and restore the previous handler after worker threads are finished.

Fixes #4764.

https://github.com/rubygems/rubygems/commit/b9f455d487
2021-07-27 09:25:55 +09:00
Benoit Daloze c8172d0b96 rb_iterate is no longer used in ruby/spec 2021-07-26 13:24:38 +02:00
Nobuyoshi Nakada b8386f7f7f
Prepend DebugSystem to VCS class only
And revert 24e5f1c982, pepending to
Kernel did not affect the top level methods before 3.0.
2021-07-26 15:44:40 +09:00
Nobuyoshi Nakada 24e5f1c982
Ignore 7z unless available
`DebugSystem#system` is prepended in vcs.rb and defaulted to
`exception: true`.
2021-07-26 14:17:30 +09:00
git 165a098ffc * 2021-07-26 [ci skip] 2021-07-26 05:09:20 +09:00