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

10761 Коммитов

Автор SHA1 Сообщение Дата
Yusuke Endoh 4e728486b9 [ruby/error_highlight] Bump version
https://github.com/ruby/error_highlight/commit/59c291cce1
2022-11-08 08:07:39 +00:00
Takashi Kokubun 9001e53e68 [ruby/irb] Support non-string input in show_source
(https://github.com/ruby/irb/pull/430)

* Support non-string input in show_source

* Test show_source as a method
2022-11-07 17:29:28 +00:00
Stan Lo ca0b592673 [ruby/irb] Don't lazily retrieve gem specs for completion
There are a few downsides of the current approach:

1. Because gem specs are lazily retrieved, this computation happens in
   every irb completion test case, which is not necessary. (In tests we
   don't cache the result of `retrieve_files_to_require_from_load_path`)
2. Gem::Specification.latest_specs is sensible to the content of
   LOAD_PATH. And when combined with 1, tests fail "randomly" if they
   try to mutate LOAD_PATH, even though the test subject it's something
   else.

So by pre-computing and storing the gem paths in a constant, it guarantees
that the computation only happens once and it doesn't get affected by test
cases.

One argument could be made against the change is that, it'll store
unnecessary data for users that disable autocompletion. But the
counter-arguments are:

1. Since autocompletion is enabled by default, this should not be the
   case for most users.
2. For users with autocompletion enabled, IRB already caches the
   result of `retrieve_files_to_require_from_load_path` in memory, which
   should have a similar size of GEM_SPECS. And we currently haven't
   received any report about problems caused by such memory consumption.

https://github.com/ruby/irb/commit/c671d39020
2022-11-07 14:44:25 +00:00
Yusuke Endoh 72c7dba436 [ruby/fileutils] Revert "FileUtils.rm* methods swallows only Errno::ENOENT when force is true"
This reverts commit https://github.com/ruby/fileutils/commit/fa65d676ece9.

This caused some incompatibility problems in real-world cases.
https://bugs.ruby-lang.org/issues/18784#change-98927
https://bugs.ruby-lang.org/issues/18784#change-98967

https://github.com/ruby/fileutils/commit/42983c2553
2022-11-07 11:25:25 +00:00
Peter Zhu b228effd0c [rubygems/rubygems] Drop support for IRIX
The IRIX OS is no longer maintained with the last release being 16 years
ago.

https://github.com/rubygems/rubygems/commit/5381c6a871
2022-11-07 10:52:14 +00:00
Peter Zhu 1e53ebae57 [rubygems/rubygems] Drop support for bitrig
The bitrig OS is no longer maintained with the last release being 7
years ago.

https://github.com/rubygems/rubygems/commit/85ed90ddd0
2022-11-07 10:52:14 +00:00
Peter Zhu 0fb7a1c77c [rubygems/rubygems] Drop support for HP-UX
Support for HP-UX was dropped in Ruby in ruby/ruby#5457.

https://github.com/rubygems/rubygems/commit/a3a8df3582
2022-11-07 10:52:13 +00:00
Takashi Kokubun b169d78c88 [ruby/erb] Avoid using prepend + super for fallback
(https://github.com/ruby/erb/pull/28)

`prepend` is prioritized more than ActiveSupport's monkey-patch, but the
monkey-patch needs to work.

https://github.com/ruby/erb/commit/611de5a865
2022-11-04 16:46:29 +00:00
Takashi Kokubun dc5d06e9b1 [ruby/erb] Copy CGI.escapeHTML to ERB::Util.html_escape
https://github.com/ruby/erb/commit/ac9b219fa9
2022-11-04 07:07:23 +00:00
Takashi Kokubun a13836e70d [ruby/irb] Allow non-identifier aliases like Pry's @ and $
(https://github.com/ruby/irb/pull/426)

* Allow non-identifier aliases

* Move the configuration to IRB.conf

* Avoid abusing method lookup for symbol aliases

* Add more alias tests

* A small optimization

* Assume non-nil Context

* Load IRB.conf earlier

https://github.com/ruby/irb/commit/e23db5132e
2022-11-03 22:09:55 +00:00
Stan Lo c5d6a483f5 [ruby/irb] Refactor RubyLex and its tests
(https://github.com/ruby/irb/pull/427)

* Make sure `RubyLex#set_input`'s context is always present in tests

In real-world scenarios, the context should always be non-nil:
https://github.com/ruby/irb/blob/master/lib/irb.rb#L489

So we should make sure our test setup reflects that.

* Make context a required keyword

Since in practice, `set_input`'s context should always be non-nil, its
parameters should reflect that.

And since `RubyLex#check_state` is only called by `#lex` and
`#set_input`, both of which now always require context, we can assume
its context should be non-nil too.

https://github.com/ruby/irb/commit/1aeeb86203
2022-11-03 16:32:22 +00:00
Takashi Kokubun c24800f4f7 [ruby/erb] Fix CI for JRuby
https://github.com/ruby/erb/commit/df642335b7
2022-11-03 05:58:13 +00:00
eileencodes 350d0aa023 [ruby/error_highlight] Support nodes in `spot`
Fixes a bug where `spot` was using the wrong local variable.

We want to use error highlight with code that has been eval'd,
specifically ERB templates. We can recover the compiled source code of
the ERB template but we need an API to pass the node into error
highlight's `spot`.

Required Ruby PR: https://github.com/ruby/ruby/pull/6593

https://github.com/ruby/error_highlight/commit/0b1b650a59

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2022-10-31 04:58:38 +00:00
Whyme Lyu 37291df91d [ruby/optparse] #load() into hash
(https://github.com/ruby/optparse/pull/42)

OptionParser#load learns .load(into: Hash)

https://github.com/ruby/optparse/commit/2ea626fcff

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-10-29 13:46:27 +00:00
Nobuyoshi Nakada 4021c6565f [ruby/irb] Do not make non-existent XDG directory on start
(https://github.com/ruby/irb/pull/357)


https://github.com/ruby/irb/commit/298b134792
2022-10-28 09:36:28 +00:00
Nobuyoshi Nakada 56c97a6621 [ruby/irb] Update regarding NO_COLOR value
https://no-color.org has been updated (jcs/no_color#83):

> Command-line software which adds ANSI color to its output by default
should check for a `NO_COLOR` environment variable that, when present
and **not an empty string** (regardless of its value), prevents the
addition of ANSI color.

https://github.com/ruby/irb/commit/46e0f7e370

Co-authored-by: Stan Lo <stan001212@gmail.com>
2022-10-28 09:30:24 +00:00
Shugo Maeda 5129ca3e05 [ruby/rdoc] Delay `require "readline"` in case the terminal is in raw mode 2022-10-27 08:16:06 +00:00
Takashi Kokubun d6d9b5130e [ruby/erb] Version 3.0.0 2022-10-25 23:14:09 +00:00
Takuya Noguchi ea989127eb Bundler: update docs for gemfile(5) manpage
- Add mswin/mswin64 to platforms
- Use TruffleRuby as example instead of Rubinius

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
Co-authored-by: André Arko <andre@arko.net>
2022-10-25 21:19:39 +00:00
Jean Boussier 217fdbf9aa [ruby/erb] url_encode: use CGI.escapeURIComponent
(https://github.com/ruby/erb/pull/23)

Ref: https://github.com/ruby/cgi/pull/26

This native implementation is much faster
and available in `cgi 0.3.3`.

https://github.com/ruby/erb/commit/2d90e9b010
2022-10-25 16:40:05 +00:00
Nobuyoshi Nakada 114e71d062 [ruby/tmpdir] Ignore empty environment variables
Fixes https://github.com/ruby/tmpdir/pull/17

https://github.com/ruby/tmpdir/commit/a79c727a5d
2022-10-25 07:54:40 +00:00
Nobuyoshi Nakada 883d9c305f [ruby/tmpdir] Found or raise 2022-10-25 07:16:36 +00:00
Nobuyoshi Nakada d55f72bcdb [ruby/tmpdir] Update supported and testing ruby versions 2022-10-25 06:59:30 +00:00
Peter Vandenberk 287c5da4aa [ruby/tmpdir] Make `Dir.tmpdir` more idiomatic and functional
Use `Enumerable#find` to iterate over the candidates, not `Enumerable.each`.

(this makes the code more functional, and - IMO - slightly more idiomatic,
as it avoids setting the "global" (by which I mean: non-local) `tmp`
variable from inside the block)

https://github.com/ruby/tmpdir/commit/d1f20ad694
2022-10-25 06:59:16 +00:00
Nobuyoshi Nakada cade3aba61 [ruby/tmpdir] Fix typo 2022-10-25 05:02:54 +00:00
Nobuyoshi Nakada 71a5b1d457
[ruby/tmpdir] [DOC] Improve documentation
https://github.com/ruby/tmpdir/commit/b9c880f2b6
2022-10-25 13:57:56 +09:00
st0012 b7622d792d [ruby/irb] Move require out of repeated execution path
SHOW_DOC_DIALOG will be called repeatedly whenever the corresponding key
is pressed, but we only need to require rdoc once. So ideally the
require can be put outside of the proc.

And because when rdoc is not available the entire proc will be
nonfunctional, we can stop registering the SHOW_DOC_DIALOG if we failed
to require rdoc.

https://github.com/ruby/irb/commit/b1278b7320
2022-10-24 13:36:57 +00:00
Nobuyoshi Nakada 6700fa7f62
Set timestamp path for the target path to TARGET_SO_DIR_TIMESTAMP 2022-10-24 17:48:00 +09:00
Hiroshi SHIBATA c5f5403f6e [ruby/net-http] Bump version to 0.3.0 2022-10-24 05:45:44 +00:00
Thomas E. Enebo 420bdba139 [rubygems/rubygems] Allow upcoming JRuby to pass keywords for Kernel#warn
jruby-head (which will be JRuby 9.4.0.0) can now properly process
the keywords to Kernel#warn.  I cannot think of any capability based
test for this so I constrained it using a version guard.  Only JRuby
will ever hit the version guard.

https://github.com/rubygems/rubygems/commit/cd468c7e0f
2022-10-22 08:01:24 +00:00
Hiroshi SHIBATA f88bff7705 [ruby/net-http] Revert "Replace Timeout.timeout in Net:HTTP#connect"
This reverts commit https://github.com/ruby/net-http/commit/753cae3bbccc.

https://github.com/ruby/net-http/commit/98caa38204
2022-10-21 12:39:52 +00:00
Takuya Noguchi 007946c27d [rubygems/rubygems] Bundler: github DSL has used https protocol over git
This behavior change was done in Bundler 2.2.0.

https://github.com/rubygems/bundler/pull/7142

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

https://github.com/rubygems/rubygems/commit/9510190be1
2022-10-18 07:54:32 +00:00
Hiroshi SHIBATA f5df47d1f3 Merge RubyGems/Bundler master
6214d00b23
2022-10-18 16:33:15 +09:00
David Rodríguez cb63a3f4c1 [rubygems/rubygems] Materialize platforms strictly on Windows too
https://github.com/rubygems/rubygems/commit/ab11545f80
2022-10-18 16:33:15 +09:00
David Rodríguez 4d3dbbe77e [rubygems/rubygems] Remove unnecessary receiver
https://github.com/rubygems/rubygems/commit/ba9d9b1890
2022-10-18 16:33:15 +09:00
David Rodríguez 74dbb0d09a [rubygems/rubygems] Remove unnecessary generic
I didn't realize how the `Bundler::GemHelpers.generic` method works when
I added this. It already matches this and other java platforms properly.

https://github.com/rubygems/rubygems/commit/5f0f0c678c
2022-10-18 16:33:15 +09:00
David Rodríguez 56ad79694b [rubygems/rubygems] Simplify fetching spec group dependencies
https://github.com/rubygems/rubygems/commit/62c2edd255
2022-10-18 16:33:15 +09:00
David Rodríguez 804ae4ea12 [rubygems/rubygems] Simplify SpecGroup creation
https://github.com/rubygems/rubygems/commit/788e46e152
2022-10-18 16:33:15 +09:00
David Rodríguez 67de00053a [rubygems/rubygems] Inline helper method
https://github.com/rubygems/rubygems/commit/e60459d6b6
2022-10-18 16:33:15 +09:00
David Rodríguez b99010f9f2 [rubygems/rubygems] Use `flat_map`
https://github.com/rubygems/rubygems/commit/b31308fb4c
2022-10-18 16:33:15 +09:00
David Rodríguez 71dede387e [rubygems/rubygems] Remove one more `expand_dependencies` call
https://github.com/rubygems/rubygems/commit/996fd81871
2022-10-18 16:33:15 +09:00
David Rodríguez cef7f6b224 [rubygems/rubygems] Remove now unnecessary parameter to `expand_dependencies`
We just call it once for resolution, so we can simplify things.

https://github.com/rubygems/rubygems/commit/99c144fbe3
2022-10-18 16:33:15 +09:00
David Rodríguez 8c4bd1e58d [rubygems/rubygems] Remove another `expand_dependencies` instance
https://github.com/rubygems/rubygems/commit/33769ddb07
2022-10-18 16:33:15 +09:00
David Rodríguez 60670b163f [rubygems/rubygems] Remove another unnecessary dependency expansion
https://github.com/rubygems/rubygems/commit/b4a0fcd2d2
2022-10-18 16:33:15 +09:00
David Rodríguez 0b6f2af3ba [rubygems/rubygems] Avoid unnecessary dependency expansion
https://github.com/rubygems/rubygems/commit/426748ed06
2022-10-18 16:33:15 +09:00
David Rodríguez da1981fca4 [rubygems/rubygems] Remove unused parameter to `SharedHelpers.pretty_dependency`
https://github.com/rubygems/rubygems/commit/665051d085
2022-10-18 16:33:15 +09:00
David Rodríguez 4205190cb2 [rubygems/rubygems] Remove dead code
https://github.com/rubygems/rubygems/commit/999b644708
2022-10-18 16:33:15 +09:00
Takashi Kokubun 931bcd1b63 [ruby/irb] Assert lvars_code doesn't include \n
Removing /\A.+\n/ could have an unexpected impact, depending on how
RubyLex.generate_local_variables_assign_code is implemented. It feels
like a too much assumption and the intention isn't immediately clear,
so I added these changes.

https://github.com/ruby/irb/commit/ccc07a35ce
2022-10-18 06:03:23 +00:00
tomoya ishida a09f764ce5 [ruby/irb] Always use local variables in current context to parse code (https://github.com/ruby/irb/pull/397)
* Use local_variables for colorize, code_block_open check, nesting_level and assignment_expression check

* Check if expression is an assignment BEFORE evaluating it. evaluate might define new localvars and change result of assignment_expression?

* Add local_variables dependent code test

* pend local variable dependent test on truffleruby

code_block_open is not working on truffleruby

* Always pass context to RubyLex#lex

* Rename local_variable_assign_code generator method name

* Add assignment expression truncate test

* Add Context#local_variables and make generate_local_variables_assign_code more simple

* Update lib/irb/input-method.rb

Co-authored-by: Stan Lo <stan001212@gmail.com>

* Add a comment why assignment expression check should be done before evaluate

https://github.com/ruby/irb/commit/c8b3877281

Co-authored-by: Stan Lo <stan001212@gmail.com>
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2022-10-18 05:44:07 +00:00
tomoya ishida 344e6c915f [ruby/irb] Fix code terminated check with heredoc and backtick (https://github.com/ruby/irb/pull/390)
* Fix backtick method def method call handled as backtick open

* Fix handling heredoc in check_string_literal

* Sort result of lexer.parse by pos in ruby<2.7. It's not sorted when the given code includes heredoc.

* Update lib/irb/ruby-lex.rb

Co-authored-by: Stan Lo <stan001212@gmail.com>

* Update lib/irb/ruby-lex.rb

Co-authored-by: Stan Lo <stan001212@gmail.com>

* Add check_string_literal test for heredoc code that does not end with newline

https://github.com/ruby/irb/commit/44bc712460

Co-authored-by: Stan Lo <stan001212@gmail.com>
2022-10-18 05:30:33 +00:00
Jonathan Hefner 6061003100 [ruby/delegate] Fix DelegateClass block "method redefined" warning
This commit prevents "method redefined" warnings when overriding methods
within a `DelegateClass` block, such as in the following example:

  ```ruby
  Base = Class.new do
    def foo
      "foo"
    end
  end

  Overridden = DelegateClass(Base) do
    def foo
      super + "!"
    end
  end
  ```

Fixes https://bugs.ruby-lang.org/issues/19047.

https://github.com/ruby/delegate/commit/214fae86de
2022-10-15 00:08:44 +09:00
manga_osyo 7b7e5153e8 [ruby/pp] [Feature #19045] Add support Data#pretty_print
https://github.com/ruby/pp/commit/343a20d721
2022-10-14 21:31:24 +09:00
Aaron Patterson e5058b58c2
Only expose Ruby Shape API if VM_CHECK_MODE is enabled 2022-10-13 13:11:01 -07:00
Nobuyoshi Nakada 4b1504ae0a [ruby/uri] Fix splitting relative URI
https://github.com/ruby/uri/commit/ffbab83de6
2022-10-13 16:24:53 +09:00
Hiroshi SHIBATA 1cda414622 Raise ArgumentError with empty host url again.
Fixup dd5118f852

Co-authored-by: Koichi Sasada <ko1@atdot.net>
2022-10-13 12:32:02 +09:00
NARUSE, Yui dd5118f852
URI.parse should set empty string in host instead of nil 2022-10-13 11:04:06 +09:00
Nobuyoshi Nakada 0360fca4ad
[DOC] Replace the external URIs to docs with rdoc-ref 2022-10-12 13:30:25 +09:00
Nobuyoshi Nakada 3539da64fc
[DOC] Replace the external URIs to docs with rdoc-ref 2022-10-12 12:27:40 +09:00
Kazuki Yamaguchi 4e29ca0c40
Add :ssl_min_version and :ssl_max_version options
Replace :ssl_version option with these two new options. These provide
access to OpenSSL::SSL::SSLContext#{min,max}_version=, which is the
recommended way to specify SSL/TLS protocol versions.
2022-10-12 10:36:51 +09:00
Jemma Issroff 913979bede
Make inline cache reads / writes atomic with object shapes
Prior to this commit, we were reading and writing ivar index and
shape ID in inline caches in two separate instructions when
getting and setting ivars. This meant there was a race condition
with ractors and these caches where one ractor could change
a value in the cache while another was still reading from it.

This commit instead reads and writes shape ID and ivar index to
inline caches atomically so there is no longer a race condition.

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-10-11 08:40:56 -07:00
Jemma Issroff ad63b668e2
Revert "Revert "This commit implements the Object Shapes technique in CRuby.""
This reverts commit 9a6803c90b.
2022-10-11 08:40:56 -07:00
Nobuyoshi Nakada 1dd774f53a [ruby/open-uri] Remove unused files from the packages
https://github.com/ruby/open-uri/commit/b2d9efbaf8
2022-10-11 10:44:42 +09:00
Maciek Rząsa 0f231f2bab [ruby/optparse] Don't treat empty string as an option description
https://github.com/ruby/optparse/commit/078638ee6d
2022-10-08 19:30:34 +09:00
st0012 5b3079a8a5 [ruby/irb] Sort constant completion's candidates
https://github.com/ruby/irb/commit/ee9b33c817
2022-10-08 03:17:42 +09:00
st0012 7cafe09aec [ruby/irb] Lazily evaluate candidates locals
https://github.com/ruby/irb/commit/19a2fcbd87
2022-10-08 03:17:42 +09:00
lijunwei 1e6cdc76e4 [ruby/logger] Fix the Logger::Formatter documentation
https://github.com/ruby/logger/commit/db554fbda7
2022-10-07 19:37:27 +09:00
Nobuyoshi Nakada 39909d8c18 [ruby/rdoc] Escape search results
https://hackerone.com/reports/1321358

https://github.com/ruby/rdoc/commit/2ebf8fd510
2022-10-07 12:12:09 +09:00
Nobuyoshi Nakada a3cb09c7d1 [ruby/rdoc] Escape file names
https://hackerone.com/reports/1321358

https://github.com/ruby/rdoc/commit/8c07cc4657
2022-10-07 12:12:08 +09:00
Nobuyoshi Nakada 8d0b2162a0 [ruby/rdoc] Escape main title
https://hackerone.com/reports/1187156

https://github.com/ruby/rdoc/commit/5dedb5741d
2022-10-07 12:09:23 +09:00
Nobuyoshi Nakada 586e18b946 [ruby/rdoc] Escape HYPERLINKs
https://github.com/ruby/rdoc/commit/ac35485be6
2022-10-07 12:09:22 +09:00
Nobuyoshi Nakada 9e3ab9da7f [ruby/rdoc] Escape RDOCLINKs
https://hackerone.com/reports/1187156

https://github.com/ruby/rdoc/commit/7cecf1efae
2022-10-07 12:09:21 +09:00
Nobuyoshi Nakada deaa656608 [ruby/rdoc] Escape TIDYLINKs
https://hackerone.com/reports/1187156

https://github.com/ruby/rdoc/commit/1ad2dd3ca2
2022-10-07 12:09:20 +09:00
Janko Marohnić fa2e1b67e5 [ruby/open-uri] Support 308 status redirect
https://github.com/ruby/open-uri/commit/d8899ae4ac
2022-10-07 06:58:37 +09:00
Takashi Kokubun 1f2c84de83
[ruby/rdoc] Remove trailing spaces to fix CI
https://github.com/ruby/ruby/actions/runs/3199301563/jobs/5224898228

369e4fa32d
2022-10-06 11:56:05 -07:00
Nobuyoshi Nakada cf3056be69 [ruby/rdoc] Add center align
https://github.com/ruby/rdoc/commit/512cc55a0e
2022-10-06 23:22:02 +09:00
Nobuyoshi Nakada 28e24ce355 [ruby/rdoc] Allow spaces around pipes
https://github.com/ruby/rdoc/commit/3b3a583580
2022-10-06 23:21:16 +09:00
Nobuyoshi Nakada 7c03c82444 [ruby/rdoc] Allow escaped pipes in cells
https://github.com/ruby/rdoc/commit/333952a62d
2022-10-06 23:17:49 +09:00
Nobuyoshi Nakada f6c916c7ef [ruby/rdoc] Allow leading pipes to be ommitted
https://github.com/ruby/rdoc/commit/d263a2c9c4
2022-10-06 23:16:54 +09:00
Nobuyoshi Nakada a19bf47d03 [ruby/rdoc] Allow trailing pipes to be ommitted
https://github.com/ruby/rdoc/commit/1318048877
2022-10-06 23:14:29 +09:00
Nobuyoshi Nakada 75a53f6be0 [ruby/rdoc] Allow RDoc markups in table cells
https://github.com/ruby/rdoc/commit/b16d3f1727
2022-10-06 18:24:44 +09:00
git 4e1086f903 * remove trailing spaces. [ci skip] 2022-10-06 18:01:08 +09:00
Nishant Patel cdbaac3f4b [ruby/open-uri] feat: allow option to pass version of SSL / TLS to use during communication. Allow versions are OpenSSL::SSL::SSLContext::METHODS
https://github.com/ruby/open-uri/commit/8729858517
2022-10-06 18:00:57 +09:00
Jean Boussier d15b38d944 [ruby/open-uri] Avoid busting the global constant cache
`Object#extend(mod)` bump the global constant cache if the module
has constants of its own.

So by moving these constants outside of `Meta` we avoid bumping
the cache.

https://github.com/ruby/open-uri/commit/363c399bac
2022-10-06 16:55:44 +09:00
Daniel Colson 3e84290213 [ruby/rdoc] Remove unused abbrev require
This library originally used `abbrev` to expand abbreviations into
fully-qualified classes, but that was replaced in
f9ffe6684e

`abbrev` is no longer used anywhere, so this commit removes the require.

https://github.com/ruby/rdoc/commit/b76775f27d
2022-10-06 10:04:41 +09:00
David Rodríguez 358fe26b31 [rubygems/rubygems] Fix little UI issue when bundler shows duplicated gems in a list
https://github.com/rubygems/rubygems/commit/3f71d882e9
2022-10-06 05:13:39 +09:00
Imir Kiyamov 83a6213f31 [ruby/irb] Fixed sort of variables in completion
https://github.com/ruby/irb/commit/5842888255
2022-10-05 19:22:13 +09:00
Kaíque Kandy Koga d880322243 [ruby/irb] Update remark of self.install_extend_commands.
Create line

https://github.com/ruby/irb/commit/64d6a461d5
2022-10-05 19:15:28 +09:00
Hiroshi SHIBATA 2f6a263787 [ruby/irb] Use USE_REIDLINE for backword compatibility
https://github.com/ruby/irb/commit/e58a3c1b39
2022-10-05 18:59:31 +09:00
Gannon McGibbon 19e4a4c624 [ruby/irb] Rename IDB::ReidlineInputMethod to IRB::RelineInputMethod
Deprecates IDB::ReidlineInputMethod and USE_REIDLINE in favor of
IRB::RelineInputMethod and USE_RELINE. The Input method uses Reline to
read input from the console, so it can be named directly after the
Reline library like other inputs methods are (Readline, Stdio, etc.).

https://github.com/ruby/irb/commit/5bcade7130
2022-10-05 17:14:19 +09:00
st0012 203b831065 [ruby/irb] Bump version to 1.4.2
https://github.com/ruby/irb/commit/f9960dbd37
2022-10-05 15:25:02 +09:00
Hiroshi SHIBATA f081bba875 [ruby/irb] Added aycabta to authors
https://github.com/ruby/irb/commit/a6bfa7b2e6
2022-10-05 15:15:33 +09:00
Victor Gama bc6c1e0e25 [rubygems/rubygems] Copy template contents instead of file and perms
This allows the file to be created without copying permissions
from Bundler's installation source. The previous behaviour was
noticed after installing Ruby through brew, and using bundle
init, which yielded a read-only Gemfile.

https://github.com/rubygems/rubygems/commit/839a06851d
2022-10-03 20:41:45 +09:00
st0012 10e830c25b [ruby/irb] Remove unused error
https://github.com/ruby/irb/commit/f09a1874b6
2022-10-03 07:00:54 +09:00
st0012 b97e909ef4 [ruby/irb] Remove unnecessary Thread presence check
They were introduced around 20 years ago, when Thread is not yet
stabilized. So we don't need them anymore.

https://github.com/ruby/irb/commit/4c75e03b2b
2022-10-03 07:00:53 +09:00
osyo-manga 7b88ffb34f [ruby/irb] Change to explicit method call in completion (https://github.com/ruby/irb/pull/369)
Ensure that methods are called even when local variables are defined.
see: https://github.com/ruby/irb/issues/368

https://github.com/ruby/irb/commit/c34d54b8bb
2022-10-03 06:55:53 +09:00
st0012 5cab9d0ee2 [ruby/irb] Remove patches for Ruby 2.4
They were added in b34f26a0dd

https://github.com/ruby/irb/commit/0e760d2674
2022-10-03 04:59:51 +09:00
st0012 42fcbcc215 [ruby/irb] Remove unnecessary condition
https://github.com/ruby/irb/commit/daffb8bfe5
2022-10-03 04:59:50 +09:00
st0012 55e2116f2c [ruby/irb] Refactor ripper_lex_without_warning
https://github.com/ruby/irb/commit/0db0a8ddc5
2022-10-03 04:59:49 +09:00
Nobuyoshi Nakada 7f1ca66642
Fallback PKG_CONFIG to the configured pkg-config always 2022-10-02 15:19:14 +09:00
Aaron Patterson 9a6803c90b
Revert "This commit implements the Object Shapes technique in CRuby."
This reverts commit 68bc9e2e97d12f80df0d113e284864e225f771c2.
2022-09-30 16:01:50 -07:00
David Rodríguez a44040c9e4 [rubygems/rubygems] Add notes to make sure we don't forget to backport changes to Bundler
https://github.com/rubygems/rubygems/commit/1ac5b14c78

Co-authored-by: André Arko <andre@arko.net>
2022-10-01 05:46:41 +09:00
David Rodríguez f04d249e83 [rubygems/rubygems] Fix matching of eabihf platforms
https://github.com/rubygems/rubygems/commit/a03d30cd58
2022-10-01 05:46:40 +09:00
David Rodríguez 8252ea2140 [rubygems/rubygems] Fix matching of linux platforms with eabi modifiers
https://github.com/rubygems/rubygems/commit/89362c18ef

Co-authored-by: Mike Dalessio <mike.dalessio@gmail.com>
2022-10-01 05:46:40 +09:00
David Rodríguez 4d58ee3de0 [rubygems/rubygems] Refactor platform matching on Linux
I think this highlights better how musl is special.

https://github.com/rubygems/rubygems/commit/4075771697
2022-10-01 05:46:39 +09:00
tompng 641310ce37 [ruby/irb] Fix ripper_lex_without_warning duplicated heredoc token
https://github.com/ruby/irb/commit/45b539af39
2022-10-01 04:17:15 +09:00
Jenny Shen 28840d74c2 [rubygems/rubygems] Refine error message to check the push URL instead of just the host
https://github.com/rubygems/rubygems/commit/46990f3292
2022-09-29 17:56:36 +09:00
Jenny Shen 17b783ad9e [rubygems/rubygems] Surface entire redirect uri in permanent redirections
https://github.com/rubygems/rubygems/commit/da7837630b
2022-09-29 17:56:35 +09:00
Jenny Shen 1cbf0fd863 [rubygems/rubygems] Add error message when api response is a permanent redirect
https://github.com/rubygems/rubygems/commit/ccca30c77a

Co-authored-by: Nick Schwaderer <nick.schwaderer@shopify.com>
2022-09-29 17:56:34 +09:00
Jemma Issroff d594a5a8bd
This commit implements the Object Shapes technique in CRuby.
Object Shapes is used for accessing instance variables and representing the
"frozenness" of objects.  Object instances have a "shape" and the shape
represents some attributes of the object (currently which instance variables are
set and the "frozenness").  Shapes form a tree data structure, and when a new
instance variable is set on an object, that object "transitions" to a new shape
in the shape tree.  Each shape has an ID that is used for caching. The shape
structure is independent of class, so objects of different types can have the
same shape.

For example:

```ruby
class Foo
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

class Bar
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

foo = Foo.new # `foo` has shape id 2
bar = Bar.new # `bar` has shape id 2
```

Both `foo` and `bar` instances have the same shape because they both set
instance variables of the same name in the same order.

This technique can help to improve inline cache hits as well as generate more
efficient machine code in JIT compilers.

This commit also adds some methods for debugging shapes on objects.  See
`RubyVM::Shape` for more details.

For more context on Object Shapes, see [Feature: #18776]

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-09-28 08:26:21 -07:00
Jeremy Evans cd77e71bba [ruby/net-http] Remove ENVIRONMENT_VARIABLE_IS_MULTIUSER_SAFE
This list is out of date.  At least OpenBSD since 2013 does not
allow one user to read the environment variables of a process
run by another user.

While we could try to keep the list updated, I think it's a bad
idea to not use the user/password from the environment, even if
another user on the system could read it.  If http_proxy exists
in the environment, and other users can read it, it doesn't
make it more secure for Ruby to ignore it.  You could argue that
it encourages poor security practices, but net/http should provide
mechanism, not policy.

Fixes [Bug #18908]

https://github.com/ruby/net-http/commit/1e4585153d
2022-09-28 17:26:03 +09:00
Mike Dalessio 8f7f12ad64 [rubygems/rubygems] fix: Gem::Platform.match handles String argument properly
Previously 9eead86 introduced non-commutativity of platforms, and
later commit 1b9f7f50 changed the behavior of `Gem::Platform.match` to
ensure the callee of `#=~` was the gem platform.

However, when the platform argument is a String, then the callee and
argument of `#=~` are flipped (see docs for `String#=~`), which works
against the fix from 1b9f7f50.

Closes #5938

https://github.com/rubygems/rubygems/commit/3b1fb562e8
2022-09-28 05:55:28 +09:00
Lars Kanis 9d56d9975d [ruby/timeout] Explicit add the timeout thread to default ThreadGroup
Otherwise the timeout thread would be added to the ThreadGroup of the thread that makes the first call to Timeout.timeout .

Fixes bug 19020: https://bugs.ruby-lang.org/issues/19020

Add a test case to make sure the common thread doesn't leak to another ThreadGroup

https://github.com/ruby/timeout/commit/c4f1385c9a
2022-09-28 01:59:35 +09:00
Hiroshi SHIBATA 95d5b33ea0
syntax_suggest moved under the ruby organization from zombocom 2022-09-27 12:44:30 +09:00
Aaron Patterson 06abfa5be6
Revert this until we can figure out WB issues or remove shapes from GC
Revert "* expand tabs. [ci skip]"

This reverts commit 830b5b5c35.

Revert "This commit implements the Object Shapes technique in CRuby."

This reverts commit 9ddfd2ca00.
2022-09-26 16:10:11 -07:00
Jemma Issroff 9ddfd2ca00 This commit implements the Object Shapes technique in CRuby.
Object Shapes is used for accessing instance variables and representing the
"frozenness" of objects.  Object instances have a "shape" and the shape
represents some attributes of the object (currently which instance variables are
set and the "frozenness").  Shapes form a tree data structure, and when a new
instance variable is set on an object, that object "transitions" to a new shape
in the shape tree.  Each shape has an ID that is used for caching. The shape
structure is independent of class, so objects of different types can have the
same shape.

For example:

```ruby
class Foo
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

class Bar
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

foo = Foo.new # `foo` has shape id 2
bar = Bar.new # `bar` has shape id 2
```

Both `foo` and `bar` instances have the same shape because they both set
instance variables of the same name in the same order.

This technique can help to improve inline cache hits as well as generate more
efficient machine code in JIT compilers.

This commit also adds some methods for debugging shapes on objects.  See
`RubyVM::Shape` for more details.

For more context on Object Shapes, see [Feature: #18776]

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-09-26 09:21:30 -07:00
Samuel Williams 22af2e9084 Rework vm_core to use `int first_lineno` struct member. 2022-09-26 00:41:16 +13:00
Takashi Kokubun 0c9dc01a2a Skip struct fields whose output differs
across different environments
2022-09-23 06:44:28 +09:00
Takashi Kokubun dfc311c0b3 Swap the positions of offsetof and type 2022-09-23 06:44:28 +09:00
Takashi Kokubun 4c6e1556b1 Bindgen immediate types with builtin 2022-09-23 06:44:28 +09:00
Takashi Kokubun 280ff1707e Drop c_64 and c_32 2022-09-23 06:44:28 +09:00
Takashi Kokubun 5cda5938f8 Bindgen enum with builtin 2022-09-23 06:44:28 +09:00
Takashi Kokubun 00c441ce7a Bindgen macro with builtin 2022-09-23 06:44:28 +09:00
Takashi Kokubun f2bea691cd Builtin RubyVM::MJIT::C 2022-09-23 06:44:28 +09:00
Otávio Schwanck dos Santos 696e8914b7 [ruby/reline] PR changes
https://github.com/ruby/reline/commit/e8e8d81f47
2022-09-22 22:28:38 +09:00
Otávio Schwanck dos Santos 9d19d910c0 [ruby/reline] Revert "update version"
This reverts commit https://github.com/ruby/reline/commit/ce1ac86179e6.

https://github.com/ruby/reline/commit/86602cd244
2022-09-22 22:28:37 +09:00
Otávio Schwanck dos Santos 224a3ea718 [ruby/reline] update version
https://github.com/ruby/reline/commit/ce1ac86179
2022-09-22 22:28:37 +09:00
Otávio Schwanck dos Santos 9fb18e6314 [ruby/reline] fix vi-operator-arg
https://github.com/ruby/reline/commit/d42cdb8f91
2022-09-22 22:28:36 +09:00
Hiroshi SHIBATA 928aeef330 [ruby/cgi] Bump up 0.3.3
https://github.com/ruby/cgi/commit/c1ffa3a428
2022-09-22 17:29:55 +09:00
Aaron Patterson ec93d09c94 add rb_execution_context 2022-09-21 22:20:35 -07:00
Aaron Patterson 083b4bb655 add rb_control_frame_t 2022-09-21 22:20:35 -07:00
Takuya Noguchi 830b2e217b [rubygems/rubygems] Update GitLab CI template with new one
GitLab CI now needs the default keyword on specification of image
and before_script.

https://docs.gitlab.com/ee/ci/yaml/#default

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

https://github.com/rubygems/rubygems/commit/b79e78e733
2022-09-22 11:42:57 +09:00
tompng 369f1668cd [ruby/irb] Rewrite on_scan proc to be more readable.
https://github.com/ruby/irb/commit/da54e7f081
2022-09-22 00:37:40 +09:00
tompng 9f68687879 [ruby/irb] Scan every single characters in IRB::Color.scan
https://github.com/ruby/irb/commit/d14e56a65d
2022-09-22 00:37:38 +09:00
st0012 6325fc8854 [ruby/irb] Handle non-String $LOAD_PATH values more carefully
In addition to String values, $LOAD_PATH can also take objects that
respond_to the `to_path` method, like Pathname objects. So `irb` should
be able to handle those objects too.

And if $LOAD_PATH contains objects that can't be converted into String,
`irb` should simply ignore it.

https://github.com/ruby/irb/commit/b2f562176b
2022-09-21 22:24:27 +09:00
Nobuyoshi Nakada 6898984f1c
[Bug #19005] dynamic_lookup linker option in external libraries
The warning against `-undefined dynamic_lookup` is just a warning yet,
and many gems seem to pay no attention to warnings.  Until it fails
actually, keep it as a migration path, except for standard extension
libraries and bundled extension gems.
2022-09-17 12:09:34 +09:00
Jeremy Evans b07db96744 [ruby/irb] Support --noscript option to not use first non-option argument as script
Also add --script option to turn the option back on.

Previously there wasn't a way to get an interactive IRB session
and access arguments provided on the command line.

Additionally, handle `-` as script as stdin. In Unix-like tools, `-`
means to take standard input instead of a file.  This doesn't
result in exactly the same output for:

```
echo 'p ARGV' > args.rb; irb args.rb a b c
```

and

```
echo 'p ARGV' | irb - a b c
```

Due to how irb handles whether stdin is a tty.

However, this change allows use of `-` as a argument, instead of
giving an unrecognized switch error. This required some small
changes to context.rb (to handle `-` as standard input) and
input-method.rb (to have FileInputMethod accept IO arguments in
addition to strings).

Implements [Feature #15371]

https://github.com/ruby/irb/commit/4192683ba2
2022-09-17 02:25:26 +09:00
Kevin Newton 68a5b0f086 [rubygems/rubygems] Mask the file mode when extracting files
When extracting files from the tarball, a mode is retrieved from
the header. Occasionally you'll encounter a gem that was packaged
on a system whose permission bits result in a value that is larger
than the value that File.chmod will allow (anything >= 2^16). In
that case the extraction fails with a RangeError, which is pretty
esoteric.

If you extract the tarball with the tar and gunzip utilities, the
file permissions end up being just the bottom 16 bits masked off
from the original value. I've mirrored that behavior here. Per the
tar spec:

> Modes which are not supported by the operating system restoring
> files from the archive will be ignored.

I think that basically means what I've done here.

---

This commit also changes the behavior very slightly with regard to
when the chmod is called. Previously it was called while the file
descriptor was still open, but after the write call.

When write flushes, the file permissions are changed to the mode
value from the File.open call, undoing the changes made by
FileUtils.chmod. CRuby appears to flush the buffer after the
chmod call, whereas TruffleRuby flushes before the chmod call.
So the file permissions can change depending on implementation.
Both implementations end up getting the correct file permissions
for the bottom 9 bits (user, group, world), but differ with
regard to the sticky bit in the next 3.

To get consistent behavior, this commit changes it to close the
file descriptor before attempting to chmod anything, which makes
it consistent because the write flushes in both cases.

https://github.com/rubygems/rubygems/commit/22ce076e99
2022-09-15 14:49:20 +09:00
Nobuyoshi Nakada bf72afa766
Remove warning for old TLS version connection
RubyGems.org already has refused connection requests using older than
TLS 1.2.
2022-09-15 14:48:47 +09:00
Nobuyoshi Nakada f863bc505c [ruby/irb] Fix the error when LC_MESSAGES config value is nil
https://github.com/ruby/irb/commit/6bbde84369
2022-09-14 11:14:08 +09:00
Jeremy Evans 9299db49f5 [ruby/irb] Fix history file saving with concurrent irb sessions when history file doesn't exist
If history file didn't exist when irb was started, @loaded_history_mtime
would be nil.  However, if the history file didn't exist before, but it
exists when saving history, that means the history file was modified,
and we should handle it the same way as we handle the other case where
the history file was modified.

Fixes #388

https://github.com/ruby/irb/commit/8d277aafcb
2022-09-14 10:15:45 +09:00
David Rodríguez 2aa8edaec7 [rubygems/rubygems] Deduplicate results just once
Instead of checking for uniqueness for every spec.

https://github.com/rubygems/rubygems/commit/97d28c9665
2022-09-12 22:13:32 +09:00
David Rodríguez 75d90cc8e5 [rubygems/rubygems] Use a single hash to keep track of prereleases
https://github.com/rubygems/rubygems/commit/9d7bd177b0
2022-09-12 22:13:31 +09:00
David Rodríguez 03d1962703 [rubygems/rubygems] Remove unnecessary sorting
Already done by the gem version promoter.

https://github.com/rubygems/rubygems/commit/aae2cc9fe0
2022-09-12 22:13:30 +09:00
David Rodríguez dce73c8616 [rubygems/rubygems] Simplify instantiating the gem version promoter
https://github.com/rubygems/rubygems/commit/c4e2737f2c
2022-09-12 22:13:30 +09:00
David Rodríguez 6a21d196ba [rubygems/rubygems] Let specs be sorted just once by the gem version promoter
https://github.com/rubygems/rubygems/commit/3cea25a39d
2022-09-12 22:13:29 +09:00
David Rodríguez 8d2bcc88ff [rubygems/rubygems] This sorting seems unnecessary too
https://github.com/rubygems/rubygems/commit/823cb1fef9
2022-09-12 22:13:29 +09:00
David Rodríguez a4860e043e [rubygems/rubygems] Remove unnecessary spec sorting
Specs in a SpecSet with the same name are only sorted by platform
priority when they are read. No need to sort everything eagerly.

https://github.com/rubygems/rubygems/commit/aeafff52df
2022-09-12 22:13:28 +09:00
Takashi Kokubun 472e7b8518
MJIT: Use the built-in PACK_MAP
106744107b made this possible.
2022-09-11 15:39:40 +09:00
David Rodríguez b350053ae4 [rubygems/rubygems] Fix resolution on non-musl platforms
Gems without specific platform were being preferred over matching
platform specific gems.

https://github.com/rubygems/rubygems/commit/37b95b9159
2022-09-09 19:38:52 +09:00
Aaron Patterson 56e5210cde
More robust macro parser (#6343)
I want to use more complicated macros with MJIT.  For example:

```
  # define SHAPE_MASK (((unsigned int)1 << SHAPE_BITS) - 1)
```

This commit adds a simple recursive descent parser that produces an AST
and a small visitor that converts the AST to Ruby.
2022-09-09 15:19:23 +09:00
rm155 78af05ba0f [ruby/forwardable] Freeze VERSION and FORWARDABLE_VERSION to improve Ractor-compliance
https://github.com/ruby/forwardable/commit/c91f41f4fa
2022-09-08 14:31:42 +09:00
rm155 70e6be2b05 [ruby/ipaddr] Improve Ractor-compliance
https://github.com/ruby/ipaddr/commit/73461724e5
2022-09-08 14:09:06 +09:00
David Rodríguez 24fd2f73d0 Resync Bundler & RubyGems 2022-09-08 11:25:03 +09:00
Antonio Paulino 4c1f6750f2 [rubygems/rubygems] Fix: Gem info bug with version flag
https://github.com/rubygems/rubygems/commit/e4cee1f975
2022-09-07 06:18:58 +09:00
Takashi Kokubun 03ae415d50
Fix typo 2022-09-06 16:22:43 +09:00
Takashi Kokubun 3f9125aaba
Update c_32.rb 2022-09-06 16:09:29 +09:00
Takashi Kokubun 4214023309
Run mjit-bindgen again
I'm thinking about Ruby builtin code instead of doing this.
It'll be hopefully more portable and easier because the same C code could
handle both 32bit and 64bit.
2022-09-06 15:59:08 +09:00
Hiroshi SHIBATA 2657d8efb9 [ruby/set] Bump version to 1.0.3
https://github.com/ruby/set/commit/e2419f2d30
2022-09-06 10:41:20 +09:00
Hiroshi SHIBATA 113581d288 [ruby/set] Set version to 1.0.3.dev for fixing rubygems/bundler tests
https://github.com/ruby/set/commit/40dda15d7f
2022-09-05 19:05:45 +09:00
Hiroshi SHIBATA 3eca1e438d Merge 16c3535413 2022-09-05 14:37:12 +09:00
Takashi Kokubun 3767c6a90d
Ruby MJIT (#6028) 2022-09-04 21:53:46 -07:00
Takashi Kokubun 277498e2a2
Attempt to fix test-bundler
f7cf641469 broke spec/bundler/install/gems/resolving_spec.rb:356.
This line seems to impact that test, so I slightly modified the
implementation for that spec's case.
2022-09-04 21:45:13 -07:00
Mike Dalessio 45fe7f7575
[rubygems/rubygems] Feature: `bundle add` supports `--path` option
https://github.com/rubygems/rubygems/commit/32bee01fbe
2022-09-05 11:43:14 +09:00
David Rodríguez f7cf641469
[rubygems/rubygems] Fix resolution hanging on musl platforms
After recent musl support was added, Bundler started hanging in musl
platforms. I identified the issue where valid candidates were being
filtered out because their platform was specified as a string, and thus
`Gem::Platform.match_spec?` which under the hood ends up calling
`Gem::Platform#===` would return `nil`, because it does not support
comparing platforms to strings.

In particular, `Bundler::EndpointSpecification`'s platform coming from
the API was not instantiated as a `Gem::Platform`, hence the issue.

Also, this spec surfaced another issue where a bug corrected in
`Gem::Platform#match_platforms` had not been yet backported to Bundler.
So this commit also backports that to get the spec green across RubyGems
versions.

Finally, the fix in `Bundler::EndpointSpecification` made a realworld
spec start failing. This spec was faking out `rails-4.2.7.1` requirement
on Bundler in the `Gemfile.lock` file to be `>= 1.17, < 3` when the real
requirement is `>= 1.17, < 2`. Due to the bug in
`Bundler::EndpointSpecification`, the real requirement provided by the
compact index API (recorded with VCR) was being ignored, and the
`Gemfile.lock` fake requirement was being used, which made the spec
pass. This is all expected, and to fix the issue I changed the spec to
be really realworld and don't fake any Bundler requirements.

https://github.com/rubygems/rubygems/commit/faf4ef46bc
2022-09-05 11:43:14 +09:00
Nobuyoshi Nakada 1b8a644b44 [ruby/reline] Fix a typo [ci skip]
https://github.com/ruby/reline/commit/33bf80e757
2022-09-03 03:27:58 +09:00
Hiroshi SHIBATA 0d2422cf63 [ruby/reline] Workaround for padding width with Aracritty on macOS
https://github.com/ruby/reline/commit/fb4136c8a7
2022-09-02 16:09:51 +09:00
Hiroshi SHIBATA 7ff50ee35c [ruby/reline] Added some of abstruct methods for cursor
https://github.com/ruby/reline/commit/f5fa30d595
2022-09-02 16:09:50 +09:00
Imir Kiyamov f67ab7f30c [ruby/did_you_mean] Fixed correction duplicates in VariableNameChecker
https://github.com/ruby/did_you_mean/commit/c3fc412f6f
2022-09-01 19:47:39 +09:00
Nobuyoshi Nakada 59e8569cf9 [ruby/reline] Support dumb terminal
The "dumb" terminal is considered only on MSys tty now.  However, the
`TERM` feature has been used on many Unix-like systems for decades,
not MSys specific.

https://github.com/ruby/reline/commit/53fd51ab62
2022-09-01 16:36:16 +09:00
なつき aa5c1a0483 [rubygems/rubygems] Support non gnu libc arm-linux-eabi platforms
https://github.com/rubygems/rubygems/commit/fcf62799f2
2022-09-01 15:01:40 +09:00
なつき aded6971ad [rubygems/rubygems] Support non gnu libc arm-linux-eabi platforms
https://github.com/rubygems/rubygems/commit/394d7a6fc9
2022-09-01 15:01:40 +09:00
Mau Magnaguagno 941e9be0d9 [ruby/reline] Remove loose operation in Dialog#render_each_dialog
https://github.com/ruby/reline/commit/a6d1c917ce
2022-09-01 14:01:37 +09:00
Jean Boussier 739380c97d [ruby/net-protocol] Improve BufferedIO performance
`BufferedIO` is a bit inefficient for reading large responses because
it use the classic `buffer.slice!` technique which cause a lot of
unnecessary string copying.

This is particularly visible on line based protocol when reading
line by line.

Instead of repeatedly shifting the string, we can keep track of
which offset we're at, to know how many bytes are left in the buffer.

This change also open the door to further optimization by increasing
the buffer size, as previously `slice!` would get slower the larger
the buffer is.

Benchmark results:

```
=== 1k ===
Warming up --------------------------------------
                  1k     1.234k i/100ms
              1k opt     1.283k i/100ms
Calculating -------------------------------------
                  1k     12.615k (± 0.9%) i/s -     64.168k in   5.086995s
              1k opt     12.856k (± 0.9%) i/s -     65.433k in   5.090051s

Comparison:
                  1k:    12615.2 i/s
              1k opt:    12856.0 i/s - 1.02x  (± 0.00) faster

=== 10k ===
Warming up --------------------------------------
                 10k     1.165k i/100ms
             10k opt     1.269k i/100ms
Calculating -------------------------------------
                 10k     11.550k (± 2.4%) i/s -     58.250k in   5.046378s
             10k opt     12.736k (± 1.0%) i/s -     64.719k in   5.081969s

Comparison:
                 10k:    11550.3 i/s
             10k opt:    12736.3 i/s - 1.10x  (± 0.00) faster

=== 100k ===
Warming up --------------------------------------
                100k   809.000  i/100ms
            100k opt   926.000  i/100ms
Calculating -------------------------------------
                100k      8.054k (± 3.0%) i/s -     40.450k in   5.028299s
            100k opt      9.286k (± 2.2%) i/s -     47.226k in   5.088841s

Comparison:
                100k:     8053.6 i/s
            100k opt:     9285.5 i/s - 1.15x  (± 0.00) faster

=== 1M ===
Warming up --------------------------------------
                  1M   249.000  i/100ms
              1M opt   315.000  i/100ms
Calculating -------------------------------------
                  1M      2.448k (± 2.5%) i/s -     12.450k in   5.089744s
              1M opt      3.119k (± 2.6%) i/s -     15.750k in   5.053772s

Comparison:
                  1M:     2447.8 i/s
              1M opt:     3118.8 i/s - 1.27x  (± 0.00) faster
```

Profiling before (1MB responses):

```
==================================
  Mode: wall(1000)
  Samples: 5276 (0.00% miss rate)
  GC: 394 (7.47%)
==================================
     TOTAL    (pct)     SAMPLES    (pct)     FRAME
      1622  (30.7%)        1622  (30.7%)     IO#wait_readable
       777  (14.7%)         777  (14.7%)     IO#read_nonblock
       365   (6.9%)         365   (6.9%)     (sweeping)
      2705  (51.3%)         364   (6.9%)     Net::BufferedIO#rbuf_fill
       264   (5.0%)         264   (5.0%)     String#index
       223   (4.2%)         223   (4.2%)     String#sub
       221   (4.2%)         221   (4.2%)     String#slice!
       185   (3.5%)         185   (3.5%)     String#split
       108   (2.0%)         108   (2.0%)     IO#write_nonblock
       101   (1.9%)         101   (1.9%)     String#downcase
        66   (1.3%)          66   (1.3%)     Net::BufferedIO#LOG
        57   (1.1%)          57   (1.1%)     String#count
        51   (1.0%)          51   (1.0%)     String#to_s
       391   (7.4%)          50   (0.9%)     Net::HTTPGenericRequest#write_header
        50   (0.9%)          50   (0.9%)     String#capitalize
        49   (0.9%)          49   (0.9%)     Array#join
        47   (0.9%)          47   (0.9%)     String#b
       106   (2.0%)          36   (0.7%)     Net::HTTPHeader#set_field
        34   (0.6%)          34   (0.6%)     Module#===
        33   (0.6%)          33   (0.6%)     String#[]
       140   (2.7%)          29   (0.5%)     Net::BufferedIO#write0
        29   (0.5%)          29   (0.5%)     (marking)
       281   (5.3%)          27   (0.5%)     Net::BufferedIO#rbuf_consume
      1195  (22.6%)          25   (0.5%)     Net::HTTPResponse#read_body
      1024  (19.4%)          25   (0.5%)     Net::HTTPResponse.each_response_header
        86   (1.6%)          24   (0.5%)     Net::HTTPHeader#set_field
        23   (0.4%)          23   (0.4%)     Net::HTTP#proxy_uri
        51   (1.0%)          23   (0.4%)     Net::HTTPHeader#initialize_http_header
      2225  (42.2%)          22   (0.4%)     Net::BufferedIO#readuntil
        20   (0.4%)          20   (0.4%)     Regexp#===
```

Profiling after (1MB responses):

```
==================================
  Mode: wall(1000)
  Samples: 15180 (0.00% miss rate)
  GC: 1688 (11.12%)
==================================
     TOTAL    (pct)     SAMPLES    (pct)     FRAME
      4534  (29.9%)        4534  (29.9%)     IO#read_nonblock
     10650  (70.2%)        3944  (26.0%)     Net::HTTPOpt::BufferedIOOpt#rbuf_fill
      2101  (13.8%)        2101  (13.8%)     IO#wait_readable
      1442   (9.5%)        1442   (9.5%)     (sweeping)
       360   (2.4%)         360   (2.4%)     String#sub
       312   (2.1%)         312   (2.1%)     String#split
       265   (1.7%)         265   (1.7%)     String#bytesize
       246   (1.6%)         246   (1.6%)     (marking)
       151   (1.0%)         151   (1.0%)     IO#write_nonblock
       125   (0.8%)         125   (0.8%)     String#downcase
       116   (0.8%)         116   (0.8%)     String#index
       113   (0.7%)         113   (0.7%)     Module#===
       162   (1.1%)          89   (0.6%)     Net::HTTPOpt::BufferedIOOpt#rbuf_consume_all_shareable!
       158   (1.0%)          65   (0.4%)     Net::HTTPHeader#set_field
        63   (0.4%)          63   (0.4%)     String#capitalize
        63   (0.4%)          63   (0.4%)     BasicObject#equal?
        58   (0.4%)          58   (0.4%)     Regexp#match
        58   (0.4%)          58   (0.4%)     String#[]
       449   (3.0%)          56   (0.4%)     Net::HTTPGenericRequest#write_header
        53   (0.3%)          53   (0.3%)     String#to_s
        52   (0.3%)          52   (0.3%)     Net::HTTPOpt::BufferedIOOpt#LOG
        52   (0.3%)          52   (0.3%)     String#count
        44   (0.3%)          44   (0.3%)     String#byteslice
        44   (0.3%)          44   (0.3%)     Array#join
      1096   (7.2%)          42   (0.3%)     Net::HTTPResponse.each_response_header
      2617  (17.2%)          40   (0.3%)     Net::HTTPOpt::BufferedIOOpt#readuntil
       132   (0.9%)          30   (0.2%)     Net::HTTPOpt::BufferedIOOpt#rbuf_consume
        28   (0.2%)          28   (0.2%)     Regexp#===
        27   (0.2%)          27   (0.2%)     Net::HTTP#proxy_uri
      8862  (58.4%)          27   (0.2%)     Net::HTTPResponse#read_body
````

Benchmark code:

```ruby

require "fileutils"
DIR = "/tmp/www"
FileUtils.mkdir_p(DIR)
HOST = "127.0.0.1"
PORT = 8080
CONF = <<~EOS
daemon            off;
worker_processes  2;

events {
    worker_connections  128;
}

http {
    server_tokens off;
    charset       utf-8;

    server {
        server_name   localhost;
        listen        #{HOST}:#{PORT};

        keepalive_requests 10000000;
        keepalive_timeout 3600s;

        error_page    500 502 503 504  /50x.html;

        location      / {
            root      #{DIR};
        }

    }

}
EOS

File.write(File.join(DIR, "1k.txt"), 'a' * 1024)
File.write(File.join(DIR, "10k.txt"), 'a' * 1024 * 10)
File.write(File.join(DIR, "100k.txt"), 'a' * 1024 * 100)
File.write(File.join(DIR, "1M.txt"), 'a' * 1024 * 1024)

File.write(File.join(DIR, "nginx.conf"), CONF)

require "benchmark/ips"
require "net/http"

nginx_pid = Process.spawn('nginx', '-c', File.join(DIR, "nginx.conf"))

module Net
  class HTTPOpt < HTTP

    class BufferedIOOpt < ::Net::BufferedIO  #:nodoc: internal use only
      def initialize(io, read_timeout: 60, write_timeout: 60, continue_timeout: nil, debug_output: nil)
        @io = io
        @read_timeout = read_timeout
        @write_timeout = write_timeout
        @continue_timeout = continue_timeout
        @debug_output = debug_output
        @rbuf = ''.b
        @rbuf_offset = 0
      end

      attr_reader :io
      attr_accessor :read_timeout
      attr_accessor :write_timeout
      attr_accessor :continue_timeout
      attr_accessor :debug_output

      def inspect
        "#<#{self.class} io=#{@io}>"
      end

      def eof?
        @io.eof?
      end

      def closed?
        @io.closed?
      end

      def close
        @io.close
      end

      #
      # Read
      #

      public

      def read(len, dest = ''.b, ignore_eof = false)
        LOG "reading #{len} bytes..."
        read_bytes = 0
        begin
          while read_bytes + rbuf_size < len
            if s = rbuf_consume_all_shareable!
              read_bytes += s.bytesize
              dest << s
            end
            rbuf_fill
          end
          s = rbuf_consume(len - read_bytes)
          read_bytes += s.bytesize
          dest << s
        rescue EOFError
          raise unless ignore_eof
        end
        LOG "read #{read_bytes} bytes"
        dest
      end

      def read_all(dest = ''.b)
        LOG 'reading all...'
        read_bytes = 0
        begin
          while true
            if s = rbuf_consume_all_shareable!
              read_bytes += s.bytesize
              dest << s
            end
            rbuf_fill
          end
        rescue EOFError
          ;
        end
        LOG "read #{read_bytes} bytes"
        dest
      end

      def readuntil(terminator, ignore_eof = false)
        offset = @rbuf_offset
        begin
          until idx = @rbuf.index(terminator, offset)
            offset = @rbuf.bytesize
            rbuf_fill
          end
          return rbuf_consume(idx + terminator.bytesize - @rbuf_offset)
        rescue EOFError
          raise unless ignore_eof
          return rbuf_consume
        end
      end

      def readline
        readuntil("\n").chop
      end

      private

      BUFSIZE = 1024 * 16

      def rbuf_fill
        tmp = @rbuf_empty ? @rbuf : nil
        case rv = @io.read_nonblock(BUFSIZE, tmp, exception: false)
        when String
          @rbuf_empty = false
          if rv.equal?(tmp)
            @rbuf_offset = 0
          else
            @rbuf << rv
            rv.clear
          end
          return
        when :wait_readable
          (io = @io.to_io).wait_readable(@read_timeout) or raise Net::ReadTimeout.new(io)
          # continue looping
        when :wait_writable
          # OpenSSL::Buffering#read_nonblock may fail with IO::WaitWritable.
          # http://www.openssl.org/support/faq.html#PROG10
          (io = @io.to_io).wait_writable(@read_timeout) or raise Net::ReadTimeout.new(io)
          # continue looping
        when nil
          raise EOFError, 'end of file reached'
        end while true
      end

      def rbuf_flush
        if @rbuf_empty
          @rbuf.clear
          @rbuf_offset = 0
        end
        nil
      end

      def rbuf_size
        @rbuf.bytesize - @rbuf_offset
      end

      # Warning: this method may share the buffer to avoid
      # copying. The caller must no longer use the returned
      # string once rbuf_fill has been called again
      def rbuf_consume_all_shareable!
        @rbuf_empty = true
        buf = if @rbuf_offset == 0
          @rbuf
        else
          @rbuf.byteslice(@rbuf_offset..-1)
        end
        @rbuf_offset = @rbuf.bytesize
        buf
      end

      def rbuf_consume(len = nil)
        if @rbuf_offset == 0 && (len.nil? || len == @rbuf.bytesize)
          s = @rbuf
          @rbuf = ''.b
          @rbuf_offset = 0
          @rbuf_empty = true
        elsif len.nil?
          s = @rbuf.byteslice(@rbuf_offset..-1)
          @rbuf = ''.b
          @rbuf_offset = 0
          @rbuf_empty = true
        else
          s = @rbuf.byteslice(@rbuf_offset, len)
          @rbuf_offset += len
          @rbuf_empty = @rbuf_offset == @rbuf.bytesize
          rbuf_flush
        end

        @debug_output << %Q[-> #{s.dump}\n] if @debug_output
        s
      end

      #
      # Write
      #

      public

      def write(*strs)
        writing {
          write0(*strs)
        }
      end

      alias << write

      def writeline(str)
        writing {
          write0 str + "\r\n"
        }
      end

      private

      def writing
        @written_bytes = 0
        @debug_output << '<- ' if @debug_output
        yield
        @debug_output << "\n" if @debug_output
        bytes = @written_bytes
        @written_bytes = nil
        bytes
      end

      def write0(*strs)
        @debug_output << strs.map(&:dump).join if @debug_output
        orig_written_bytes = @written_bytes
        strs.each_with_index do |str, i|
          need_retry = true
          case len = @io.write_nonblock(str, exception: false)
          when Integer
            @written_bytes += len
            len -= str.bytesize
            if len == 0
              if strs.size == i+1
                return @written_bytes - orig_written_bytes
              else
                need_retry = false
                # next string
              end
            elsif len < 0
              str = str.byteslice(len, -len)
            else # len > 0
              need_retry = false
              # next string
            end
            # continue looping
          when :wait_writable
            (io = @io.to_io).wait_writable(@write_timeout) or raise Net::WriteTimeout.new(io)
            # continue looping
          end while need_retry
        end
      end

      #
      # Logging
      #

      private

      def LOG_off
        @save_debug_out = @debug_output
        @debug_output = nil
      end

      def LOG_on
        @debug_output = @save_debug_out
      end

      def LOG(msg)
        return unless @debug_output
        @debug_output << msg + "\n"
      end
    end
    BufferedIO = BufferedIOOpt

    # Unchanged from ruby 3.1.1, only allow to lookup the mofidied BufferedIO
    def connect
      if use_ssl?
        # reference early to load OpenSSL before connecting,
        # as OpenSSL may take time to load.
        @ssl_context = OpenSSL::SSL::SSLContext.new
      end

      if proxy? then
        conn_addr = proxy_address
        conn_port = proxy_port
      else
        conn_addr = conn_address
        conn_port = port
      end

      D "opening connection to #{conn_addr}:#{conn_port}..."
      begin
        s = Socket.tcp conn_addr, conn_port, @local_host, @local_port, connect_timeout: @open_timeout
      rescue => e
        e = Net::OpenTimeout.new(e) if e.is_a?(Errno::ETIMEDOUT) #for compatibility with previous versions
        raise e, "Failed to open TCP connection to " +
          "#{conn_addr}:#{conn_port} (#{e.message})"
      end
      s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
      D "opened"
      if use_ssl?
        if proxy?
          plain_sock = BufferedIO.new(s, read_timeout: @read_timeout,
                                      write_timeout: @write_timeout,
                                      continue_timeout: @continue_timeout,
                                      debug_output: @debug_output)
          buf = "CONNECT #{conn_address}:#{@port} HTTP/#{HTTPVersion}\r\n"
          buf << "Host: #{@address}:#{@port}\r\n"
          if proxy_user
            credential = ["#{proxy_user}:#{proxy_pass}"].pack('m0')
            buf << "Proxy-Authorization: Basic #{credential}\r\n"
          end
          buf << "\r\n"
          plain_sock.write(buf)
          HTTPResponse.read_new(plain_sock).value
          # assuming nothing left in buffers after successful CONNECT response
        end

        ssl_parameters = Hash.new
        iv_list = instance_variables
        SSL_IVNAMES.each_with_index do |ivname, i|
          if iv_list.include?(ivname)
            value = instance_variable_get(ivname)
            unless value.nil?
              ssl_parameters[SSL_ATTRIBUTES[i]] = value
            end
          end
        end
        @ssl_context.set_params(ssl_parameters)
        @ssl_context.session_cache_mode =
          OpenSSL::SSL::SSLContext::SESSION_CACHE_CLIENT |
          OpenSSL::SSL::SSLContext::SESSION_CACHE_NO_INTERNAL_STORE
        @ssl_context.session_new_cb = proc {|sock, sess| @ssl_session = sess }
        D "starting SSL for #{conn_addr}:#{conn_port}..."
        s = OpenSSL::SSL::SSLSocket.new(s, @ssl_context)
        s.sync_close = true
        # Server Name Indication (SNI) RFC 3546
        s.hostname = @address if s.respond_to? :hostname=
        if @ssl_session and
           Process.clock_gettime(Process::CLOCK_REALTIME) < @ssl_session.time.to_f + @ssl_session.timeout
          s.session = @ssl_session
        end
        ssl_socket_connect(s, @open_timeout)
        if (@ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE) && @ssl_context.verify_hostname
          s.post_connection_check(@address)
        end
        D "SSL established, protocol: #{s.ssl_version}, cipher: #{s.cipher[0]}"
      end
      @socket = BufferedIO.new(s, read_timeout: @read_timeout,
                               write_timeout: @write_timeout,
                               continue_timeout: @continue_timeout,
                               debug_output: @debug_output)
      @last_communicated = nil
      on_connect
    rescue => exception
      if s
        D "Conn close because of connect error #{exception}"
        s.close
      end
      raise
    end
    private :connect
  end
end

begin
  sleep 0.2

  connection = Net::HTTP.start(HOST, PORT)
  connection.keep_alive_timeout = 3600
  connection_opt = Net::HTTPOpt.start(HOST, PORT)
  connection_opt.keep_alive_timeout = 3600

  unless connection.request_get("/100k.txt").body == connection_opt.request_get("/100k.txt").body
    abort("bug?")
  end

  if ARGV.first == "profile"
    require 'stackprof'
    require 'json'

    StackProf.run(mode: :wall, out: "/tmp/stackprof-net-http.dump", raw: true) do
      40_000.times do
        connection.request_get("/1M.txt").body
      end
    end
    File.write("/tmp/stackprof-net-http.json", JSON.dump(Marshal.load(File.binread("/tmp/stackprof-net-http.dump"))))
    system("stackprof", "/tmp/stackprof-net-http.rb")

    StackProf.run(mode: :wall, out: "/tmp/stackprof-net-http-opt.dump", raw: true) do
      40_000.times do
        connection_opt.request_get("/1M.txt").body
      end
    end
    File.write("/tmp/stackprof-net-http-opt.json", JSON.dump(Marshal.load(File.binread("/tmp/stackprof-net-http-opt.dump"))))
    system("stackprof", "/tmp/stackprof-net-http-opt.dump")

  else
    %w(1k 10k 100k 1M).each do |size|
      puts "=== #{size} ==="
      Benchmark.ips do |x|
        path = "/#{size}.txt"
        x.report("#{size}") { connection.request_get(path).body }
        x.report("#{size} opt") { connection_opt.request_get(path).body }
        x.compare!(order: :baseline)
      end
      puts
    end
  end
ensure
  Process.kill('TERM', nginx_pid)
  Process.wait(nginx_pid)
end

```

https://github.com/ruby/net-protocol/commit/781e400389
2022-08-31 12:37:49 +09:00
shields 8799c91205 [rubygems/rubygems] Add platform :windows as a shortcut for all Windows platforms
https://github.com/rubygems/rubygems/commit/f3c49ad3f7
2022-08-29 00:33:15 +09:00
Aleksandr Varnin 381d8e43ce [rubygems/rubygems] Bundler: make to_lock consistent between Gem::Dependency and Bundler::Dependency
https://github.com/rubygems/rubygems/commit/971d57cf5a
2022-08-28 02:04:14 +09:00
Jun Aruga 3504be1bc1 [ruby/irb] Require RDoc in `input-method.rb` again in a limited scope.
RDoc is implemented as soft dependency in IRB. See how the rdoc is required in
the files. I reverted the commit below.

```
$ grep -ril rdoc lib/
lib/irb/cmd/help.rb
lib/irb/completion.rb
lib/irb/easter-egg.rb
lib/irb/input-method.rb
```

---

Revert "Remove `require` in signal handler to avoid ThreadError"

This reverts commit https://github.com/ruby/irb/commit/5f749c613c89.

https://github.com/ruby/irb/commit/b24852058f
2022-08-26 09:57:02 +09:00
David Rodríguez ad8774f8e5 [rubygems/rubygems] Fix another regression for sorbet
Recently a changed was introduced to update the resolver platforms after
it has been created, in order to remove the "ruby" platform from it if
it's to be removed from the lockfile. However, it did not update the
`@resolving_only_for_ruby` instance variable in that case, so the
resolver was not properly doing the right thing anymore.

To fix this, I tweaked the code to restore not changing resolver
platforms after the resolver has been instantiated.

https://github.com/rubygems/rubygems/commit/8fbc30a1d0
2022-08-25 23:39:02 +09:00
David Rodríguez 0ad9cc1696 [rubygems/rubygems] Backport non-gnu libc on linux platform matching to Bundler
https://github.com/rubygems/rubygems/commit/703373b41f

Co-authored-by: Loic Nageleisen <loic.nageleisen@gmail.com>
2022-08-24 17:59:15 +09:00
Vít Ondruch 46c3a93982 [ruby/irb] Drop hard dependency on RDoc.
This has been introduced in https://github.com/ruby/irb/commit/026700499dfd,
but it seems that this is just be mistake, otherwise the later handling
of `LoadError` would not be needed.

https://github.com/ruby/irb/commit/54c8df06ff
2022-08-23 18:01:35 +09:00
Yusuke Endoh 983115cf3c [ruby/fileutils] FileUtils.rm* methods swallows only Errno::ENOENT when force is true
... instead of any StandardError.

To behave like the standard `rm` command, it should only ignore
exceptions about not existing files, not every exception. This should
make debugging some errors easier, because the expectation is that `rm
-rf` will succeed if and only if, all given files (previously existent
or not) are removed. However, due to this exception swallowing, this is
not always the case.

From the `rm` man page

> COMPATIBILITY
>
> The rm utility differs from historical implementations in that the -f
> option only masks attempts to remove non-existent files instead of
> masking a large variety of errors.

https://github.com/ruby/fileutils/commit/fa65d676ec

Co-Authored-By: David Rodríguez <deivid.rodriguez@riseup.net>
2022-08-23 16:52:41 +09:00
Yusuke Endoh 96562a517d [ruby/fileutils] Narrow the scope of ensure
The ensure in postorder_traverse was added for [Bug #6756].
The intention was to try to delete the parent directory if it failed to
get the children. (It may be possible to delete the directory if it is
empty.)

However, the ensure region rescue'ed not only "failure to get children"
but also "failure to delete each child". Thus, the following raised
Errno::ENOTEMPTY, but we expect it to raise Errno::EACCES.

```
$ mkdir foo
$ touch foo/bar
$ chmod 555 foo
$ ruby -rfileutils -e 'FileUtils.rm_rf("foo")'
```

This changeset narrows the ensure region so that it rescues only
"failure to get children".

https://github.com/ruby/fileutils/commit/ec5d3b84ea
2022-08-23 16:52:40 +09:00
Takuya Noguchi 22a416a3bb [rubygems/rubygems] Bundler: update the link suggested on error with the new one
Also typo is fixed.

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

https://github.com/rubygems/rubygems/commit/9c1ea52ddf
2022-08-23 14:28:47 +09:00
Hiroshi SHIBATA f69244cee8 Merge rubygems/bundler HEAD
Pick from 6b3a5a9ab0
2022-08-23 10:45:57 +09:00
David Rodríguez 4790d0accd [rubygems/rubygems] Fix conservative update downgrading top level gems
When `--conservative` is passed, explicit unlocks are set for top level
gems via `@unlock[:gems]`, so that only those particular gems are
allowed to be updated.

When we compute the "base resolve" from the lockfile (the set of gems
whose versions should be kept pinned by the resolver), we always exclude
gems explicitly unlocked through `@unlock[:gems]` from it. This is done
by the `converge_specs` method.

However, the `converge_specs` method is also used for figuring out
additional lower bound requirements from the lockfile. But in this case,
even if gems are explicitly unlock in `@unlock[:gems]`, we still want to
add the additional requirement, so that gems are not downgraded by the
resolver.

So the solution is to move the line filtering out gems in
`@unlock[:gems]` from the `converged_specs` method out of that method,
so that it only applies for computing the "base resolve", but not the
addtional lower bound requirements.

https://github.com/rubygems/rubygems/commit/405119bd7b
2022-08-23 10:45:57 +09:00
David Rodríguez c21c9a29ee [rubygems/rubygems] Refactor building metadata dependencies
https://github.com/rubygems/rubygems/commit/fa60f1fe43
2022-08-23 10:45:57 +09:00
David Rodríguez 29c443fedc [rubygems/rubygems] Remove unnecessary mixin inclusion
It's already included by the parent.

https://github.com/rubygems/rubygems/commit/3ffe389c44
2022-08-23 10:45:57 +09:00
David Rodríguez b30fc03e92 [rubygems/rubygems] Centralize loading `Bundler::MatchPlatform` mixin
It's explicitly loaded when monkeypatching RubyGems, which we do very
early. So neither autoloading it, nor explicitly loading it anywhere
else is necessary.

https://github.com/rubygems/rubygems/commit/fbc7a57161
2022-08-23 10:45:57 +09:00
David Rodríguez 59f27445ea [rubygems/rubygems] Implement extra rules for libc versioning
https://github.com/rubygems/rubygems/commit/7e976d790a
2022-08-23 05:50:23 +09:00
David Rodríguez 492e70c7b4 [rubygems/rubygems] Fix `gem install` still choosing musl incorrectly
https://github.com/rubygems/rubygems/commit/1b9f7f50a5
2022-08-23 05:50:22 +09:00
David Rodríguez 9819283044 [rubygems/rubygems] Handle non-gnu libc on linux platforms in RubyGems
Attempting to install a gem published as both *-linux and *-linux-musl
results in the incorrect gem being picked up, causing build failures due
to binary incompatibility. This is caused by the `nil` wildcard
swallowing the libc information upon version comparison.

Handle the linux case by performing only non-wildcard equality on the
version and asserting 'gnu' and nil equivalence, while preserving the
current behaviour for other OSes.

https://github.com/rubygems/rubygems/commit/9eead86abc

Co-authored-by: Loic Nageleisen <loic.nageleisen@gmail.com>
2022-08-23 05:50:21 +09:00
Loic Nageleisen 615f79be3c [rubygems/rubygems] Test platform's version-ness consistently
The symmetry with the "for command line" case is made more apparent.

https://github.com/rubygems/rubygems/commit/ab85d3558f
2022-08-23 05:50:20 +09:00
David Rodríguez 70f69f8539 [ruby/fileutils] Fix mkdir_p hanging on Windows when trying to create a file on a offline drive
https://github.com/ruby/fileutils/commit/9cc6a082d7
2022-08-22 10:12:25 +09:00
David Rodríguez 560941e711 [rubygems/rubygems] Fix edge case where `bundler/inline` unintentionally skips install
If the application has the `no_install` setting set for `bundle
package`, then `bundler/inline` would silently skip installing any gems.

https://github.com/rubygems/rubygems/commit/7864f49b27
2022-08-21 17:54:11 +09:00
David Rodríguez b87ddd7538 [rubygems/rubygems] Fix `bundle platform` crash when there's a lockfile with no Ruby locked
https://github.com/rubygems/rubygems/commit/49fc54e87d
2022-08-21 17:53:40 +09:00
Yusuke Endoh 6bcb473d9c [ruby/error_highlight] Apply ErrorHighlight::CoreExt to TypeError and ArgumentError
https://github.com/ruby/error_highlight/commit/defcaf1beb
2022-08-19 18:34:15 +09:00
schneems 490af8dbdb Sync SyntaxSuggest
```
$ tool/sync_default_gems.rb syntax_suggest
```
2022-08-19 10:02:24 +09:00
Jean Boussier 3850113e20 [ruby/cgi] Implement `CGI.url_encode` and `CGI.url_decode`
[Feature #18822]

Ruby is somewhat missing an RFC 3986 compliant escape method.

https://github.com/ruby/cgi/commit/c2729c7f33
2022-08-16 19:12:03 +09:00
David Rodríguez e77c8397c2 [rubygems/rubygems] Fix Ruby platform incorrectly removed on `bundle update`
https://github.com/rubygems/rubygems/commit/0d321c9e3a
2022-08-15 17:42:16 +09:00
Yusuke Endoh d9f1b8baa3 [ruby/error_highlight] Add a note about the current limitation of ErrorHighlight.spot
https://github.com/ruby/error_highlight/commit/489ce80a62
2022-08-12 14:04:41 +09:00
Yusuke Endoh 1b32a4c7bb [ruby/error_highlight] Bump version
https://github.com/ruby/error_highlight/commit/6edf0a0a5d
2022-08-10 21:51:51 +09:00
Yusuke Endoh 3a58009066 [ruby/error_highlight] Make backtrace_location keyword work
We had to keep backtrace_location before opts is overwritten.

https://github.com/ruby/error_highlight/commit/2735e4681a
2022-08-10 21:19:10 +09:00
Yusuke Endoh 99e7fa5b37 [ruby/error_highlight] Make ErrorHighlight.spot accept Exception (https://github.com/ruby/error_highlight/pull/25)
... and move things from core_ext.rb to base.rb.
This will confine CRuby-dependent things to ErrorHighlight.spot.

https://github.com/ruby/error_highlight/commit/22d1dd7824
2022-08-10 18:37:13 +09:00
Hiroshi SHIBATA 44264b4fee Merge rubygems/bundler HEAD.
Pick from dfbb5a3811
2022-08-09 12:05:19 +09:00
Nobuyoshi Nakada 5beb75ce8d
[ruby/rdoc] Allow multiple footnotes without in-between blank lines
https://github.com/ruby/ruby/commit/e4e054e3ce40 used four footnotes
without blank lines.  And the ChangeLog generated from that commit
resulted in ``undefined method `parts' for nil`` error.

For now, let a footnote terminated by the next footnote mark.

Also refined the error message when undefined footnote is used.

https://github.com/ruby/rdoc/commit/a7f290130b
2022-08-08 01:12:49 +09:00
Burdette Lamar 23a84d53c6 [ruby/rdoc] [DOC] Removes remaining old Markup Reference (https://github.com/ruby/rdoc/pull/910)
https://github.com/ruby/rdoc/commit/4e44c9c6cf
2022-08-07 21:07:23 +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
David Rodríguez 8dd63b89d9 [rubygems/rubygems] Move comment where the actual replacement happens
https://github.com/rubygems/rubygems/commit/d60acdf80d
2022-08-06 15:41:46 +09:00
David Rodríguez 4ea521f6c7 [rubygems/rubygems] Remove unclear comment
https://github.com/rubygems/rubygems/commit/3a843c1ac7
2022-08-06 15:41:45 +09:00
David Rodríguez af40af45b2 [rubygems/rubygems] Extract `SourceList#get_with_fallback`
https://github.com/rubygems/rubygems/commit/9dbc4757a8
2022-08-06 15:41:45 +09:00
David Rodríguez f310ac1cb2 [rubygems/rubygems] Include backtrace with crashes by default
https://github.com/rubygems/rubygems/commit/3cc3bfd371
2022-08-05 16:37:03 +09: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
Alan Wu e5a3f23256 Use $(bindir) for path to executable in mkmf
For the macOS -bundle_loader linker option, we need a path to the
Ruby exectuable. $(RUBY) is not necessarily a path since it could
be a command line invocation. That happens during build with
runruby.rb and can happen post installation if the user passes
the --ruby option to a extconf.rb. Use $(bindir) to locate
the executable instead.

Before installation, $(bindir) doesn't exist, so we need to be
able to override $(BUILTRUBY) in such situations so test-spec
and bundled extensions could build. Use a new mkmf global,
$builtruby, to do this; set it in fake.rb and in extmk.rb.

Our build system is quite complex...
2022-08-04 16:29:22 +09:00
Yuta Saito 50d81bfbc1 Link ext bundles with bundle loader option for newer ld64
ld64 shipped with Xcode 14 emits a warning when using `-undefined
dynamic_lookup`.

```
ld: warning: -undefined dynamic_lookup may not work with chained fixups
```

Actually, `-undefined dynamic_lookup` doesn't work when:

1. Link a *shared library* with the option
2. Link it with a program that uses the chained-fixup introduced from
   macOS 12 and iOS 15
because `-undefined dynamic_lookup` uses lazy-bindings and they won't be
bound while dyld fixes-up by traversing chained-fixup info.

However, we build exts as *bundles* and they are loaded only through
`dlopen`, so it's safe to use `-undefined dynamic_lookup` in theory.
So the warning produced by ld64 is false-positive, and it results
failure of option checking in configuration. Therefore, it would be an
option to ignore the warning during our configuration.

On the other hand, `-undefined dynamic_lookup` is already deprecated on
all darwin platforms except for macOS, so it's good time to get rid of
the option. ld64 also provides `-bundle_loader <executable>` option,
which allows to resolve symbols defined in the executable symtab while
linking. It behaves almost the same with `-undefined dynamic_lookup`,
but it makes the following changes:

1. Require that unresolved symbols among input objects must be defined
   in the executable.
2. Lazy symbol binding will lookup only the symtab of the bundle loader
   executable. (`-undefined dynamic_lookup` lookups all symtab as flat
   namespace)

This patch adds `-bundle_loader $(RUBY)` when non-EXTSTATIC
configuration by assuming ruby executable can be linked before building
exts.

See "New Features" subsection under "Linking" section for chained fixup
https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes
2022-08-04 16:29:22 +09:00
David Rodríguez 542040fb83 [rubygems/rubygems] Warn dangling symlinks
https://github.com/rubygems/rubygems/commit/425b78637f
2022-08-04 13:36:45 +09:00
David Rodríguez 0591780a74 [rubygems/rubygems] Extract entry.full_name to a variable
https://github.com/rubygems/rubygems/commit/3973773005
2022-08-04 13:36:44 +09:00
tompng b54f26b704 [ruby/irb] shortcut colorize_code to speedup pretty_print
https://github.com/ruby/irb/commit/8a074a6904
2022-08-04 08:37:03 +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
Ilya Dyakonov 4f00ee8d47 [rubygems/rubygems] fix platform matching for index specs
https://github.com/rubygems/rubygems/commit/f087f1b590
2022-08-03 06:56:36 +09:00
David Rodríguez 20936eb3a9 [rubygems/rubygems] Warn (rather than crash) when setting `nil` specification versions
https://github.com/rubygems/rubygems/commit/a4ba1a4d97
2022-08-03 06:56:18 +09:00
David Rodríguez f70b26af47 [rubygems/rubygems] Array is already uniq, no need to deduplicate it
https://github.com/rubygems/rubygems/commit/3212ae14b7
2022-08-02 21:57:52 +09:00
Takuya Noguchi b81858cf6f [rubygems/rubygems] Fix arguments for bundle-config(1) docs
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

https://github.com/rubygems/rubygems/commit/3e62ca776d
2022-08-02 18:35:38 +09: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 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 9189c2d5ef [rubygems/rubygems] Materializing for resolution already filters platforms
https://github.com/rubygems/rubygems/commit/9f4ba9ebb0
2022-08-02 16:10:17 +09:00
David Rodríguez 8c98f7be57 [rubygems/rubygems] Remove unnecessary local variable
https://github.com/rubygems/rubygems/commit/a997210473
2022-08-02 16:10:17 +09:00
David Rodríguez 5487e76374 [rubygems/rubygems] Prefer reverse+find to select+last
https://github.com/rubygems/rubygems/commit/ffb161bb69
2022-08-02 16:10:16 +09:00
David Rodríguez bc0de1e162 [rubygems/rubygems] Only need to filter platforms when materialization is not strict
https://github.com/rubygems/rubygems/commit/9d878cbda0
2022-08-02 16:10:16 +09:00
David Rodríguez 91b9bd6234 [rubygems/rubygems] This should go through the standard source search logic
https://github.com/rubygems/rubygems/commit/087e3e4e3b
2022-08-02 16:10:15 +09:00
David Rodríguez 35e508d13e [rubygems/rubygems] Refactor materialization conditions
https://github.com/rubygems/rubygems/commit/08e1554fb6
2022-08-02 16:10:14 +09:00
David Rodríguez ed9bbfd759 [rubygems/rubygems] Fix incorrect force_ruby_platform propagation
It was just working by chance.

(cherry picked from commit https://github.com/rubygems/rubygems/commit/16b2d6bfe893)

https://github.com/rubygems/rubygems/commit/8f922d980f
2022-08-02 16:10:14 +09:00
David Rodríguez 7cc5a657ee [rubygems/rubygems] Remove unnecessary special case for Bundler
https://github.com/rubygems/rubygems/commit/2777e79b8e
2022-08-02 16:10:13 +09:00
David Rodríguez 6ec8f684aa [rubygems/rubygems] Move some logic to `LazySpecification#__materialize__`
https://github.com/rubygems/rubygems/commit/5e100df7c9
2022-08-02 16:10:13 +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
Takuya Noguchi b0e6d07ce4 [rubygems/rubygems] Update bundle-platform(1) man
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

https://github.com/rubygems/rubygems/commit/1c3736f5af
2022-08-01 01:31:24 +09:00
Nobuyoshi Nakada af265d73fb [ruby/rdoc] Fix blockquote with word in verbatim
https://github.com/ruby/rdoc/commit/75eee668a5
2022-07-30 11:04:11 +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
David Rodríguez b515fdcc32 [rubygems/rubygems] No need to set anything at all unless standalone is given
https://github.com/rubygems/rubygems/commit/d695c8da3e
2022-07-30 04:24:24 +09:00
Hiroshi SHIBATA 4e886d2ade Update parser-text.rb with 4ecc13c9cb 2022-07-29 19:10:10 +09:00
Luka Dornhecker 4bf97a8ec4 fix typo in Time#xmlschema documentation 2022-07-29 19:10:10 +09:00
konsolebox 419ad1e13e [ruby/optparse] Also accept '-' as an optional argument (https://github.com/ruby/optparse/pull/35)
https://github.com/ruby/optparse/commit/f2b8318631
2022-07-29 19:10:10 +09:00
Hiroshi SHIBATA 3725454161 Merge ruby/fileutils from 332025bc02 2022-07-29 19:10:10 +09:00
Takuya Noguchi d1e726cce7 [rubygems/rubygems] Fix dead links to deprecated bundle-package(1) with bundler-cache(1)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

https://github.com/rubygems/rubygems/commit/9c2e80a10f
2022-07-29 19:06:49 +09:00
Takuya Noguchi def1d44aa1 [rubygems/rubygems] Add package/pack aliases to man pages for cache
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

https://github.com/rubygems/rubygems/commit/1685e3a9dc
2022-07-29 16:31:06 +09:00
Hiroshi SHIBATA bfd09b1116 Merge rubygems master from 446cc57a7c 2022-07-29 15:46:15 +09:00
Nobuyoshi Nakada f29f1d22c3 [ruby/rdoc] Fix formatting blockquote in verbatim
Reported at https://github.com/ruby/rdoc/pull/907#discussion_r932505816

https://github.com/ruby/rdoc/commit/86384ac7f9
2022-07-29 09:21:33 +09:00
Burdette Lamar c56e957dec [ruby/rdoc] Link from RDoc::Markup to RDoc::MarkupReference (https://github.com/ruby/rdoc/pull/906)
Recently new RDoc::MarkupReference replaces Markup Reference in RDoc::Markup (which was always the goal).

https://github.com/ruby/rdoc/commit/825be7eaf4
2022-07-29 01:06:34 +09: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 b4ae144e19 [rubygems/rubygems] Don't use Pathname for creating extension dir
Not sure why, but I run into the following flaky test failure

````
(...)

Invoking `/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/4/gems/system/bin/bundle install` failed with output:
----------------------------------------------------------------------
--- ERROR REPORT TEMPLATE -------------------------------------------------------

```
NameError: constant Pathname::FileUtils not defined

    FileUtils.mkpath(@path, mode: mode)
    ^^^^^^^^^
  /Users/deivid/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/pathname.rb:585:in `mkpath'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/4/gems/system/gems/bundler-2.4.0.dev/lib/bundler/shared_helpers.rb:103:in `filesystem_access'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/4/gems/system/gems/bundler-2.4.0.dev/lib/bundler/rubygems_gem_installer.rb:78:in `build_extensions'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/4/gems/system/gems/bundler-2.4.0.dev/lib/bundler/rubygems_gem_installer.rb:28:in `install'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/4/gems/system/gems/bundler-2.4.0.dev/lib/bundler/source/rubygems.rb:207:in `install'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/4/gems/system/gems/bundler-2.4.0.dev/lib/bundler/installer/gem_installer.rb:54:in `install'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/4/gems/system/gems/bundler-2.4.0.dev/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/4/gems/system/gems/bundler-2.4.0.dev/lib/bundler/installer/parallel_installer.rb:186:in `do_install'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/4/gems/system/gems/bundler-2.4.0.dev/lib/bundler/installer/parallel_installer.rb:177:in `block in worker_pool'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/4/gems/system/gems/bundler-2.4.0.dev/lib/bundler/worker.rb:62:in `apply_func'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/4/gems/system/gems/bundler-2.4.0.dev/lib/bundler/worker.rb:57:in `block in process_queue'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/4/gems/system/gems/bundler-2.4.0.dev/lib/bundler/worker.rb:54:in `loop'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/4/gems/system/gems/bundler-2.4.0.dev/lib/bundler/worker.rb:54:in `process_queue'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/4/gems/system/gems/bundler-2.4.0.dev/lib/bundler/worker.rb:91:in `block (2 levels) in create_threads'

(...)
```

Whatever it was, this small change should fix it.

https://github.com/rubygems/rubygems/commit/71d7503ce4
2022-07-27 04:56:34 +09:00