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

81759 Коммитов

Автор SHA1 Сообщение Дата
Matheus Richard d69af4788a [ruby/io-console] [DOC] Add documentation for IO#cursor
ruby/io-console#50

https://github.com/ruby/io-console/commit/ee752ce771
2023-12-07 10:50:00 +00:00
git 2e9329e7a2 Update bundled gems list at bc6a0ede4a [ci skip] 2023-12-07 09:57:01 +00:00
Hiroshi SHIBATA bc6a0ede4a
Bump up bundled net-ftp gem version to 0.3.0 2023-12-07 18:56:23 +09:00
Kazuhiro NISHIYAMA eaead94d04
Sort links [ci skip] 2023-12-07 18:44:05 +09:00
Tanaka Akira abf192eb16 always omit test_ai_addrconfig. 2023-12-07 18:28:47 +09:00
KJ Tsanaktsidis d2ba8ea54a
Set AI_ADDRCONFIG when making getaddrinfo(3) calls for outgoing conns (#7295)
When making an outgoing TCP or UDP connection, set AI_ADDRCONFIG in the
hints we send to getaddrinfo(3) (if supported). This will prompt the
resolver to _NOT_ issue A or AAAA queries if the system does not
actually have an IPv4 or IPv6 address (respectively).

This makes outgoing connections marginally more efficient on
non-dual-stack systems, since we don't have to try connecting to an
address which can't possibly work.

More importantly, however, this works around a race condition present
in some older versions of glibc on aarch64 where it could accidently
send the two outgoing DNS queries with the same DNS txnid, and get
confused when receiving the responses. This manifests as outgoing
connections sometimes taking 5 seconds (the DNS timeout before retry) to
be made.

Fixes #19144
2023-12-07 17:55:15 +09:00
Takashi Kokubun c6eb355e04 Revert "Warn `it` only with -W:deprecated"
This reverts commit 5458252bb0.

Revert "Fallback rb_warn_deprecated for UNIVERSAL_PARSER"

This reverts commit 680be886f4.

matz actually preferred always warning `it`.
2023-12-07 00:03:03 -08:00
Takashi Kokubun 680be886f4 Fallback rb_warn_deprecated for UNIVERSAL_PARSER 2023-12-07 00:00:36 -08:00
Takashi Kokubun 5458252bb0 Warn `it` only with -W:deprecated 2023-12-06 23:44:02 -08:00
git 3bf1c48759 Update default gems list at a41d6c825c [ci skip] 2023-12-07 07:23:08 +00:00
Hiroshi SHIBATA a41d6c825c [ruby/open-uri] Bump up 0.4.1
https://github.com/ruby/open-uri/commit/d72508a7f4
2023-12-07 07:22:20 +00:00
Takashi Kokubun ae76c8a11e
Warn `it` (#9152)
https://bugs.ruby-lang.org/issues/18980
2023-12-07 07:14:59 +00:00
Andrew Kane 41c00bc97e [ruby/open-uri] Set default for max_redirects and add exception class
https://github.com/ruby/open-uri/commit/dcdcb885cc
2023-12-07 07:00:54 +00:00
Andrew Kane d97479f9c9 [ruby/open-uri] Add :max_redirects option
https://github.com/ruby/open-uri/commit/7fd5ea09a7
2023-12-07 07:00:53 +00:00
Ellen Marie Dash 7d32830b8c [rubygems/rubygems] Make --build-root disable auto-user-install.
https://github.com/rubygems/rubygems/commit/6a06b0763f
2023-12-07 13:56:23 +09:00
David Rodríguez 33bd956257 [rubygems/rubygems] Better approach to falling back to user installation when GEM_HOME not writable
https://github.com/rubygems/rubygems/commit/f67bced16b
2023-12-07 13:56:22 +09:00
David Rodríguez 0f3f907e17 [rubygems/rubygems] Add some early assertions to make sure the test is progressing fine
If an error happens during the install command, it will fail in an
strange way right now.

https://github.com/rubygems/rubygems/commit/2b6e0c703a
2023-12-07 13:56:22 +09:00
Vít Ondruch aabf2ce181 [rubygems/rubygems] Use globals variables for standard input/output
Replace use of `STDIN`, `STDOUT` and `STDERR` constants by their
`$stdin`, `$stdout` and `$stderr` global variable equivalents.

This enables easier testing via standard means, such as `assert_output`
for minitest or `expect { print 'foo' }.to output.to_stdout` for RSpec
test suites.

https://github.com/rubygems/rubygems/commit/a0a6fc1b76
2023-12-07 13:55:31 +09:00
Dustin Brown d89280e8bf
Copy encoding flags when copying a regex [Bug #20039]
* 🐛 Fixes [Bug #20039](https://bugs.ruby-lang.org/issues/20039)

When a Regexp is initialized with another Regexp, we simply copy the
properties from the original. However, the flags on the original were
not being copied correctly. This caused an issue when the original had
multibyte characters and was being compared with an ASCII string.
Without the forced encoding flag (`KCODE_FIXED`) transferred on to the
new Regexp, the comparison would fail. See the included test for an
example.

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-12-06 19:25:29 -08:00
Yusuke Endoh 1ace218690 Remove a note for `bundle exec ruby` not printing a warning
The implementation limitation is fixed by https://github.com/rubygems/rubygems/pull/7224
2023-12-07 12:11:19 +09:00
Hiroshi SHIBATA 214f6d6598 Move replace_require into bundled_gems.rb 2023-12-07 11:37:08 +09:00
Soutaro Matsumoto 4f213ea1ba
Fix SEGV caused by `GC::Profiler.raw_data` (#9122) 2023-12-07 10:37:00 +09:00
hogelog 5078aa825c Add NEWS for Range#overlap? 2023-12-07 09:45:46 +09:00
Haldun Bayhantopcu ce094e8556 [ruby/prism] Emit error for constant assignments in defs
https://github.com/ruby/prism/commit/864b06f90e
2023-12-06 22:15:16 +00:00
Alan Wu 9d9865d9bc YJIT: Add some object validity assertions
We've seen quite a few compaction bugs lately, and these assertions
should give clearer symptoms. We only call class_of() on
objects that the Ruby code can see.
2023-12-06 16:42:53 -05:00
Kevin Newton c5a4409f20 [ruby/prism] Simplify unterminated string
https://github.com/ruby/prism/commit/ef512ca914
2023-12-06 21:34:48 +00:00
Matt Valentine-House c8b60c8ac2 [PRISM] Correct depth offset for block local vars
Blocks should always look at their own local table first, even when
defined inside an ensure/rescue or something else that uses depth
offset. We can ignore the depth offset if we're doing local lookups
inside a block
2023-12-06 21:12:08 +00:00
Kevin Newton fe6ee5e921 [ruby/prism] Move flag position consistently to front
https://github.com/ruby/prism/commit/6e69a81737
2023-12-06 20:50:02 +00:00
TSUYUSATO Kitsune cbb941f58a [ruby/prism] Fix closing loc for string literals
Fix https://github.com/ruby/prism/pull/1974

https://github.com/ruby/prism/commit/453d403593
2023-12-06 20:48:11 +00:00
Haldun Bayhantopcu a57186b9d1 [ruby/prism] Fix one potential memory leak and silence one false positive report.
https://github.com/ruby/prism/commit/9608aa386e
2023-12-06 20:38:22 +00:00
Takashi Kokubun a439fc2f17
YJIT: Avoid register allocation conflict with a higher stack_idx (#9143)
YJIT: Avoid register allocation conflict

with a higher stack_idx
2023-12-06 15:19:43 -05:00
Eric Mueller 9336bbb0b2 [rubygems/rubygems] Bundler::Fetcher uses Bundler::CIDetector
Additionally, the result is memoized, as it's used twice in a row.

This change does result in a net behavioral diff, as the list of ENVs
being checked has been updated (now includes buildkite, taskcluster,
cirrus, dsari, and drops buildbox and snap)

https://github.com/rubygems/rubygems/commit/3fb445a5a1
2023-12-06 20:05:25 +00:00
Eric Mueller 6fd3b358ff [rubygems/rubygems] Duplicate Gem::CIDetector into bundler
Because bundler needs to support older versions of rubygems, we can't
actually rely on Gem::CIDetector (yet - in a year or so they might be
able to consolidate, if they don't change futher). So we're copying it
into the Bundler:: namespace, and enforcing that they stay completely in
sync with a test. No other tests are needed, since Gem::CIDetector is
already tested, and this is and will remain identical.

https://github.com/rubygems/rubygems/commit/abc67f0da1
2023-12-06 20:05:25 +00:00
Eric Mueller a6c912a80d [rubygems/rubygems] Gem::UpdateSuggestion uses Gem::CIDetector
https://github.com/rubygems/rubygems/commit/e5b0458342
2023-12-06 20:05:24 +00:00
Eric Mueller b1b78c4f9f [rubygems/rubygems] Introduce the Gem::CIDetector
This is based on the list in Gem::UpdateSuggestion and Bundler::Fetcher;
these have similar purposes (determining whether/what CI we're executing
in), and can benefit from being combined and updated (they're both
slightly out of date).

Noteable changes:
* We'll consider ourselves to be on a CI in more cases - if CI_NAME or
  TASKCLUSTER_ROOT_URL are set specifically, since those represent two
  cases that were either overlooked or are no longer covered by the
  existing implementation. (Or possibly TaskCluster still does provide
  RUN_ID, but failed to document it)
* We will notice/track a few additional services in ci_strings (cirrus,
  dsari, taskcluster), stop tracking 'snap' (they went under in 2017),
  and update buildbox to buildkite (they've been called that for 8
  years, and the BUILDBOX envs have been deprecated for 3).
* We'll also sort/uniq/downcase the values (all of which only matter
  because of the special case of CI_NAME).

https://github.com/rubygems/rubygems/commit/60652b942f
2023-12-06 20:05:23 +00:00
Kevin Newton 82072254a0 [ruby/prism] Update documentation for encodings
https://github.com/ruby/prism/commit/18e6df0d4f
2023-12-06 19:26:35 +00:00
Kevin Newton 153c09f24b [prism] Handle string and xstring encodings 2023-12-06 14:23:38 -05:00
Kevin Newton 82f18baa21 [ruby/prism] Provide flags for changing encodings
https://github.com/ruby/prism/commit/e838eaff6f
2023-12-06 14:23:38 -05:00
Jemma Issroff 9620ca6789 [PRISM] Extract a PM_NOP helper 2023-12-06 13:05:03 -05:00
Jemma Issroff 0316e666c0 [PRISM] Fix ReturnNodes
This code is almost exactly the same (fixed variable names) as
what exists already in compile.c
2023-12-06 12:25:49 -05:00
Peter Zhu 12e3b07455 Re-embed when removing Object instance variables
Objects with the same shape must always have the same "embeddedness"
(either embedded or heap allocated) because YJIT assumes so. However,
using remove_instance_variable, it's possible that some objects are
embedded and some are heap allocated because it does not re-embed heap
allocated objects.

This commit changes remove_instance_variable to re-embed Object
instance variables when it becomes small enough.
2023-12-06 11:34:07 -05:00
Jemma Issroff f80262b14d [PRISM] Account for nil parent in Call{Operator,And,Or}PathWriteNodes
Prior to this commit, we were not accounting for the case of a nil
parent in a CallXPathWriteNode, for example ::A ||= 1. This commit
checks if the parent exists, and if not, uses Object as the inferred
parent
2023-12-06 11:31:43 -05:00
Peter Zhu 64ab04da6a [ruby/bigdecimal] Clarify that JSON methods come from the JSON gem
https://github.com/ruby/bigdecimal/commit/581725d4e5
2023-12-06 16:14:54 +00:00
Peter Zhu 4a7151a8e4 Deduplicate assertions in redblack_balance
The bug in i686 was fixed in commit
71babe5536.
2023-12-06 10:16:58 -05:00
BurdetteLamar dab5a4b61a [ruby/bigdecimal] [DOC] Add section Methods for Working with JSON
https://github.com/ruby/bigdecimal/commit/2edd8d0a23
2023-12-06 14:59:23 +00:00
Jemma Issroff 018dbf18d5 [ruby/prism] Add locals_body_index to DefNode, BlockNode, LambdaNode
The locals_body_index gives the index in the locals array where
the locals from the body start. This allows compilers to easily
index past the parameters in the locals array.

https://github.com/ruby/prism/commit/5d4627b890
2023-12-06 09:55:48 -05:00
eileencodes da1519b223 [PRISM] Implement `PM_MATCH_PREDICATE_NODE` for `defined?`
Ruby code:

```ruby
defined? 1 in 1
```

Instructions:

```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,16)>
0000 putobject                              "expression"
0002 leave

"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,16)>
0000 putobject                              "expression"
0002 leave
```
2023-12-06 09:46:19 -05:00
eileencodes 4547108448 [PRISM] Implement `PM_KEYWORD_HASH_NODE` for `defined?`
Ruby code:

```ruby
defined? [a: [:b, :c]]
```

Instructions (without optimizations):

```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,23)>
== catch table
| catch type: rescue st: 0001 ed: 0007 sp: 0000 cont: 0009
| == disasm: #<ISeq:defined guard in <compiled>@<compiled>:0 (0,0)-(-1,-1)>
| local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
| [ 1] "$!"@0
| 0000 putnil
| 0001 leave
|------------------------------------------------------------------------
0000 putnil
0001 putobject                              true
0003 branchunless                           9
0005 putobject                              "expression"
0007 swap
0008 pop
0009 leave

"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,23)>
== catch table
| catch type: rescue st: 0000 ed: 0009 sp: 0000 cont: 0009
| == disasm: #<ISeq:defined guard in <compiled>@<compiled>:0 (0,0)-(-1,-1)>
| local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
| [ 1] "$!"@0
| 0000 putnil
| 0001 leave
|------------------------------------------------------------------------
0000 putnil
0001 putobject                              true
0003 branchunless                           9
0005 putobject                              "expression"
0007 swap
0008 pop
0009 leave
```

Instructions (with optimizations):

```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,23)>
== catch table
| catch type: rescue st: 0001 ed: 0003 sp: 0000 cont: 0005
| == disasm: #<ISeq:defined guard in <compiled>@<compiled>:0 (0,0)-(-1,-1)>
| local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
| [ 1] "$!"@0
| 0000 putnil
| 0001 leave
|------------------------------------------------------------------------
0000 putnil
0001 putobject                              "expression"
0003 swap
0004 pop
0005 leave

"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,23)>
== catch table
| catch type: rescue st: 0000 ed: 0005 sp: 0000 cont: 0005
| == disasm: #<ISeq:defined guard in <compiled>@<compiled>:0 (0,0)-(-1,-1)>
| local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
| [ 1] "$!"@0
| 0000 putnil
| 0001 leave
|------------------------------------------------------------------------
0000 putnil
0001 putobject                              "expression"
0003 swap
0004 pop
0005 leave
```
2023-12-06 09:46:19 -05:00
eileencodes 8649764522 [PRISM] Implement `PM_SPLAT_NODE` for `defined?`
In an array for `defined?` we need to check if there is a
`contains_splat` flag, if so bail early.

Ruby code:

```ruby
defined?([[*1..2], 3, *4..5])
```

Instructions:

```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,29)>
0000 putobject                              "expression"
0002 leave

"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,29)>
0000 putobject                              "expression"
0002 leave
```
2023-12-06 09:46:19 -05:00
eileencodes 02961fdbab [PRISM] Implement `PM_SOURCE_LINE_NODE` for `defined?`
Ruby code:

```ruby
defined?(__LINE__)
```

Instructions:

```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,18)>
0000 putobject                              "expression"
0002 leave

"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,18)>
0000 putobject                              "expression"
0002 leave
```
2023-12-06 09:46:19 -05:00