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

70069 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 3021c3cedc Add `to_f` to predefined conversion method name to ID table 2021-12-08 19:11:02 +09:00
Nobuyoshi Nakada 454b4da763
[DOC] Integer.try_convert [ci skip] 2021-12-08 17:59:16 +09:00
Kazuhiro NISHIYAMA af6e088357
Skip bind port 1 when ip_unprivileged_port_start<=1
Linux can allow to bind port 1 to user.
And `ip_unprivileged_port_start` is 0 on [lima](https://github.com/lima-vm/lima) default vm.

```
1)
Socket#bind on SOCK_DGRAM socket raises Errno::EACCES when the current user does not have permission to bind FAILED
Expected Errno::EACCES but no exception was raised (0 was returned)
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:38:in `block (4 levels) in <top (required)>'
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:4:in `<top (required)>'

2)
Socket#bind on SOCK_STREAM socket raises Errno::EACCES when the current user does not have permission to bind FAILED
Expected Errno::EACCES but no exception was raised (0 was returned)
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:79:in `block (4 levels) in <top (required)>'
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:44:in `<top (required)>'

3)
Socket#bind using IPv4 using a packed socket address raises Errno::EACCES when the user is not allowed to bind to the port FAILED
Expected Errno::EACCES but no exception was raised (0 was returned)
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:119:in `block (6 levels) in <top (required)>'
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:85:in `<top (required)>'

4)
Socket#bind using IPv6 using a packed socket address raises Errno::EACCES when the user is not allowed to bind to the port FAILED
Expected Errno::EACCES but no exception was raised (0 was returned)
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:119:in `block (6 levels) in <top (required)>'
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:85:in `<top (required)>'
```
2021-12-08 13:26:53 +09:00
John Hawthorn 4a3e7984bf
Avoid Array allocation when appending to args array (#5211)
* Use duparray when possible for argspush

ARGSPUSH is the node we see with a single value pushed to the end of a
splatted array. ARGSCAT is similar, but is used when multiple values are
being concatenated to the list.

Previously only ARGSCAT had an optimization where when all the values
were static it would use duparray instead of newarray to create the
intermediate array.

This commit adds similar behaviour for ARGSPUSH, using duparray instead
of putobject/newarray.

* Replace duparray with putobject before concatarray

When performing duparray/concatarray we know we'll never use the
intermediate array being created by duparray, so we should be able to
use it as a temporary object.

This avoids an extra array allocation for NODE_ARGSPUSH (ex. [*foo, 1])
and NODE_ARGSCAT (ex. [*foo, 1, 2]).
2021-12-07 15:18:11 -08:00
David Rodríguez 852ea1e893 [rubygems/rubygems] Remove unnecessary comment
https://github.com/rubygems/rubygems/commit/5e50f12e7a
2021-12-08 07:59:35 +09:00
David Rodríguez 76cad13759 [rubygems/rubygems] Don't add custom github source to `bundle init` Gemfile
It's provided by bundler.

https://github.com/rubygems/rubygems/commit/25ccaab46b
2021-12-08 07:59:34 +09:00
David Rodríguez f0ef9ffed1 [rubygems/rubygems] Cancel deprecation of custom git sources
https://github.com/rubygems/rubygems/commit/99cd6e0627
2021-12-08 07:59:34 +09:00
Alan Wu 6beb05c2ad YJIT: Undo add_block_version() in OOM code path
Preivously, [1] failed to undo the effect of applying
add_block_version() to a block, leaving dangling pointers in the iseq
when compilation fails.

[1]: d0772632bf
2021-12-07 17:20:56 -05:00
Alan Wu 286c07f0dc YJIT: Remove guard_self_is_heap()
It's superseded by functionality added to jit_guard_known_klass().
In weird situations such as the ones in the included test,
guard_self_is_heap() triggered assertions.

Co-authored-by: Jemma Issroff <jemmaissroff@gmail.com>
2021-12-07 17:20:34 -05:00
git e51d0d2853 * 2021-12-08 [ci skip] 2021-12-08 01:49:36 +09:00
Simon Fish 1b12ebb94e [rubygems/rubygems] Add require parameter to `bundle add``
Test and ensure "false" is handled

Don't use yield_self to operate on autorequire

Remove duplicate autorequire

Add banner to require option

Don't use json to break down require params

Pass linter

https://github.com/rubygems/rubygems/commit/a4f2f8ac17
2021-12-08 01:49:20 +09:00
David Rodríguez 26303c31f0 [rubygems/rubygems] Pass "--" to git commands to separate positional and optional args
To make sure git uri's specified in Gemfile are never misinterpreted as
optional arguments, potentially allowing for local code execution.

https://github.com/rubygems/rubygems/commit/90b1ed8b9f
2021-12-07 23:27:59 +09:00
Nobuyoshi Nakada bb3f17bd98
More indentation in NEWS.md [ci skip]
The current Markdown implementation of RDoc requires list contents
to be indented 4 columns except for the first paragraph.
Maybe fixed as other implementations in the future.
2021-12-07 22:00:23 +09:00
Nobuyoshi Nakada a2d4e1cda6 Fixed the check order in wmap_live_p [Bug #18392]
Check if the object is a pointer to heap before check the flag in
that object.
2021-12-07 21:55:41 +09:00
Nobuyoshi Nakada d6c5a30cfd ObjectSpace::WeakMap#inspect: check if living object [Bug #18392] 2021-12-07 21:55:41 +09:00
Nobuyoshi Nakada ec878dac90
Move -ljemalloc to DLDLIBS [Bug #18391]
Set the alternative memory management library only as a platform
specific library, without other libraries.
2021-12-07 15:20:02 +09:00
Kazuhiro NISHIYAMA 91e9d27629
Fix a link [ci skip] 2021-12-07 15:02:08 +09:00
Marc-André Lafortune ad4ac68c7b [ruby/ostruct] ostruct v0.5.1 2021-12-06 23:21:24 -05:00
Marc-André Lafortune 95d9bcf2b2 [ruby/ostruct] Alias less methods
Skips methods that do not end with letter (in particular `!~` and `=~`)
For JRuby, also skip `instance_exec`, `instance_eval` and `eval`
2021-12-06 23:21:07 -05:00
Yusuke Endoh dfd9728c87 NEWS.md: Describe the change of the default width of `pp`
[Feature #12913]
2021-12-07 12:07:28 +09:00
Alan Wu 794b9a28b5 YJIT: Add integrity checks for blockid
Verify that the iseq idx pair for the block is valid in
invalidate_block_version(). While we are at it, bound loop
iterating over instructions to `iseq_body->iseq_size`.
2021-12-06 20:27:15 -05:00
Alan Wu b7ea66bc32 YJIT: Fix incomplete invalidation from opt_setinlinecache
As part of YJIT's strategy for promoting Ruby constant expressions into
constants in the output native code, the interpreter calls
rb_yjit_constant_ic_update() from opt_setinlinecache.

The block invalidation loop indirectly calls rb_darray_remove_unordered(),
which does a shuffle remove. Because of this, looping with an
incrementing counter like done previously can miss some elements in the
array. Repeatedly invalidate the first element instead.

The bug this commit resolves does not seem to cause crashes or divergent
behaviors.

Co-authored-by: Jemma Issroff <jemmaissroff@gmail.com>
2021-12-06 19:24:41 -05:00
Burdette Lamar 0209beaca6
Enhanced RDoc for literals.rdoc (#5213)
Makes link targets among percent literals.
    Adds links to those targets.
    Adds examples to percent literals.
    Links from opening summary list to corresponding sections.
2021-12-06 16:26:28 -06:00
Koichi Sasada 4c39fae4de add a NEWS entry for `mandatory_only?` 2021-12-07 02:03:30 +09:00
Koichi Sasada 87664b5cc8 add a NEWS entry about GC.total_time 2021-12-07 02:03:30 +09:00
Koichi Sasada 660687e6fa add NEWS about the improvement of `Struct` 2021-12-07 02:03:30 +09:00
git fb356c6f57 * 2021-12-07 [ci skip] 2021-12-07 01:53:55 +09:00
David Rodríguez 526c9359ca [rubygems/rubygems] Don't cleanup paths from gems already activated from `$LOAD_PATH`
This way, if some default gem has been required before bundler, and
rubygems has enhanced the `$LOAD_PATH` to use the latest version in the
system, further requires of that default gem after bundler has been
activated will use the same version and don't cause redefinition
warnings or worse problems derived from the fact of mixing up two
different versions. That, unless the gem is a `Gemfile` dependency. In
that case, we'll get a mismatch error anyways as we do now.

This fix doesn't mean that all default gems internally used by
bundler/rubygems are now supported inside `Gemfile`'s. That should be
handled case by case, but it will now bite people only when they try to
add the gem to their `Gemfile`, not before.

https://github.com/rubygems/rubygems/commit/7325530547
2021-12-07 01:53:39 +09:00
Jean Boussier 715a51a0d6 [rubygems/rubygems] Feature: accept pull request URLs as github source
Very often github source is used to temporarily use a modified gem
while a PR upstream is being reviewed.

So for instance https://github.com/ruby/bigdecimal/pull/211 will look like:

```ruby
gem "bigdecimal", github: "casperisfine/bigdecimal", branch: "git-gem" # https://github.com/ruby/bigdecimal/pull/200
```

It's annoying because you have to fiddle with the branch name, which is copied as `casperisfine:git-gem`, etc etc.

If I could simply use the PR URL like this:

```
gem "bigdecimal", github: "https://github.com/ruby/bigdecimal/pull/211"
```

It would make a very common task for me so much simpler.

https://github.com/rubygems/rubygems/commit/517c527751
2021-12-06 20:27:29 +09:00
David Rodríguez d044ffd77f [rubygems/rubygems] Allow using `Gem::Version` without loading the rest of rubygems
https://github.com/rubygems/rubygems/commit/1b862537a5
2021-12-06 18:43:29 +09:00
David Rodríguez e41c195cc5 [rubygems/rubygems] Fix incorrect quoting
Test was just returning a string instead of actually exercising the
require.

https://github.com/rubygems/rubygems/commit/62c827d7e1
2021-12-06 18:43:28 +09:00
Josef Šimánek 25423f0918 [rubygems/rubygems] Add --version parameter to bundle info command.
https://github.com/rubygems/rubygems/commit/7d9fdd908d
2021-12-06 18:03:54 +09:00
Nobuyoshi Nakada 5ce3272e51
autogen.sh: Copy auxiliary files instead of symlinks with `-i`
When accessing from containers, symbolic links may not be able to
reach outer file systems.
2021-12-06 17:53:37 +09:00
Colby Swandale 9c0c66f721 [rubygems/rubygems] add login & logout for the signin & signout commands respectively
https://github.com/rubygems/rubygems/commit/49b491970b
2021-12-06 17:42:56 +09:00
Nobuyoshi Nakada e563c6068e
sync_default_gems.rb: convert commit hashes to github URLs [ci skip] 2021-12-06 14:18:01 +09:00
Shugo Maeda c2192cb985
Clarify the error message when trying to import C methods [Bug #18385] 2021-12-06 09:40:54 +09:00
David Rodríguez e713552868 [rubygems/rubygems] LOAD_PATH is already reset globally
https://github.com/rubygems/rubygems/commit/b0bbb27115
2021-12-06 05:25:22 +09:00
David Rodríguez 2fc47bad78 [rubygems/rubygems] Remove unneded setup
https://github.com/rubygems/rubygems/commit/9815a04e31
2021-12-06 05:25:21 +09:00
Alan Wu a785e6c356 Make `leaf` const in VM generator
Assigning to `leaf` in insns.def would give undesirable results.
2021-12-05 11:06:05 -05:00
git 26e4887eed * 2021-12-06 [ci skip] 2021-12-06 00:26:51 +09:00
Alan Wu 26063d3954 YJIT: Initialize code buffer with PUSH DS
PUSH DS triggers the #UD processor exception in 64-bit mode, which the
OS translates to a SIGILL. Unlike INT3, this triggers the usual crash
reporter, which makes failures easier to notice. When there is a
debugger attached, the PUSH DS pauses execution just like INT3.
2021-12-05 10:26:35 -05:00
Nobuyoshi Nakada bbfefd45c6
[ruby/securerandom] Remove no longer used helper methods
Unused since r59801, 782b2050b8,
or https://github.com/ruby/securerandom/commit/52c8e7a85e017f.

https://github.com/ruby/securerandom/commit/38fc2c4427
2021-12-05 23:13:23 +09:00
Kazuhiro NISHIYAMA 00a941ac4b
Update stdlib versions [ci skip] 2021-12-05 20:34:25 +09:00
Kazuhiro NISHIYAMA 20dfc7621c
Sort URLs by issue numbers [ci skip] 2021-12-05 20:31:58 +09:00
Nobuyoshi Nakada 19f037e452
More indentation in NEWS.md [ci skip]
The current Markdown implementation of RDoc requires list contents
to be indented 4 columns except for the first paragraph.
Maybe fixed as other implementations in the future.
2021-12-05 19:23:42 +09:00
Junichi Ito e818193784 Fix wrong indentation in NEWS.md [ci skip] 2021-12-05 19:07:06 +09:00
Nobuyoshi Nakada b555e659c4
Do not use `fcopyfile` if appending to non-empty file [Bug #18388]
`fcopyfile` appends `src` to `to` and then truncates `to` to it's
original size.
2021-12-05 18:47:02 +09:00
David Rodríguez a72aecac3a [rubygems/rubygems] Don't write outside of destdir when regenerating plugins
https://github.com/rubygems/rubygems/commit/141ef4cb9a
2021-12-05 05:47:46 +09:00
David Rodríguez 9dc76e102e [rubygems/rubygems] Don't write outside of destdir when installing default bundler
https://github.com/rubygems/rubygems/commit/a62d00c5e8
2021-12-05 05:47:45 +09:00
David Rodríguez ec28771fde [rubygems/rubygems] Fold a line that got out of hand
https://github.com/rubygems/rubygems/commit/49317d8beb
2021-12-05 05:47:45 +09:00