82556 Commits

Author SHA1 Message Date
Hiroshi SHIBATA
ea31461ba0 [rubygems/rubygems] bin/rubocop -A --only Style/StringLiterals
https://github.com/rubygems/rubygems/commit/f25013bcc0
2024-01-11 13:51:52 +09:00
Hiroshi SHIBATA
443e417885 [rubygems/rubygems] bin/rubocop -A --only Style/RedundantParentheses
https://github.com/rubygems/rubygems/commit/7cc647c8f3
2024-01-11 13:51:52 +09:00
Hiroshi SHIBATA
ff0119354e [rubygems/rubygems] bin/rubocop -A --only Performance/StringInclude
https://github.com/rubygems/rubygems/commit/34df962cf4
2024-01-11 13:51:52 +09:00
Kenta Murata
08e22c64b3 [rubygems/rubygems] Use cache_home instead of data_home in default_spec_cache_dir
https://github.com/rubygems/rubygems/commit/d2801fcfde
2024-01-11 04:21:38 +00:00
Cody Cutrer
94e1d3f3fa [rubygems/rubygems] include MatchMetadata in Bundler::LazySpecification
I'm running into a case in my plugin where matches_current_metadata? is
getting called on a lazy specification, and adding this fixes it

https://github.com/rubygems/rubygems/commit/24f962cb42
2024-01-11 04:19:13 +00:00
Yusuke Endoh
1bd98c820d Remove setaffinity of pthread for getaddrinfo
It looks like `sched_getcpu(3)` returns a strange number on some
(virtual?) environments.

I decided to remove the setaffinity mechanism because the performance
does not appear to degrade on a quick benchmark even if removed.

