Commit graph

89871 commits

Author SHA1 Message Date
Kevin Newton
cb419e3912 [PRISM] Handle forwarding inside eval
Fixes [Bug #21031]
2025-01-14 18:41:50 -05:00
Peter Zhu
f1e32914eb [ruby/mmtk] Add mmtk_worker_count to GC.config
836a9059cb
2025-01-14 20:59:39 +00:00
Earlopain
56242ba495 Better handle regexp in the parser translator
Turns out, it was already almost correct. If you disregard \c and \M style escapes, only a single character is allowed to be escaped in a regex so most tests passed already.

There was also a mistake where the wrong value was constructed for the ast, this is now fixed.
One test fails because of this, but I'm fairly sure it is because of a parser bug. For `/\“/`, the backslash is supposed to be removed because it is a multibyte character. But tbh,
I don't entirely understand all the rules.

Fixes more than half of the remaining ast differences for rubocop tests
2025-01-14 20:33:11 +00:00
Kevin Newton
51d3d6ac8c [ruby/prism] Support forwarding flags on scopes
When parent scopes around an eval are forwarding parameters (like
*, **, &, or ...) we need to know that information when we are in
the parser. As such, we need to support passing that information
into the scopes option. In order to do this, unfortunately we need
a bunch of changes.

The scopes option was previously an array of array of strings.
These corresponded to the names of the locals in the parent scopes.
We still support this, but now additionally support passing in a
Prism::Scope instance at each index in the array. This Prism::Scope
class holds both the names of the locals as well as an array of
forwarding parameter names (symbols corresponding to the forwarding
parameters). There is convenience function on the Prism module that
creates a Prism::Scope object using Prism.scope.

In JavaScript, we now additionally support an object much the same
as the Ruby side. In Java, we now have a ParsingOptions.Scope class
that holds that information. In the dump APIs, these objects in all
3 languages will add an additional byte for the forwarding flags in
the middle of the scopes serialization.

All of this is in service of properly parsing the following code:

```ruby
def foo(*) = eval("bar(*)")
```

21abb6b7c4
2025-01-14 20:31:38 +00:00
Peter Zhu
f5fa1ee5f6 [ruby/mmtk] Exit with error message if MMTK_PLAN is invalid
79ce2008a3
2025-01-14 17:17:44 +00:00
Alan Wu
1adcd960e2 Add tests for Proc#parameters on it blocks
[Bug #20955]
2025-01-14 12:09:22 -05:00
Peter Zhu
2bcbc80fa2 [ruby/mmtk] Exit with error message if MMTK_HEAP_MODE is invalid
c8b1f4c156
2025-01-14 17:07:21 +00:00
Peter Zhu
f627e05d14 [ruby/mmtk] Add tests for when MMTK_HEAP_MIN >= MMTK_HEAP_MAX
65b34b5e86
2025-01-14 17:07:21 +00:00
Peter Zhu
e2f0769ca2 [ruby/mmtk] Also test invalid values for MMTK_HEAP_MIN and MMTK_HEAP_MAX
90f1aa8d76
2025-01-14 17:07:20 +00:00
Kevin Newton
b076e9b7ac Remove incorrectly committed snapshots 2025-01-14 11:46:11 -05:00
Peter Zhu
cf4d848cad [ruby/mmtk] Add framework for tests
6d94549fc7
2025-01-14 16:18:52 +00:00
Kevin Newton
12fa76b3e5 [ruby/prism] Fix parse.y translation for locals test
c8037dfaed
2025-01-14 16:01:46 +00:00
Earlopain
23fc0fc22d [ruby/prism] Be a bit stricter when comparing parser translator tokens
When there were more actual tokens than expected tokens, the test would still pass.

Now it's possible to receive an assertion like this:
```
expected: []
actual: [:tNL, [nil, #<Parser::Source::Range comment_single.txt 8...9>]]
<[]> expected but was
<[:tNL, [nil, #<Parser::Source::Range comment_single.txt 8...9>]]>
```

e9e9a48e43
2025-01-14 15:36:28 +00:00
Justin Collins
d0c493df7d [ruby/prism] Fix block parameters and it for RubyParser
7a93a307ac
2025-01-14 15:33:02 +00:00
Kevin Newton
da93c9ae29 [ruby/prism] Refactor serializer
8ab2532f09
2025-01-14 15:32:41 +00:00
Kevin Newton
713f31872a [ruby/prism] Freeze AST option
To make it so that you can pass `freeze: true` to Prism parse
methods and get back a deeply-frozen AST that is Ractor-
shareable.

8e6a93b2d2
2025-01-14 15:32:39 +00:00
Nobuyoshi Nakada
1758137ead Simplify gc/mmtk/extconf.rb
- Split static recipes to depend file.
- Modify makefile configurations in the block to `create_makefile`.
- Expand rust sources in extconf.rb instead of GNU make extension.

TODO: pass `CARGO_TARGET_DIR` without shell syntax.
2025-01-14 10:21:57 -05:00
Nobuyoshi Nakada
c961d093b1 [Bug #21024] <cstdbool> header has been useless
And finally deprecated at C++-17.
Patched by jprokop (Jarek Prokop).
2025-01-14 21:56:14 +09:00
Kazuki Yamaguchi
1b515d1c37 [ruby/openssl] ssl: update test_verify_hostname_on_connect for LibreSSL
This reverts the change made to this test case in commit a0e98d48c9
(Enhance TLS 1.3 support on LibreSSL 3.2/3.3, 2020-12-03).

Part of the test case was skipped on LibreSSL because LibreSSL 3.2.2
introduced a stricter check during creation of the extension. The check
was then relaxed in LibreSSL 3.4.0.

187b176ecd
2025-01-14 12:38:17 +00:00
Kazuki Yamaguchi
318519caaa [ruby/openssl] engine: remove mention of LibreSSL from OpenSSL::Engine
These paths are only reachable when it is compiled against OpenSSL.
LibreSSL 3.9 does not support ENGINE and defines OPENSSL_NO_ENGINE.

e153d6ab47
2025-01-14 12:38:17 +00:00
Kazuki Yamaguchi
731d3ec301 [ruby/openssl] ossl.c: use OPENSSL_init_ssl() and OpenSSL_version() with LibreSSL
LibreSSL 2.7.0 added support for OPENSSL_init_ssl() and
OpenSSL_version().

1328415097
2025-01-14 12:38:16 +00:00
Kazuki Yamaguchi
0fb64bda9b [ruby/openssl] Require LibreSSL 3.9 or later
Drop support for LibreSSL 3.1-3.8. LibreSSL 3.8 has reached its EOL in
2024-10.

f33d611f9f
2025-01-14 12:38:16 +00:00
Jean Boussier
4f79485889 [ruby/openssl] Refactor buffer usage to only use append_as_bytes
28f2901c48
2025-01-14 11:54:47 +00:00
Jean Boussier
2f5d31d38a [ruby/openssl] Reduce OpenSSL::Buffering#do_write overhead
[Bug #20972]

The `rb_str_new_freeze` was added in https://github.com/ruby/openssl/issues/452
to better handle concurrent use of a Socket, but SSL sockets can't be used
concurrently AFAIK, so we might as well just error cleanly.

By using `rb_str_locktmp` we can ensure attempts at concurrent write
will raise an error, be we avoid causing a copy of the bytes.

We also use the newer `String#append_as_bytes` method when available
to save on some more copies.

0d8c17aa85

Co-Authored-By: luke.gru@gmail.com
2025-01-14 11:54:47 +00:00
ydah
ccb4ba45ed Use LRAMA instead of YACC 2025-01-14 17:20:02 +09:00
ydah
eafba0d5d3 Use LRAMA instead of BISON 2025-01-14 17:20:02 +09:00
Jean Boussier
2f0741dd3c [ruby/json] Fix a method redefinition warning in C parser
Ref: https://github.com/ruby/json/pull/728
Ref: https://github.com/ruby/ruby/pull/12569

30a4a86954
2025-01-14 09:08:02 +01:00
Jean Boussier
599fbeaffa [ruby/json] Refactor JSON::Ext::Parser to split configuration and parsing state
Ref: https://github.com/ruby/json/pull/718

The existing `Parser` interface is pretty bad, as it forces to
instantiate a new instance for each document.

Instead it's preferable to only take the config and do all the
initialization needed, and then keep the parsing state on the
stack on in ephemeral memory.

This refactor makes the `JSON::Coder` pull request much easier to
implement in a performant way.

c8d5236a92

Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
2025-01-14 09:08:02 +01:00
Hiroshi SHIBATA
c8d11edcf5
Sync lockfile from rubygems/rubygems 2025-01-14 15:50:50 +09:00
Nobuyoshi Nakada
4daa5ebb77
[DOC] About create_makefile
Describe two features that were missing from the documentation:

- yields configuration part if a block is given.
- "depend" file will be included.
2025-01-14 15:34:17 +09:00
Hiroshi SHIBATA
13c868ae3e Restore lockfile for test-bundler
In the past, bundler updated platform without normalized variable like arm64-darwin-23.
We ignored that update. But the current bundler uses arm64-darwin for that.
2025-01-14 14:52:48 +09:00
Hiroshi SHIBATA
382277f9bf [ruby/yaml] We should load rubygems for optional pstore gem
d32dc11205
2025-01-14 04:36:25 +00:00
David Rodríguez
61d3f9a1a5 Remove explicit test dependency on uri
Since we now vendor uri, it does not buy us anything to include it in
the gemfile explicitly.
2025-01-14 12:24:37 +09:00
David Rodríguez
a3882dc565 Remove test dependency on logger
I think logger is only used to figure out which methods need to be made
noops in order to silence webrick during tests.

However, it seems possible to do the same using webrick's builtin logger
and the current method does not seem even correct since it's not
guaranteed that the logger gem and webrick's logger will use the same
methods.
2025-01-14 12:24:37 +09:00
David Rodríguez
78cec33958 Remove base64 as an explicit test dependency
Tests don't use it directly, so no need to specify it in our Gemfile.

I think it may have only been added because sinatra was not declaring
its dependency at the time.
2025-01-14 12:24:37 +09:00
David Rodríguez
434fa4f3fd Add basic tapioca check to CI 2025-01-14 12:24:37 +09:00
Étienne Barrié
f301383cdd Remove Generator::State#_generate
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2025-01-14 12:24:37 +09:00
David Rodríguez
1fae0d7256 Use ronn-ng again for documentation generation
We switched to nronn because ronn-ng felt abandoned, but it seems
it has activity again, so switch back.
2025-01-14 12:24:37 +09:00
Dmitrii
f1f81e8615 [ruby/fiddle] add regex for bool parsing & test struct w/ bool
parsing
(https://github.com/ruby/fiddle/pull/169)

GitHub: fix https://github.com/ruby/fiddle/pull/168

Struct parsing invokes "parse_ctype" on the whole member signature,
which fails if member type is "bool" due to plain string matching for
it. This change updates "bool" type matching to a regexp, so TYPE_BOOL
is correctly parsed for a whole signature like "bool toggle" as well as
just "bool".

---------

71607446d4

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
2025-01-14 12:24:37 +09:00
dependabot[bot]
ed0a213608 [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.105 to 0.9.107
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.105...v0.9.107)

Updates `rb-sys` from 0.9.105 to 0.9.107
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.105...v0.9.107)

---
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>

85156ce286
2025-01-14 12:24:37 +09:00
David Rodríguez
0b1b8bc3ec [rubygems/rubygems] Don't remove platform specific variants from the lockfile unless necessary
Even if they don't match the current Ruby version, they could still work
in other rubies. So it's better to keep them.

9a3e583b0c
2025-01-14 12:24:37 +09:00
David Rodríguez
5c83d09ec8 [rubygems/rubygems] Tiny parameter rename
Just for consistency, since all the other methods in this class that
receive an array of dependencies use `deps`.

eca1341950
2025-01-14 12:24:37 +09:00
David Rodríguez
ae75c8877a [rubygems/rubygems] Extract SpecSet#version_for
a76fd6d3bf
2025-01-14 12:24:37 +09:00
Joshua.LeBlanc
a0e2ed2101 [rubygems/rubygems] re-add removed pre-evaluated gemspec test
b73ee4059b
2025-01-14 12:24:37 +09:00
Josh LeBlanc
aee0277e14 [rubygems/rubygems] Serialize gemspec when caching git source
8727d44024
2025-01-14 12:24:37 +09:00
Vasily Fedoseyev
c89bcbd58e [rubygems/rubygems] Do not fail on start when cannot find writable user directory on ruby 3.4
027cdc750a
2025-01-14 12:24:37 +09:00
Ellen Marie Dash
7389ca87b3 [rubygems/rubygems] Print message when blocking on a file lock.
3ca7ef214c
2025-01-14 12:24:37 +09:00
David Rodríguez
df534ef0fc [rubygems/rubygems] Remove no longer used spec filter
I think we have consistent behavior regardless of the version of git
being used, and I'd like to keep it like that so I think we can remove
this filter.

6a708128e9
2025-01-14 12:24:37 +09:00
Nobuyoshi Nakada
d74e9ef712
CI: Make parents of PATH directories world-unwritable 2025-01-14 11:26:25 +09:00
Nobuyoshi Nakada
8891890bff
Mark rb_path_check as internal only 2025-01-14 11:26:29 +09:00