Commit graph

89125 commits

Author SHA1 Message Date
Jean Boussier
ee0de3fd4e [ruby/json] JSON.dump: write directly into the provided IO
Ref: https://github.com/ruby/json/issues/524

Rather than to buffer everything in memory.

Unfortunately Ruby doesn't provide an API to write into
and IO without first allocating a string, which is a bit
wasteful.

f017af6c0a
2024-11-26 15:11:05 +09:00
Jeremy Evans
519701657f Update NEWS.md for Bug #20620 2024-11-25 21:00:59 -08:00
Nobuyoshi Nakada
aa5b1d8df9
[Feature #20293] Add Warning.categories to NEWS 2024-11-26 13:09:24 +09:00
Hiroshi SHIBATA
8655b9f7c6 [ruby/uri] Suppress deprecate warning of test class and use EnvUtil.suppress_warning.
bd2e4be9d0
2024-11-26 03:32:01 +00:00
Hiroshi SHIBATA
1d9dc4c504 [ruby/uri] Revert "Prevent a warning: URI::REGEXP is obsolete
(https://github.com/ruby/uri/pull/138)"

This reverts commit c00726a20a.

22f5a7a790
2024-11-26 03:32:01 +00:00
Yusuke Endoh
22c1ba9409 NEWS.md: Fix a typo 2024-11-26 12:12:59 +09:00
Yusuke Endoh
92cf8a5705 Add NEWS entries temporarily
https://bugs.ruby-lang.org/issues/20108
https://bugs.ruby-lang.org/issues/20564
https://bugs.ruby-lang.org/issues/20705
https://bugs.ruby-lang.org/issues/20782
https://bugs.ruby-lang.org/issues/20811
2024-11-26 12:10:03 +09:00
Yusuke Endoh
c60cac50f4 NEWS.md: sort the entries alphabetically 2024-11-26 12:08:55 +09:00
Nobuyoshi Nakada
6b4f8945d6 Many of Oniguruma functions need valid encoding strings 2024-11-26 11:46:34 +09:00
Nobuyoshi Nakada
02b70256b5 Check negative integer underflow 2024-11-26 11:46:34 +09:00
Hiroshi SHIBATA
c08e1f336c [ruby/resolv] Omit Windows and MinGW platforms with with_udp_and_tcp
3351165599

```
  => 705:     with_udp_and_tcp('127.0.0.1', 0) do |u1, t1|
     706:       with_udp_and_tcp('127.0.0.1', 0) do |u2,t2|
     707:         u2.close # XXX: u2 UDP socket is not used, but using #with_udp_and_tcp to enable Windows EACCES workaround
     708:         _, server1_port, _, server1_address = u1.addr
Error: Errno::EACCES: Permission denied - bind(2) for "127.0.0.1" port 55685
```

3346106852

```
    1) Error:
  TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback:
  Errno::EACCES: Permission denied - bind(2) for "127.0.0.1" port 50676
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer#initialize'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer.new'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TestResolvDNS#with_udp_and_tcp'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:705:in 'TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback'
```

05765df178
2024-11-26 02:44:00 +00:00
Shugo Maeda
4e59ae6e27
Add news about MatchData#bytebegin and MatchData#byteend 2024-11-26 11:13:59 +09:00
Maximillian Polhill
56fbf64a53 Fix vm_objtostring optimization for Symbol
Co-authored-by: John Hawthorn <john@hawthorn.email>
2024-11-25 17:29:58 -08:00
Hiroshi SHIBATA
36f67f6bbb [ruby/resolv] _1 is not provided in Ruby 2.5
83f18e2a49
2024-11-26 00:28:06 +00:00
Mike Linksvayer
7be0d50514 [ruby/logger] include license texts in gem
1a64cb552f
2024-11-25 22:31:44 +00:00
Stan Lo
544d684412 Use footnote links instead 2024-11-25 15:38:20 -05:00
Stan Lo
96766517b0 Update maintainer GH handles and add links when possible 2024-11-25 15:38:20 -05:00
Stan Lo
c3144e4f6d Escape Module in the header 2024-11-25 15:38:20 -05:00
Stan Lo
7c200a46ad Add new lines after headers 2024-11-25 15:38:20 -05:00
Stan Lo
9362753d07 Update RDoc's maintainers list 2024-11-25 15:38:20 -05:00
Maxime Chevalier-Boisvert
081bdc5125
YJIT: fix small typo in command line options help (#12167) 2024-11-25 19:32:19 +00:00
dependabot[bot]
cdd47436ae [rubygems/rubygems] Bump the rb-sys group across 2 directories with 1 update
Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib directory: [rb-sys](https://github.com/oxidize-rb/rb-sys).
Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example directory: [rb-sys](https://github.com/oxidize-rb/rb-sys).

Updates `rb-sys` from 0.9.102 to 0.9.103
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.102...v0.9.103)

Updates `rb-sys` from 0.9.102 to 0.9.103
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.102...v0.9.103)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rb-sys
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rb-sys
...

Signed-off-by: dependabot[bot] <support@github.com>

31b8a68dd5
2024-11-25 18:35:02 +00:00
David Rodríguez
62b9da7088 [rubygems/rubygems] Fix bundle lock --add-checksums
Due to a typo in the spec, the issue was not caught initially. If
Bundler does not need to re-resolve, `bundle lock` is a noop so Bundler
does not add checksums.

To fix the issue, we do something similar to what `bundle install` does,
just without actually installation. First set the domain (local or
remote) according to whether a re-resolve is necessary, and then
materialize lazy specifications into real specifications, so that
checksums are actually fetched from each source.

84b6f4ee96
2024-11-25 18:14:32 +00:00
David Rodríguez
e7bb505130 [rubygems/rubygems] Make installer code more clear
I always found the `resolve_if_necessary` method pretty confusing
because by reading it, it suggests that resolution always happens, and
the point is whether that needs to be local or remote. This commit tries
to make that more clear.

93d6861ee8
2024-11-25 18:14:31 +00:00
David Rodríguez
c215e95572 [rubygems/rubygems] Most of the times, eagerly resolving is not necessary
All we need is to setup remote or local sources appropriately.

3ceff46a2a
2024-11-25 18:14:31 +00:00
tomoya ishida
0f41cc442e [ruby/reline] Fix tab completion appending quote
(https://github.com/ruby/reline/pull/782)

cbf213291c
2024-11-25 17:38:50 +00:00
Jean Boussier
cedcf2d681 error.c: call va_end before jumping
The man page is clear that every `va_start` call MUST be succeeded by
the corresponding `va_end` call.

So `rb_raise` can't call `rb_exc_raise` before `va_end`, otherwise
`va_end` is never called.

Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
2024-11-25 18:18:39 +01:00
gemmaro
1d510a952d [rubygems/rubygems] Fix test task name on generated readme when using test-unit
* bundler/lib/bundler/templates/newgem/README.md.tt (Development): Use the
test_task value to get the correct test task name ("test", not "test-unit").
* bundler/spec/commands/newgem_spec.rb (README.md): Add tests for test task
names for each test frameworks.

2a24708a63
2024-11-25 16:20:52 +00:00
David Rodríguez
e1de5a6e3b [rubygems/rubygems] Fix gemfury credentials getting written to logs in verbose mode
585a6a89d4
2024-11-25 14:57:03 +00:00
David Rodríguez
eb87147bda [rubygems/rubygems] Improve index fetcher specs
09e0971ab8
2024-11-25 14:57:03 +00:00
David Rodríguez
77990f6751 [rubygems/rubygems] Remove comment about oldest supported version
That's indeed the ideal behavior but it's a mess to maintain because the
version of RubyGems shipped with each patchlevel of Ruby changes. We
could try looking at the `VERSION` constant in `
RbConfig::CONFIG["rubylibdir"` but for now I calling what's in there now
as good enough.

40ccf2b093
2024-11-25 14:56:09 +00:00
David Rodríguez
4e6ada3ae4 [rubygems/rubygems] Remove unnecessary and out of date ruby version check
We already do this check in `setup.rb` itself, which is run earlier.

160cc3f1c5
2024-11-25 14:56:08 +00:00
David Rodríguez
d2acc71d32 [rubygems/rubygems] Remove now dead code
31fadaf2d2
2024-11-25 14:56:08 +00:00
Matt Valentine-House
f127bcb829 define rb_current_ec_set in all cases 2024-11-25 13:05:23 +00:00
Matt Valentine-House
551be8219e Place all non-default GC API behind USE_SHARED_GC
So that it doesn't get included in the generated binaries for builds
that don't support loading shared GC modules

Co-Authored-By: Peter Zhu <peter@peterzhu.ca>
2024-11-25 13:05:23 +00:00
Matt Valentine-House
d61933e503 Use extconf to build external GC modules
Co-Authored-By: Peter Zhu <peter@peterzhu.ca>
2024-11-25 13:05:23 +00:00
Yusuke Endoh
92585898fb Prevent memory leak
```
for (int i = 0; i < arg->family_size; i++) {
    arg->getaddrinfo_entries[i] = allocate_fast_fallback_getaddrinfo_entry();
    if (!(arg->getaddrinfo_entries[i])) rb_syserr_fail(errno, "calloc(3)");
```

If the allocation fails in the second interation, the memory allocated
in the first iteration would be leaked.

This change prevents the memory leak by allocating the memory in
advance.
(The struct name `fast_fallback_getaddrinfo_shared` might no longer be
good.)
2024-11-25 20:18:48 +09:00
Yusuke Endoh
6ab76a6212 [rubygems/rubygems] Prevent a warning: net/http: Content-Type did not set
`make test-all RUBYOPT=-w` in the ruby/ruby repo printed the warning.
This change prevents the warning by specifying the content-type
explicitly.

A follow-up to b70c1bb150

d573af07f6
2024-11-25 10:13:32 +00:00
Nobuyoshi Nakada
4d8c793bc3 Fix initialization of struct wait_fast_fallback_arg::cancelled 2024-11-25 17:40:14 +09:00
Nobuyoshi Nakada
a355f7d351 [ruby/open-uri] Use ENV.update
04067e54b9
2024-11-25 08:00:03 +00:00
Yusuke Endoh
da8f554011 [ruby/uri] Prevent a warning: URI::REGEXP is obsolete
(https://github.com/ruby/uri/pull/138)

c00726a20a
2024-11-25 07:28:52 +00:00
Hiroshi SHIBATA
73cc312e42 Skip flaky tests of rbs in macOS 15.x 2024-11-25 15:46:07 +09:00
Yusuke Endoh
f78f1e927f Prevent a warning: setting Encoding.default_external 2024-11-25 15:45:00 +09:00
Misaki Shioi
ff5fc4b5a1
Do not save the last error without sockets in the connection attempt (#12153)
* Do not save the last_error if there are no sockets waiting to be connected

In this implementation, the results of both name resolution and connection attempts are awaited using select(2).
When it returned, the implementation attempted to check for connections even if there were no sockets currently attempting to connect, treating the absence of connected sockets as a connection failure.
With this fix, it will no longer check for connections when there are no sockets waiting to be connected.

Additionally, the following minor fixes have been made:

* Handle failure of getsockopt(2) and removed unnecessary continue in the loop

* Tweak: Use common API to check in_progress_fds

* Safely call TCPServer.new in test

* Set empty writefds when there is no socket waiting to be connected

* Enable fast_fallback option
2024-11-25 14:10:54 +09:00
Hiroshi SHIBATA
b305df8c78
Skip sync failure when we specified old version 2024-11-25 10:58:24 +09:00
Hiroshi SHIBATA
30fda41139
Removed redundant argument at Reline::LineEditor::CompletionBlockTest 2024-11-25 08:16:53 +09:00
tomoya ishida
bf47b1b523 [ruby/reline] Fix completion quote, preposing and target calculation
bug
(https://github.com/ruby/reline/pull/763)

d3ba7216eb
2024-11-24 15:45:18 +00:00
Nobuyoshi Nakada
c6ca339955
Fix --empty option of ifchange 2024-11-24 18:34:01 +09:00
Earlopain
3826019f31 Fix a build failure with musl
```
compiling gc.c
In file included from gc.c:80:
/usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
   88 | struct prctl_mm_map {
      |        ^~~~~~~~~~~~
In file included from gc.c:79:
/usr/include/linux/prctl.h:134:8: note: originally defined here
  134 | struct prctl_mm_map {
      |        ^~~~~~~~~~~~
```

The first include is not needed and is what causes this issue.
Two other places in ruby exclusively use the sys import.

See https://github.com/seccomp/libseccomp/issues/19 for a similar problem.
2024-11-24 17:47:06 +09:00
Samuel Williams
a8c2d5e7be
Ensure fiber scheduler re-acquires mutex when interrupted from sleep. (#12158)
[Bug #20907]
2024-11-23 23:54:12 +00:00