[Bug #20172]
2024-01-11 12:38:16 +09:00
S-H-GAMELINKS
a971229462 Fixed return values for some node types in nd_st_key function 2024-01-11 12:26:30 +09:00
KJ Tsanaktsidis
76a8c963c7 Add a test for what happens with concurent calls to waitpid
Ruby 3.1 and 3.2 have a bug in their _implementation_, for which I'm
backporting a fix. However, the current development branch doesn't have
the issue (because the MJIT -> RJIT change refactored how waitpid worked
substantially). I do however want to commit the test which verifies
that waitpid works properly on master.

[Fixes #19387]
2024-01-11 13:12:17 +11:00
Hiroshi SHIBATA
27688b6a1d [rubygems/rubygems] Update comment for minitest helper
https://github.com/rubygems/rubygems/commit/77b0805474
2024-01-11 01:40:03 +00:00
Hiroshi SHIBATA
9f784915cd [rubygems/rubygems] bin/rubocop -A test/rubygems/helper.rb
https://github.com/rubygems/rubygems/commit/07ebc9f844
2024-01-11 01:40:02 +00:00
Hiroshi SHIBATA
bd9548810c [rubygems/rubygems] Removed redundant block
https://github.com/rubygems/rubygems/commit/d059b9ec4d
2024-01-11 01:40:01 +00:00
Brave Hager
d5e83a0601 [rubygems/rubygems] Update documentation to use squiggly heredoc
https://github.com/rubygems/rubygems/commit/4691b959ad
2024-01-11 00:51:48 +00:00
S.H
a6ba45e9b0
Remove unnecessary semicolons (#9469) 2024-01-10 16:21:55 -08:00
Jeremy Evans
ef75125271 Make defined? for op asgn expressions to constants use "assignment"
Previously, it used "expression", as that was the default.  However,
op asgn expressions to constants use the NODE_OP_CDECL, so recognize
that node type as assignement.

Fixes [Bug #20111]
2024-01-10 16:02:38 -08:00
KJ Tsanaktsidis
25f5b83689 Fix crash when printing RGENGC_DEBUG=5 output from GC
I was trying to debug an (unrelated) issue in the GC, and wanted to turn
on the trace-level GC output by compiling it with -DRGENGC_DEBUG=5.
Unfortunately, this actually causes a crash in newobj_init() because the
code there tries to log the obj_info() of the newly created object.
However, the object is not actually sufficiently set up for some of the
things that obj_info() tries to do:

* The instance variable table for a class is not yet initialized, and
  when using variable-length RVALUES, said ivar table is embedded in
  as-yet unitialized memory after the struct RValue. Attempting to read
  this, as obj_info() does, causes a crash.
* T_DATA variables need to dereference their ->type field to print out
  the underlying C type name, which is not set up until newobj_fill() is
  called.

To fix this, create a new method `obj_info_basic`, which dumps out only
the parts of the object that are valid before the object is fully
initialized.

[Fixes #18795]
2024-01-11 10:44:57 +11:00
Kevin Newton
5906f6a50e Add a GitHub workflow for prism btests 2024-01-10 15:36:19 -05:00
Kevin Newton
8333845b0b [ruby/prism] Unary symbols that cannot be binary should drop @
https://github.com/ruby/prism/commit/d139af033f
2024-01-10 20:24:31 +00:00
Peter Zhu
51061b6631 [PRISM] Don't increment argc for PM_ASSOC_SPLAT_NODE
Fixes ruby/prism#2087.
2024-01-10 13:32:19 -05:00
Alan Wu
015b0e2e1d YJIT: Fix unused warnings
```
warning: unused import: `condition::Condition`
  --> src/asm/arm64/arg/mod.rs:13:9
   |
13 | pub use condition::Condition;
   |         ^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: unused import: `rb_yjit_fix_mul_fix as rb_fix_mul_fix`
   --> src/cruby.rs:188:9
    |
188 | pub use rb_yjit_fix_mul_fix as rb_fix_mul_fix;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `rb_insn_len as raw_insn_len`
   --> src/cruby.rs:142:9
    |
142 | pub use rb_insn_len as raw_insn_len;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` on by default
```

Make asm public so it stops warning about unused public stuff in there.
2024-01-10 13:19:15 -05:00
Peter Zhu
82b57d7bfe Fix memory leak when duplicating too complex object
[Bug #20162]

Creating a ST table then calling st_replace leaks memory because the
st_replace overwrites the ST table without freeing any of the existing
memory. This commit changes it to use st_copy instead.

For example:

    RubyVM::Shape.exhaust_shapes

    o = Object.new
    o.instance_variable_set(:@a, 0)

    10.times do
      100_000.times { o.dup }

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

Before:

    23264
    33600
    42672
    52160
    61600
    71728
    81056
    90528
    100560
    109840

After:

    14752
    14816
    15584
    15584
    15664
    15664
    15664
    15664
    15664
    15664
2024-01-10 11:20:26 -05:00
Aaron Patterson
f165fa09e7 [ruby/prism] address feedback
https://github.com/ruby/prism/commit/ed183ad30c
2024-01-10 15:24:26 +00:00
Aaron Patterson
881c5a1846 [ruby/prism] Add a "repeated flag" to parameter nodes
It's possible to repeat parameters in method definitions like so:

```ruby
def foo(_a, _a)
end
```

The compiler needs to know to adjust the local table size to account for
these duplicate names.  We'll use the repeated parameter flag to account
for the extra stack space required

https://github.com/ruby/prism/commit/b443cb1f60

Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
2024-01-10 15:24:26 +00:00
Peter Zhu
8940922d18 [DOC] Improve doc for GC.latest_compact_info 2024-01-10 09:46:19 -05:00
KJ Tsanaktsidis
31371b2e24 Fix CRLF -> LF conversion on read for rb_io_fdopen & rb_file_open
When opening a file with `File.open`, and then setting the encoding with
`IO#set_encoding`, it still correctly performs CRLF -> LF conversion on
Windows when reading files with a CRLF line ending in them (in text
mode).

However, the file is opened instead with either the `rb_io_fdopen` or
`rb_file_open` APIs from C, the CRLF conversion is _NOT_ set up
correctly; it works if the encoding is not specified, but if
`IO#set_encoding` is called, the conversion stops happening. This seems
to be because the encflags never get ECONV_DEFAULT_NEWLINE_DECORATOR
set in these codepaths.

Concretely, this means that the conversion doesn't happen in the
following circumstances:
  * When loading ruby files with require (that calls rb_io_fdopen)
  * When parsing ruuby files with RubyVM::AbstractSyntaxTree (that calls
    rb_file_open).
This then causes the ErrorHighlight tests to fail on windows if git has
checked them out with CRLF line endings - the error messages it's
testing wind up with literal \r\n sequences in them because the iseq
text from the parser contains un-newline-converted strings.

This commit fixes the problem by copy-pasting the relevant snippet which
sets this up in `rb_io_extract_modeenc` (for the File.open path) into
the relevant codepaths for `rb_io_fdopen` and `rb_file_open`.

[Bug #20101]
2024-01-10 21:02:23 +11:00
git
c4051d5f43 Update bundled gems list at 1500946ce4ed7d89ed33059e3629e5 [ci skip] 2024-01-10 08:28:55 +00:00
Hiroshi SHIBATA
1500946ce4 Added mutex_m to bundled gems 2024-01-10 17:28:16 +09:00
Hiroshi SHIBATA
d16f992e1b Extract mutex_m as bundled gems 2024-01-10 17:28:16 +09:00
Nobuyoshi Nakada
e59a730477
st_index_t is not VALUE 2024-01-10 14:06:33 +09:00
Nobuyoshi Nakada
48fd311721
Constify 2024-01-10 13:49:00 +09:00
Hiroshi SHIBATA
3ecfea6075
Need newline after changes list 2024-01-10 13:43:04 +09:00
Hiroya Fujinami
8b65d15ff0
Fix test case for test_match_cache_with_peek_optimization (#9466) 2024-01-10 13:40:20 +09:00
S-H-GAMELINKS
a1949df547 Remove unnecessary semicolon and add break 2024-01-10 12:58:19 +09:00
Hiroya Fujinami
597955aae8
Fix to work match cache with peek next optimization (#9459) 2024-01-10 11:22:23 +09:00
Nobuyoshi Nakada
1817d644ee mkmf.rb: use kwargs 2024-01-10 09:18:18 +09:00
Akshay Birajdar
c06745fec9 [DOC] Enhance documentation for Array#zip 2024-01-09 14:13:20 -05:00
Kevin Newton
80da9b1547 [ruby/prism] Clarify __END__ comment
https://github.com/ruby/prism/commit/3e36d5eabc
2024-01-09 19:02:26 +00:00
Peter Zhu
55b7121358 [PRISM] Frozen string literals should be fstrings
Frozen string literals should not just be frozen, but deduplicated as an
fstring so that two string literals with the same contents are the exact
same object.

Fixes ruby/prism#2095.
2024-01-09 12:24:18 -05:00
Mark Young
7015cb2479 [ruby/abbrev] Provide a 'Changelog' link on rubygems.org/gems/abbrev
By providing a 'changelog_uri' in the metadata of the gemspec a
'Changelog' link will be shown on https://rubygems.org/gems/abbrev
which makes it quick and easy for someone to check on the changes
introduced with a new version.

Details of this functionality can be found on https://guides.rubygems.org/specification-reference/

https://github.com/ruby/abbrev/commit/9643a03ee8
2024-01-09 16:07:39 +00:00
Kevin Newton
88d7838445 [ruby/prism] Fix assertion on spanning heredocs
https://github.com/ruby/prism/commit/e190308845
2024-01-09 15:15:52 +00:00
Peter Zhu
02d8bad6e1 Fix memory leak in parser for invalid syntax
The strterm is leaked when there is invalid syntax.

For example:

    10.times do
      100_000.times do
        begin
          RubyVM::InstructionSequence.compile('private def foo = puts "Hello"')
        rescue SyntaxError
        end
      end

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

Before:

    20384
    26256
    32592
    36720
    42016
    47888
    53248
    57456
    62928
    65936

After:

    16720
    17488
    17616
    17616
    17616
    17616
    17616
    17616
    17616
    16032

Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
2024-01-09 09:41:02 -05:00
Nobuyoshi Nakada
38bc107f0b
Convert a series of else if lines to a switch 2024-01-09 18:47:15 +09:00
Hiroshi SHIBATA
149373ce7f
racc is extracted at Ruby 3.3, not 3.4 2024-01-09 17:14:55 +09:00
Takashi Kokubun
23345cc699
Add Visual Studio 2015 job on GitHub Actions (#9452)
[[Feature #19982]](https://bugs.ruby-lang.org/issues/19982)
2024-01-09 00:12:11 -08:00
Nobuyoshi Nakada
7285b165a4 outdate-bundled-gems.rb: Make platform and version options optional 2024-01-09 16:42:20 +09:00
Nobuyoshi Nakada
1288e7e962 outdate-bundled-gems.rb: Remove timestamp files for revisions to test 2024-01-09 16:42:20 +09:00
Nobuyoshi Nakada
60cd5230f6 outdate-bundled-gems.rb: Sort outputs in depth order 2024-01-09 16:42:20 +09:00
Nobuyoshi Nakada
72a78ecd33 outdate-bundled-gems.rb: Add --all option
Unless this option is given, keep other gems that may be used by
`test-bundled-gems`.
2024-01-09 16:42:20 +09:00
Nobuyoshi Nakada
bf108636df outdate-bundled-gems.rb: Add --only={all,curdir,srcdir} option 2024-01-09 16:42:20 +09:00
Nobuyoshi Nakada
963131a2d9 outdate-bundled-gems.rb: Pass platform and version explicitly
For different version baseruby, use the target platform and version
instead of the info of baseruby.
2024-01-09 16:42:20 +09:00
Nobuyoshi Nakada
8f61617a95 outdate-bundled-gems.rb: Do not clean the same directory twice 2024-01-09 16:42:20 +09:00