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

87219 Коммитов

Автор SHA1 Сообщение Дата
Peter Zhu b66d6e48c8 Switch sorted list of pages in the GC to a darray 2024-09-09 10:15:21 -04:00
Jean Boussier 16f241f0aa Implement String#append_as_bytes(String | Integer, ...)
[Feature #20594]

A handy method to construct a string out of multiple chunks.

Contrary to `String#concat`, it doesn't do any encoding negociation,
and simply append the content as bytes regardless of whether this
result in a broken string or not.

It's the caller responsibility to check for `String#valid_encoding?`
in cases where it's needed.

When passed integers, only the lower byte is considered, like in
`String#setbyte`.
2024-09-09 15:04:51 +02:00
Daniel Colson 966901b39d [rubygems/rubygems] Don't include hook templates in cached git source
With a default git setup, each cloned repo in the cache will end up with
~60K of sample git hooks. These files all end in `.sample`, and they are
disabled by default. Deleting them should be a no-op, and makes the
cache a bit smaller.

https://github.com/rubygems/rubygems/commit/d2149999cd
2024-09-09 11:59:52 +00:00
Nobuyoshi Nakada 3aae0873f7
Update clang for LTO 2024-09-09 19:22:45 +09:00
Nobuyoshi Nakada 391bb55a8e Run just bignum related tests when gmp enabled 2024-09-09 19:12:41 +09:00
zverok d7b0f26963 Return back legacy Range#step behavior for symbol ranges 2024-09-09 17:46:13 +09:00
David Rodríguez 155989415b [rubygems/rubygems] Avoid now unnecessary reset
https://github.com/rubygems/rubygems/commit/511c7b211b
2024-09-09 08:46:02 +00:00
David Rodríguez 72e80c8f29 [rubygems/rubygems] Make `gem exec` use the standard GEM_HOME
https://github.com/rubygems/rubygems/commit/032b3c518a
2024-09-09 08:46:01 +00:00
David Rodríguez a304fe00f3 [rubygems/rubygems] Fix `gem fetch` always exiting with zero status code
https://github.com/rubygems/rubygems/commit/5887e6dfa1
2024-09-09 08:44:27 +00:00
Nobuyoshi Nakada a2ae7450d7
Suppress discards qualifiers warning with ASN 2024-09-09 16:25:43 +09:00
git 330b2ffb51 Update default gems list at 2d4fdafa64 [ci skip] 2024-09-09 06:47:55 +00:00
Hiroshi SHIBATA 2d4fdafa64 [ruby/psych] Bump up 5.2.0.beta1
https://github.com/ruby/psych/commit/a8b73bb80e
2024-09-09 06:46:51 +00:00
Juanjo Bazán 74872109be [ruby/psych] Unlimited line_width with -1
https://github.com/ruby/psych/commit/3b63a93dfc
2024-09-09 06:44:40 +00:00
Hiroshi SHIBATA dbfabafe96 [ruby/psych] Make to load stringio lazily
https://github.com/ruby/psych/commit/9f5392d180
2024-09-09 06:43:35 +00:00
Gareth Jones aed8e46118 [ruby/psych] docs: specify correct default `fallback` value
https://github.com/ruby/psych/commit/ce7946981d
2024-09-09 06:40:59 +00:00
ydah d52e599538 Implement WHEN NODE locations 2024-09-09 10:34:02 +09:00
JP Camara b5f1291015 The Timeout::Error example no longer works consistently
* This PR from the timeout gem (https://github.com/ruby/timeout/pull/30) made it so you have to handle_interrupt on Timeout::ExitException instead of Timeout::Error

* Efficiency changes to the gem (one shared thread) mean you can't consistently handle timeout errors using handle_timeout: https://github.com/ruby/timeout/issues/41
2024-09-09 09:10:06 +09:00
Earlopain 19c1f0233e [ruby/benchmark] Set required_ruby_version = ">= 2.1.0"
`Process.clock_gettime` only works since 2.1

https://github.com/ruby/benchmark/commit/94cfe56291
2024-09-08 16:43:50 +00:00
Nobuyoshi Nakada ac960b08ee
Clean up dummped IBF files 2024-09-09 00:51:41 +09:00
Nobuyoshi Nakada 6e544f2fed
Initialize goruby only when executing 2024-09-08 23:40:18 +09:00
Nobuyoshi Nakada ecb58a8d08
Fix prelude to use IBF
Since universal-parser and prism support, prelude code used functions
inaccessible from outside libruby shared library.

```
linking goruby
/usr/bin/ld: goruby.o: in function `prelude_eval':
/home/runner/work/ruby/ruby/build/golf_prelude.c:221: undefined reference to `rb_ruby_prism_ptr'
/usr/bin/ld: goruby.o: in function `pm_prelude_load':
/home/runner/work/ruby/ruby/build/golf_prelude.c:192: undefined reference to `pm_options_line_set'
/usr/bin/ld: /home/runner/work/ruby/ruby/build/golf_prelude.c:193: undefined reference to `pm_parse_string'
/usr/bin/ld: goruby.o: in function `prelude_eval':
/home/runner/work/ruby/ruby/build/golf_prelude.c:224: undefined reference to `pm_iseq_new_with_opt'
/usr/bin/ld: /home/runner/work/ruby/ruby/build/golf_prelude.c:226: undefined reference to `pm_parse_result_free'
/usr/bin/ld: goruby.o: in function `prelude_ast_value':
/home/runner/work/ruby/ruby/build/golf_prelude.c:181: undefined reference to `rb_ruby_ast_data_get'
/usr/bin/ld: goruby.o: in function `prelude_eval':
/home/runner/work/ruby/ruby/build/golf_prelude.c:231: undefined reference to `rb_ruby_ast_data_get'
/usr/bin/ld: goruby.o: in function `pm_prelude_load':
/home/runner/work/ruby/ruby/build/golf_prelude.c:196: undefined reference to `pm_parse_result_free'
collect2: error: ld returned 1 exit status
```
2024-09-08 23:40:17 +09:00
Nobuyoshi Nakada 70871fa6e3
Extract `rb_builtin_find`
Refactor out the same code from `rb_builtin_ast_value` and
`pm_builtin_ast_value.
2024-09-08 23:16:46 +09:00
Nobuyoshi Nakada be84abffba
Gather code for builtin loading to miniinit.c 2024-09-08 23:16:46 +09:00
Nobuyoshi Nakada d2179eeaac
Try to run goruby 2024-09-08 23:16:46 +09:00
otegami 903f3790ad [ruby/open-uri] Update error message for `request_specific_fields` option validation
Added `inspect` to the `request_specific_fields` value to provide
better visibility for users in the exception message.

https://github.com/ruby/open-uri/commit/f89ce5112d
2024-09-08 14:13:00 +00:00
otegami 76475bf5c0 [ruby/open-uri] Add documentation for `request_specific_fields` option
https://github.com/ruby/open-uri/commit/2e7734c061
2024-09-08 14:13:00 +00:00
otegami 0ac16215da [ruby/open-uri] Add test about `request_specific_fields` option
https://github.com/ruby/open-uri/commit/060886f312
2024-09-08 14:12:59 +00:00
otegami 6ea2b6f65f [ruby/open-uri] Add `request_specific_fields` option for customizing headers
This commit introduces the `request_specific_fields` option in OpenURI.
It provides two methods for customizing headers as follows.

1. Specify headers only for the initial request

Use a Hash to apply headers only to the first request.
These headers are automatically removed during redirects.

2. Specify headers dynamically for each request

Use a Proc to dynamically generate headers for each request,
including during redirects, based on the request URL.

This feature allows users to control headers flexibly,
ensuring that sensitive headers like "Authorization" are not unintentionally
transferred during redirects unless explicitly specified.

https://github.com/ruby/open-uri/commit/460f858e3c
2024-09-08 14:12:59 +00:00
Mads Ohm Larsen ec5d5422ca [ruby/rdoc] Use pointer cursor for navigation toggle
(https://github.com/ruby/rdoc/pull/1175)

https://github.com/ruby/rdoc/commit/964a1982c8
2024-09-08 12:17:36 +00:00
Koichi ITO 4774284124 [ruby/prism] Fix a token incompatibility for `Prism::Translation::Parser::Lexer`
This PR fixes a token incompatibility between Parser gem and `Prism::Translation::Parser` for left parenthesis.

## Parser gem (Expected)

Returns `tLPAREN2` token:

```console
$ bundle exec ruby -Ilib -rparser/ruby33 \
-ve 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Parser::Ruby33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 0...3>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 3...4>]],
[:tSYMBOL, ["bar", #<Parser::Source::Range example.rb 4...8>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 8...9>]]]
```

## `Prism::Translation::Parser` (Actual)

Previously, the parser returned `tLPAREN` token when parsing the following:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 0...3>]], [:tLPAREN, ["(", #<Parser::Source::Range example.rb 3...4>]],
[:tSYMBOL, ["bar", #<Parser::Source::Range example.rb 4...8>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 8...9>]]]
```

After the update, the parser now returns `tLPAREN2` token for the same input:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 0...3>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 3...4>]],
[:tSYMBOL, ["bar", #<Parser::Source::Range example.rb 4...8>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 8...9>]]]
```

The `PARENTHESIS_LEFT` token in Prism is classified as either `tLPAREN` or `tLPAREN2` in the Parser gem.
The tokens that were previously all classified as `tLPAREN` are now also classified to `tLPAREN2`.

With this change, the following code could be removed from `test/prism/ruby/parser_test.rb`:

```diff
-          when :tLPAREN
-            actual_token[0] = expected_token[0] if expected_token[0] == :tLPAREN2
```

https://github.com/ruby/prism/commit/04d6f3478d
2024-09-07 22:36:38 +00:00
Nobuyoshi Nakada f97332a3a3
Preserve encoding in exception message of `Float` 2024-09-07 16:34:28 +09:00
Nobuyoshi Nakada c1862cbb89
[Bug #20719] `Float` argument must be ASCII compatible 2024-09-07 16:06:14 +09:00
Jonathan Calvert c1a510a8df
[Bug #20718] Free non-`RTypedData` objects
Allow objects that are not of type `RTypedData` to use the default
free function, as `RTYPEDDATA_EMBEDDED_P` can return a false positive
when casting non-`RTypedData` objects.
2024-09-07 12:19:47 +09:00
Mads Ohm Larsen 6dc9384694 [ruby/rdoc] Add more space after magnifying glass
(https://github.com/ruby/rdoc/pull/1173)

https://github.com/ruby/rdoc/commit/6a9cad4c54
2024-09-06 21:26:17 +00:00
KJ Tsanaktsidis 731805ddde Add an explicit check for broken libunwind builds
Libunwind as packaged in MacOS cannot actually unwind code which has
pointer authentication on, because _LIBUNWIND_IS_NATIVE_ONLY is not
defined. Add a check for this, and prefer building with working
unwinding over pointer authentication if we must make a choice.
2024-09-06 16:51:19 -04:00
Peter Zhu 2865148a5a Revert "Check for both aarch64 and arm64 arch's for pac-ret"
This reverts commit 6a746e1bc9.

This patch breaks the C level backtrace on macOS ARM machines.
2024-09-06 16:51:19 -04:00
David Rodríguez b0adae7fb2 [rubygems/rubygems] Remove unnecessary "./" when appending string to uri
https://github.com/rubygems/rubygems/commit/732679306d
2024-09-06 18:44:38 +00:00
David Rodríguez fe1bace43c [rubygems/rubygems] Fix `gem install does-not-exist` being super slow
Every time a gem is not found in the Compact Index API, RubyGems will
fallback to the full index, which is very slow. This is unnecessary
because both indexes should be providing the same gems, so if a gem
can't be found in the Compact Index API, it won't be found in the full
index.

We _do_ want a fallback to the full index, whenever the Compact Index
API is not implemented. To detect that, we check that the API responds
to the "/versions" endpoint, just like Bundler does.

Before:

```
$ time gem install fooasdsfafs
ERROR:  Could not find a valid gem 'fooasdsfafs' (>= 0) in any repository
gem  20,77s user 0,59s system 96% cpu 22,017 total
```

After:

```
$ time gem install fooasdsfafs
ERROR:  Could not find a valid gem 'fooasdsfafs' (>= 0) in any repository
gem  5,02s user 0,09s system 91% cpu 5,568 total
```

https://github.com/rubygems/rubygems/commit/c0d6b9eea7
2024-09-06 18:44:37 +00:00
David Rodríguez 2a17b4f022 [rubygems/rubygems] Deprecate constant that has been unused for a long time
https://github.com/rubygems/rubygems/commit/282dbb3d62
2024-09-06 18:44:37 +00:00
David Rodríguez 4478ca3113 [rubygems/rubygems] Remove incorrect documentation
This exception has not been raised for a long time.

https://github.com/rubygems/rubygems/commit/a6271a0b21
2024-09-06 18:44:36 +00:00
David Rodríguez 53f784178a [rubygems/rubygems] Remove unreachable code
Nothing is actually raising this at the moment.

https://github.com/rubygems/rubygems/commit/3b824ca7a6
2024-09-06 18:44:36 +00:00
Jun Aruga ad742de79b [ruby/openssl] Fix test_provider.rb in FIPS.
https://github.com/ruby/openssl/commit/7bdbc52100
2024-09-06 16:58:18 +00:00
Nobuyoshi Nakada 30176e3f23 [rubygems/rubygems] Ensure that the lock file will be removed
https://github.com/rubygems/rubygems/commit/2706acb271
2024-09-06 14:46:43 +00:00
Nobuyoshi Nakada 6dd917bd01 [rubygems/rubygems] Workaround for TruffleRuby
https://github.com/rubygems/rubygems/commit/b82e43fd54
2024-09-06 14:46:42 +00:00
Nobuyoshi Nakada 5afee4d795 [rubygems/rubygems] Remove the lock file for binstubs
https://github.com/rubygems/rubygems/pull/7806#issuecomment-2241662488

https://github.com/rubygems/rubygems/commit/4f06ee234a
2024-09-06 14:46:42 +00:00
Peter Zhu 6bf519ba81 Remove unneeded rb_darray_append_impl 2024-09-06 09:56:59 -04:00
Nobuyoshi Nakada 37712c1ed6
Prefer constants for `shutdown` over magic numbers 2024-09-06 21:58:01 +09:00
Jean Boussier bc85c8d852 Implement Array#fetch_values
[Feature #20702]

Works the same way than `Hash#fetch_values` for for array.
2024-09-06 12:40:32 +02:00
Nobuyoshi Nakada 214668fccb
[Feature #20707] Fix negative UTC offset conversion
In short, get rid of division and modulo of negative integers.
2024-09-06 15:53:46 +09:00
Nobuyoshi Nakada 7387a09791 [ruby/digest] Suppress md5 deprecation warnings by gcc as well as clang
https://github.com/ruby/digest/commit/76878e3201
2024-09-06 05:58:21 +00:00