Commit graph

89125 commits

Author SHA1 Message Date
Misaki Shioi
31997661e4
UBF is also required for synchronous name resolution (#12156)
`rb_thread_call_without_gvl2` is used to wait for the results of name resolution and connection attempts.
When there is only one address family to resolve, the necessary resources were not being passed to the UBF.
With this change, the handling of resources has been revised and organized to work consistently, whether there are two address families to resolve or only one.
2024-11-24 00:44:13 +09:00
Misaki Shioi
8d575e4972
Save the error that occurred during name resolution (#12155)
even if a system call error happens after the name resolution failure in the child thread.

pipe and write(2) are used to notify the main thread of the name resolution results from the child thread.
After name resolution is completed in the child thread, if the call to write(2) fails, the main thread retrieves the resolved addresses.
However, when name resolution failed, the corresponding error was not being saved in `last_error`.
With this change, name resolution failures will now be saved in last_error even if the write(2) call in the child thread fails.
2024-11-23 23:04:02 +09:00
John Hawthorn
34e36a72a7 Ensure global variable traces are freed at exit
ASAN_OPTIONS="detect_leaks=1" RUBY_FREE_AT_EXIT=1 ./miniruby -e 'trace_var(:$x){}'
2024-11-23 01:16:48 -08:00
John Hawthorn
a8ebc596d6 Free parse result under -c 2024-11-22 19:25:01 -08:00
Josh Cooper
b4d13fac3d [ruby/openssl] Support signing CRLs using Ed25519
Allow CRLs to be signed using Ed25519 private keys by passing a nil digest.

b62375bcde
2024-11-22 17:26:03 +00:00
Josh Cooper
6389c9a395 [ruby/openssl] Support signing requests using Ed25519
Allow requests to be signed using Ed25519 private keys by passing a nil digest.
This is similar to commit b0fc100091 when signing certs.

Calling PKey#public_key is deprecated and does not work for Ed25519. The same
can be accomplished by passing the private key.

d96090320d
2024-11-22 17:26:02 +00:00
Josh Cooper
ce4906efb3 [ruby/openssl] Check for compatible openssl versions earlier
test_pkey wasn't checking for libressl as is done elsewhere.

Note the libressl version check is different when testing pkey, because
PKey#sign relies on EVP_PKey_sign, whereas signing an X509 cert/request/crl
relies on ASN1_item_sign.

f1db5c88a2
2024-11-22 17:26:02 +00:00
sodacris
0989400a92 [rubygems/rubygems] fix bundle which commands on windows
9e0018d9fe
2024-11-22 13:36:21 +00:00
Nobuyoshi Nakada
80cfa57234
[Feature #20563] Update required Windows version
Update the default `NTVER`, so that the declarations of APIs
introduced since Windows 8 will be enabled.
https://learn.microsoft.com/cpp/porting/modifying-winver-and-win32-winnt
2024-11-22 19:01:55 +09:00
Peter Zhu
770ca58cd3 [ruby/mmtk] Use extconf.rb for external GC compilation
This commit adds extconf.rb for both the default GC and and MMTk to build
the external GC. This allows common.mk to not need to contain any
implementation-specific build configuration.

db6a29b4a9
2024-11-22 09:55:25 +00:00
Peter Zhu
19840dfd71 [ruby/mmtk] [Feature #20860] Implement Mark-Sweep with MMTK
This commit implements the mark-sweep algorithm using MMTk and allows
customizing the plan using MMTK_PLAN.

6fea5e5ffc

Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
2024-11-22 09:55:24 +00:00
Peter Zhu
211aef1bc0 [ruby/mmtk] [Feature #20860] Implement NoGC with MMTk
This commit only supports initializing MMTk with NoGC and object
allocation.

39aa10e537

Co-Authored-By: Kunshan Wang <wks1986@gmail.com>
2024-11-22 09:55:23 +00:00
Kazuhiro NISHIYAMA
f90c356317
[DOC] Fix a link in NEWS.md 2024-11-22 17:46:29 +09:00
git
37a72b0150 Update bundled gems list as of 2024-11-21 2024-11-22 07:00:50 +00:00
Yusuke Endoh
5bd144c1bb Add a temporal debugging code
... to check the return value of ioctl

http://ci.rvm.jp/results/trunk_asan@ruby-sp1/5423172
```
/tmp/ruby/src/trunk_asan/lib/reline/io/ansi.rb:192: [BUG] rb_sys_fail_str(<STDIN>) - errno == 0
```
2024-11-22 15:00:20 +09:00
Nobuyoshi Nakada
4e01878bad
[Bug #20903] rb_econv_str_append arguments expected to be String 2024-11-22 10:36:05 +09:00
Matt Valentine-House
801e66352e Sync ruby/mmtk into the gc/mmtk directory 2024-11-21 21:09:55 +00:00
Adam Daniels
3b5b34e3ae [rubygems/rubygems] Set $0 to exe when running gem exec to fix name in CLI output
The $0 value is used in many CLI libraries to determine the name of the
application, when displaying help and error messages.

Without setting this value, it defaults to `gem` which can be confusing.

Before:

```
$ gem exec kamal help
Commands:
  gem accessory           # Manage accessories (db/redis/search)
  gem app                 # Manage application
  gem audit               # Show audit log from servers
  gem build               # Build application image
  gem config              # Show combined config (including secrets!)
  gem deploy              # Deploy app to servers
  gem details             # Show details about all containers
  gem docs [SECTION]      # Show Kamal configuration documentation
  gem help [COMMAND]      # Describe available commands or one specific command
  gem init                # Create config stub in config/deploy.yml and secrets stub in .kamal
  gem lock                # Manage the deploy lock
  gem proxy               # Manage kamal-proxy
  gem prune               # Prune old application images and containers
  gem redeploy            # Deploy app to servers without bootstrapping servers, starting kamal-proxy, pruning, and registry login
  gem registry            # Login and -out of the image registry
  gem remove              # Remove kamal-proxy, app, accessories, and registry session from servers
  gem rollback [VERSION]  # Rollback app to VERSION
  gem secrets             # Helpers for extracting secrets
  gem server              # Bootstrap servers with curl and Docker
  gem setup               # Setup all accessories, push the env, and deploy app to servers
  gem upgrade             # Upgrade from Kamal 1.x to 2.0
  gem version             # Show Kamal version
```

After:

```
$ gem exec kamal help
Commands:
  kamal accessory           # Manage accessories (db/redis/search)
  kamal app                 # Manage application
  kamal audit               # Show audit log from servers
  kamal build               # Build application image
  kamal config              # Show combined config (including secrets!)
  kamal deploy              # Deploy app to servers
  kamal details             # Show details about all containers
  kamal docs [SECTION]      # Show Kamal configuration documentation
  kamal help [COMMAND]      # Describe available commands or one specific command
  kamal init                # Create config stub in config/deploy.yml and secrets stub in .kamal
  kamal lock                # Manage the deploy lock
  kamal proxy               # Manage kamal-proxy
  kamal prune               # Prune old application images and containers
  kamal redeploy            # Deploy app to servers without bootstrapping servers, starting kamal-proxy, pruning, and registry login
  kamal registry            # Login and -out of the image registry
  kamal remove              # Remove kamal-proxy, app, accessories, and registry session from servers
  kamal rollback [VERSION]  # Rollback app to VERSION
  kamal secrets             # Helpers for extracting secrets
  kamal server              # Bootstrap servers with curl and Docker
  kamal setup               # Setup all accessories, push the env, and deploy app to servers
  kamal upgrade             # Upgrade from Kamal 1.x to 2.0
  kamal version             # Show Kamal version
```

4fd060b96d
2024-11-21 20:41:30 +00:00
Jerome Dalbert
8ea349515a Ensure that all Bundler commands have a man page
Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
2024-11-21 20:34:01 +00:00
Kunshan Wang
8ae7c22972 Annotate anonymous mmap
Use PR_SET_VMA_ANON_NAME to set human-readable names for anonymous
virtual memory areas mapped by `mmap()` when compiled and run on Linux
5.17 or higher.  This makes it convenient for developers to debug mmap.
2024-11-21 13:48:05 -05:00
Matt Valentine-House
640bacceb1 Fix typo in parse.y GH Actions workflow
with-praser -> with-parser
2024-11-21 14:49:00 +00:00
Matt Valentine-House
680e060026 [prism/compiler] end_cursor should never be NULL
This fixes a failed assertion reported to SimpleCov

https://github.com/simplecov-ruby/simplecov/issues/1113

This can be repro'd as follows:

1. Create a file `test.rb` containing the following code

```
@foo&.(@bar)
```

2. require it with branch coverage enabled

```
ruby -rcoverage -e "Coverage.start(branches: true); require_relative 'test.rb'"
```

The assertion is failing because the Prism compiler is incorrectly
detecting the start and end cursor position of the call site for the
implicit call .()

This patch replicates the parse.y behaviour of setting the default
end_cursor to be the final closing location of the call node.

This behaviour can be verified against `parse.y` by modifying the test
command as follows:

```
ruby --parser=parse.y -rcoverage -e "Coverage.start(branches: true); require_relative 'test.rb'"
```

[Bug #20866]
2024-11-21 13:51:59 +00:00
Jerome Dalbert
890c83e607 [rubygems/rubygems] Fix bundle remove sometimes not removing gems
e7f5f067e8
2024-11-21 12:25:31 +00:00
David Rodríguez
ac5661db7b [rubygems/rubygems] Fix locking of incorrect version of git gem in an edge case
In particular, when a gem registry transitive dependency is changed to a
git source direct dependency.

bcdc7660d9
2024-11-21 10:37:51 +00:00
David Rodríguez
486485a535 [rubygems/rubygems] Refactor
9964c16bb9
2024-11-21 10:37:51 +00:00
David Rodríguez
0a7099a0ae [rubygems/rubygems] Extract a source local
c5a9449069
2024-11-21 10:37:50 +00:00
David Rodríguez
8cf1222e56 [rubygems/rubygems] Reuse name local
508fb45b76
2024-11-21 10:37:50 +00:00
David Rodríguez
335ef5ed81 [rubygems/rubygems] Remove no longer necessary code
2a36af0f38
2024-11-21 10:37:49 +00:00
Lars Kanis
796757a01c [rubygems/rubygems] Remove override of worker jobs for bundle install --local
There seems to be no reason why the install should be serial for --local.
The packages are still installed in the right dependency order in this case, so that parallel install can be used.
This patch disables parallel install only in case of no_install_needed.

Also remove the `option` argument, which is effectifely not used.

5da934ddb6
2024-11-21 10:35:58 +00:00
sodacris
42b0d46416 [rubygems/rubygems] move system_gems let commands
1fc1e74f4d
2024-11-21 10:29:32 +00:00
Yusuke Endoh
cabfaa9fb4 Extend the timeout of fork-exit bootstraptest
It often fails randomly.

http://ci.rvm.jp/results/trunk-yjit@ruby-sp2-noble-docker/5421564
```
 Fstderr output is not empty
   bootstraptest.test_fork.rb_78_287.rb:16:in 'block in <main>': failed (RuntimeError)
           from <internal:numeric>:257:in 'Integer#times'
           from bootstraptest.test_fork.rb_78_287.rb:10:in '<main>'
```

I'm not sure why the frequency of failure has suddenly increased,
though.
2024-11-21 04:23:15 -06:00
Hiroshi SHIBATA
b85425493a Omit flaky example with Windows platform
3330566428

```
  IO#wait [events, timeout] passed changes thread status to 'sleep' when waits for WRITABLE event FAILED
  Expected false == "sleep"
  to be truthy but was false
  D:/a/ruby/ruby/src/spec/ruby/library/io-wait/wait_spec.rb:99:in 'block (3 levels) in <top (required)>'
  D:/a/ruby/ruby/src/spec/ruby/library/io-wait/wait_spec.rb:8:in '<top (required)>'
```
2024-11-21 19:16:27 +09:00
Hiroshi SHIBATA
6fc8607b7a Skip make install with gmp build 2024-11-21 18:46:27 +09:00
Naoto Ono
c23bf42d79 Fix error "fatal: detected dubious ownership in repository at '/github/workspace/src'" 2024-11-21 16:59:14 +09:00
Hiroshi SHIBATA
0780e76803 Removed needless require for build_metadata 2024-11-21 15:32:12 +09:00
Yusuke Endoh
d43f796292 Fix the usage of realloc
http://ci.rvm.jp/results/trunk-repeat50@ruby-sp2-noble-docker/5420911
```
/tmp/ruby/src/trunk-repeat50/ext/socket/ipsocket.c: In function ‘reallocate_connection_attempt_fds’:
/tmp/ruby/src/trunk-repeat50/ext/socket/ipsocket.c:292:62: warning: pointer ‘fds’ may be used after ‘realloc’ [-Wuse-after-free]
  292 |     for (int i = current_capacity; i < new_capacity; i++) fds[i] = -1;
      |                                                              ^
/tmp/ruby/src/trunk-repeat50/ext/socket/ipsocket.c:288:9: note: call to ‘realloc’ here
  288 |     if (realloc(fds, new_capacity * sizeof(int)) == NULL) {
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
2024-11-21 00:20:11 -06:00
Hiroshi SHIBATA
f20b6e5dbc [rubygems/rubygems] Explicitly load build_metadata.rb because Spec::BuildMetadata is only called from BundlerBuilder.
The current code is broken to call Spec::Builders#build_* method directly.

4922ae40dd
2024-11-21 04:39:31 +00:00
dependabot[bot]
7f838e3763 Bump github/codeql-action from 3.27.4 to 3.27.5
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.4 to 3.27.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](ea9e4e3799...f09c1c0a94)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-21 13:23:10 +09:00
Hiroshi SHIBATA
af54f0f76d [rubygems/rubygems] Silent verbose stdout for dependency of test gems
51854e1982
2024-11-21 02:13:07 +00:00
Samuel Williams
89deb38736
bignum nogvl is offload safe. (#12132) 2024-11-21 13:46:27 +13:00
Samuel Williams
03ff7db5fe
Update scheduler.c to use RUBY_ASSERT. (#12129) 2024-11-20 23:00:55 +00:00
Alan Wu
bf718cef59
YJIT: Make compilation_failure a default stat (#12128)
It's good to monitor compilation failures.
2024-11-20 17:13:31 -05:00
Samuel Williams
f6e6e66870 [ruby/zlib] Add support for safe offload of nogvl code.
(https://github.com/ruby/zlib/pull/89)

a535271862
2024-11-20 21:40:55 +00:00
Samuel Williams
b143fd5bd8 [ruby/zlib] Don't call rb_str_set_len while released the GVL.
(https://github.com/ruby/zlib/pull/88)

* Only release the GVL where necessary.

- Several string manipulation methods were invoked while the GVL was
  released. This is unsafe.
- The mutex protecting multi-threaded access was not covering buffer state
  manipulation, leading to data corruption and out-of-bounds writes.
- Using `rb_str_locktmp` prevents changes to buffer while it's in use.

[Bug #20863]

e445cf3c80
2024-11-20 21:02:16 +00:00
Samuel Giddins
b70c1bb150 [rubygems/rubygems] Add --attestation option to gem push
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

a5412d9a0e
2024-11-20 19:32:49 +00:00
Andrew Nesbitt
b4969348bf [rubygems/rubygems] Add man page for 'bundle issue' command
3f39571181
2024-11-20 19:13:27 +00:00
Stan Lo
51bf0d4d68 [ruby/irb] Store method objects in constants
(https://github.com/ruby/irb/pull/1033)

It probably won't speed up things significantly, but these are hot paths
and we can save a few method calls per completion/input call.

f1e25ec7ae
2024-11-20 18:59:26 +00:00
Thierry Deo
2bf5d26eb9 [ruby/psych] Eagerly require date.
b2aa0032c0
2024-11-20 16:59:55 +00:00
Nobuyoshi Nakada
577e6a3e19 [ruby/etc] Prefer rb_intern_const over rb_intern for literal strings
53362d891c
2024-11-20 16:38:33 +00:00
Peter Zhu
41a9460227 [DOC] Fix typo in comment for STR_PRECOMPUTED_HASH 2024-11-20 11:16:10 -05:00