85261 Commits

Author SHA1 Message Date
Peter Zhu
95d036aaf0 Fix memory leak in ruby_parser
For example:

    10.times do
      100_000.times do
        eval("")
      end

      puts `ps -o rss= -p #{$$}`
    end

Before:

    19872
    26480
    32848
    39504
    45904
    52672
    59200
    65760
    72128
    78496

After:

    17328
    20752
    23664
    28400
    30656
    34224
    37424
    40784
    43328
    46656
2024-04-29 14:04:42 -04:00
Kevin Newton
d75bbba255 [PRISM] Remove false positive compile warnings for branch coverage 2024-04-29 13:28:15 -04:00
git
90db9c87a3 Update default gems list at dbb1ba88ebb5a08ea5a856c8086aa2 [ci skip] 2024-04-29 13:36:59 +00:00
Mari Imaizumi
dbb1ba88eb [ruby/reline] Bump version to 0.5.4
(https://github.com/ruby/reline/pull/691)

https://github.com/ruby/reline/commit/3f27286a5e
2024-04-29 13:35:59 +00:00
tomoya ishida
814d4b5e2c [ruby/reline] Input with eof and no newline bugfix
(https://github.com/ruby/reline/pull/671)

https://github.com/ruby/reline/commit/0d66c335a1
2024-04-29 13:23:03 +00:00
yui-knk
4c41203bbb Remove needless header file include 2024-04-29 21:26:44 +09:00
tomoya ishida
ae701031f5 [ruby/reline] Completely support full-width characters in
differential rendering
(https://github.com/ruby/reline/pull/654)

* Add a cut variation of Reline::Unicode.take_range method take_mbchar_range

* Consider fullwidth take_range in differential rendering

https://github.com/ruby/reline/commit/29714df09f
2024-04-29 12:08:59 +00:00
Mari Imaizumi
018c5717e5 [ruby/reline] Handle mode condition in inputrc
(https://github.com/ruby/reline/pull/687)

https://github.com/ruby/reline/commit/bed5fb3d77
2024-04-29 12:05:36 +00:00
David Rodriguez
435f449b4e [rubygems/rubygems] Make sure to force latest resolvable version explicitly
To make sure we can always update to the latest resolvable version for
each gem explicitly requested for update, we first run a full update,
and then add explicit exact requirements to the resolved versions. This
may lead into conflicts, but our resolver already automatically parses
those and unlocks additional gems to fix them.

https://github.com/rubygems/rubygems/commit/01c0bf34f0
2024-04-29 10:29:29 +00:00
David Rodríguez
491195af02 [rubygems/rubygems] Keep track of gems requested for update explicitly
https://github.com/rubygems/rubygems/commit/ea43e4c6d7
2024-04-29 10:29:28 +00:00
David Rodriguez
83933f921b [rubygems/rubygems] No need to reset version promoter here
Since resolution options don't change.

https://github.com/rubygems/rubygems/commit/5c5aa38c06
2024-04-29 10:29:28 +00:00
David Rodríguez
53571de8e9 [rubygems/rubygems] Fix circular require warning
https://github.com/rubygems/rubygems/commit/241d0aafcd
2024-04-29 09:04:33 +00:00
David Rodríguez
d6cb62a88f [rubygems/rubygems] Show better error when installed gemspecs are unreadable
https://github.com/rubygems/rubygems/commit/924f87c8a9
2024-04-29 08:57:35 +00:00
David Rodríguez
68a1867f53 [rubygems/rubygems] Fix issue with bundle update with an out of sync lockfile
An old platform related bug fix made some existing lockfiles no longer
work because they included invalid platforms. So to make it backwards
compatible, code was added to remove invalid platforms from the lockfile
before resolution. This is skipped though when Gemfile has changed
dependencies because in that case we will be re-resolving anyways.
However, in the `bundle update` case, the detection of "dependencies
have changed" was not actually working making Bundler remove all
platforms and not be able to resolve.

https://github.com/rubygems/rubygems/commit/6452adfd62
2024-04-29 08:56:55 +00:00
Andy Waite
6203307f16 [rubygems/rubygems] Address PR feedback
https://github.com/rubygems/rubygems/commit/62be097a32
2024-04-29 08:42:07 +00:00
Andy Waite
2a683f3f7d [rubygems/rubygems] Clarify bundle check behaviour in docs
https://github.com/rubygems/rubygems/commit/c438c6db2e
2024-04-29 08:42:07 +00:00
yui-knk
5ed2064419 Lrama v0.6.8 2024-04-29 15:09:26 +09:00
卜部昌平
b7bd55cdc7 suppress -Wold-style-cast warnings 2024-04-29 03:09:15 +02:00
卜部昌平
17a0e2ac04 workaround C++ compile error
We observe compiler error on FreeBSD.  Their stdckdint.h does not
understand C++.  This shall be addressed on their side.  Unti then we
resport to our own version.

https://rubyci.s3.amazonaws.com/freebsd14/ruby-master/log/20240427T143002Z.log.html.gz
2024-04-29 03:03:50 +02:00
Nobuyoshi Nakada
a6308ca958 ripper: Move DSL line pattern 2024-04-29 08:38:23 +09:00
ydah
f9cf923af2 Use user defined parameterizing rules 2024-04-29 08:38:23 +09:00
yui-knk
29aaf4abe6 Remove ast_new field from struct rb_parser_config_struct
`ast_new` can be embedded into `rb_ast_new`.
2024-04-28 17:58:57 +09:00
yui-knk
5c3d5c7cdd Lrama v0.6.7 2024-04-28 13:38:36 +09:00
HASUMI Hitoshi
ddd8da4b6b [Universal parser] Improve AST structure
This patch moves `ast->node_buffer->config` to `ast->config` aiming to improve readability and maintainability of the source.

## Background

We could not add the `config` field to the `rb_ast_t *` due to the five-word restriction of the IMEMO object.
But it is now doable by merging https://github.com/ruby/ruby/pull/10618

## About assigning `&rb_global_parser_config` to `ast->config` in `ast_alloc()`

The approach of not setting `ast->config` in `ast_alloc()` means that the client, CRuby in this scenario, that directly calls `ast_alloc()` will be responsible for releasing it if a resource that is passed to AST needs to be released.

However, we have put on hold whether we can guarantee the above so far, thus, this patch looks like that.

```
// ruby_parser.c
static VALUE
ast_alloc(void)
{
    rb_ast_t *ast;
    VALUE vast = TypedData_Make_Struct(0, rb_ast_t, &ast_data_type, ast);
#ifdef UNIVERSAL_PARSER
    ast = (rb_ast_t *)DATA_PTR(vast);
    ast->config = &rb_global_parser_config;
#endif
    return vast;
}
```
2024-04-28 12:08:21 +09:00
ydah
8ad0b2cd31 Use ' '+ instead of words_sep 2024-04-28 09:01:49 +09:00
Nobuyoshi Nakada
937cb1176d
Fix regexps for abbreviated options 2024-04-28 00:06:24 +09:00
Nobuyoshi Nakada
a0b4f0bcc9
Timeout scale in bootstraptest 2024-04-28 00:03:09 +09:00
Nobuyoshi Nakada
602193ded7
Timeout in bootstraptest 2024-04-28 00:02:33 +09:00
卜部昌平
c844968b72 ruby tool/update-deps --fix 2024-04-27 21:55:28 +09:00
卜部昌平
bb5a538207 use of stdckdint.h
C23 is going to have this header.  The industry is already moving
towards accepting it; OSes and compilers started to implement theirs.

Why not detect its presence and if any, prefer over other ways.

See also:

- https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2683.pdf
- https://reviews.freebsd.org/D41734
- https://reviews.llvm.org/D157331
- https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8441841a1b985d68245954af1ff023db121b0635
2024-04-27 21:55:28 +09:00
HASUMI Hitoshi
9ea77cb351 Remove unnecessary assignment to ast->body.line_count
This patch removes a code that assigns `-1` to `ast->body.line_count` because, at least as of now, it looks not necessary.
I made this commit atomically revertable if I was wrong.

## Relevant commits

- The preparation for this PR: https://github.com/ruby/ruby/pull/10655/files#diff-2af2e7f2e1c28da5e9d99ad117cba1c4dabd8b0bc3081da88e414c55c6aa9549R1484-R1493
- The original commit that introduced the code: d65f7458bc
2024-04-27 17:56:20 +09:00
jinroq
ef3e3e9a2f
Fixed a value specified for OPT_THREADED_CODE (#10657)
Values defined for OPT_THREADED_CODE are 0,1,2. However, 1,2,3 are set in workflow. It seems that case 3 does not exist, so 0 is specified instead.

Co-authored-by: jinroq <jinroq@users.noreply.github.com>
2024-04-26 20:47:45 -07:00
Takashi Kokubun
8089faee45 Revert "YJIT: Try splitting getlocal/setlocal blocks (#10648)"
This reverts commit ab228bd0844758a1c444e39030c153874adf9120.
2024-04-26 20:43:22 -07:00
HASUMI Hitoshi
55a402bb75 Add line_count field to rb_ast_body_t
This patch adds `int line_count` field to `rb_ast_body_t` structure.
Instead, we no longer cast `script_lines` to Fixnum.

## Background

Ref https://github.com/ruby/ruby/pull/10618

In the PR above, we have decoupled IMEMO from `rb_ast_t`.
This means we could lift the five-words-restriction of the structure
that forced us to unionize `rb_ast_t *` and `FIXNUM` in one field.

## Relating refactor

- Remove the second parameter of `rb_ruby_ast_new()` function

## Attention

I will remove a code that assigns -1 to line_count, in `rb_binding_add_dynavars()`
of vm.c, because I don't think it is necessary.
But I will make another PR for this so that we can atomically revert
in case I was wrong (See the comment on the code)
2024-04-27 12:08:26 +09:00
yui-knk
bf1f16ef47 Lrama v0.6.6 2024-04-27 10:06:09 +09:00
Alan Wu
2ba7c1b142 YJIT: Correct signature of rb_yjit_root_mark()
Even though unused, it's supposed to take a pointer like the C side
expects.
2024-04-26 18:03:26 -07:00
Alan Wu
83c03cc73a YJIT: Stop asserting rb_objspace_markable_object_p()
Because of the way things are sequenced, it doesn't work properly during
auto-compaction.
2024-04-26 18:03:26 -07:00
Alan Wu
73eeb8643b YJIT: Fix reference update for Invariants::no_ep_escape_iseqs
Previously, the update was done in the ISEQ callback. That effectively
never updated anything because the callback itself is given an intact
reference, so it could update its content, and `rb_gc_location(iseq)`
never returned a new address. Update the whole table once in the YJIT
root instead.
2024-04-26 18:03:26 -07:00
Takashi Kokubun
c746332c79 Revert "Use -v to investigate which test is stuck"
This reverts commit 444553b528a54a97e539de212ffc4c6466a6db20.

At least it should no longer timeout.
2024-04-26 17:35:52 -07:00
Takashi Kokubun
c32366ff79 Avoid overriding GNUMAKEFLAGS's -j
.github/actions/setup/directories/action.yml sets GNUMAKEFLAGS. Having
-j here is rather harmful.

Partly reverts f8dad616c2ee2d83b3162da8d86865b0f2a782de.
2024-04-26 17:18:49 -07:00
Peter Zhu
f64c97418b Allow RUBY_GC_LIBRARY_PATH to be set in miniruby
miniruby is used by tool/runruby.rb, so we need to ensure we don't rb_bug
when RUBY_GC_LIBRARY_PATH is set so we can run tests using the make
commands. This commit changes it to warn instead.
2024-04-26 17:02:08 -04:00
git
392b811baf Update default gems list at 3872e54039f467cdab5c9a0e384d91 [ci skip] 2024-04-26 21:01:55 +00:00
Kevin Newton
ddce8ca831 [PRISM] Enable integer test 2024-04-26 17:01:13 -04:00
Kevin Newton
3872e54039 [ruby/prism] Bump to v0.27.0
https://github.com/ruby/prism/commit/c9edeef91a
2024-04-26 17:01:03 -04:00
Kevin Newton
bb3dd5b808 [PRISM] Sync latest config.yml documentation updates 2024-04-26 17:01:03 -04:00
Peter Zhu
41e17f5624 Fix compiler warning for ruby_external_gc_init
Fixes:

    warning: old-style function definition [-Wold-style-definition]
2024-04-26 16:58:20 -04:00
Takashi Kokubun
ab228bd084
YJIT: Try splitting getlocal/setlocal blocks (#10648) 2024-04-26 13:02:22 -07:00
Kevin Newton
46480e3042 [PRISM] Use redundant return flag 2024-04-26 15:16:58 -04:00
Kevin Newton
9688093124 [ruby/prism] Location#slice_lines, Node#slice_lines
https://github.com/ruby/prism/commit/9b61f6fdb3
2024-04-26 19:05:32 +00:00
Kevin Newton
0599184a18 [ruby/prism] Match CRuby error messages for invalid numerics
https://github.com/ruby/prism/commit/be21a1bd1d
2024-04-26 18:55:27 +00:00