Граф коммитов

76282 Коммитов

Автор SHA1 Сообщение Дата
Eric Wong b9f90cafa1 st.c: spell `perturb' properly
Otherwise, a reader may wonder who `Peter B.' is and why
a variable is named after them...
2023-02-10 03:50:31 +00:00
Satadru Pramanik, DO, MPH, MEng 94aed6ece5 [ruby/fileutils] Add mkdir_p to FileUtils.install
(https://github.com/ruby/fileutils/pull/104)

* Add mkdir_p to FileUtils.install

* Adjust raise message.

* adjust raise language

* handle trailing slash in dest

* simplify

* Add tests
2023-02-10 03:37:39 +00:00
Mike Perham 194520f80e [ruby/logger] Add Logger#with_level{...} for block-scoped log level.
(https://github.com/ruby/logger/pull/85)

* Update lib/logger/severity.rb

https://github.com/ruby/logger/commit/7aabb0b4aa
2023-02-10 01:08:49 +00:00
Aaron Patterson b61edc5f5d Add internals glossary
I started a glossary to help new contributors navigate the internals of
CRuby, and I think we should maintain it in ruby/ruby
2023-02-09 16:59:40 -08:00
Hiroshi SHIBATA 07bf97e94f
Enhancement github releases generator
* Create GitHub Releases by itself
  * Added help and usage message
  * Decorate release body
2023-02-10 09:26:12 +09:00
Maxime Chevalier-Boisvert 2c8e4aa2a0
YJIT: format numbers in stats printouts with comma separators (#7281) 2023-02-09 17:04:45 -05:00
Maxime Chevalier-Boisvert 810aeb2d91
YJIT: optimized codegen for `rb_ary_empty_p` (WIP) (#7242)
* YJIT: add specialized implementation of rb_ary_empty_p()

* Update yjit/src/codegen.rs

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>

---------

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-02-09 15:14:26 -05:00
Matt Valentine-House d620855101 Rename rb_str_splice_{0,1} -> rb_str_update_{0,1} 2023-02-09 15:02:26 -05:00
Matt Valentine-House 601b83dcfc Remove alias macro rb_str_splice 2023-02-09 15:02:26 -05:00
eileencodes b9e6580135 Copy cvar table on clone
When a class with a class variable is cloned we need to also copy the
cvar cache table from the original table to the clone. I found this bug
while working on fixing [Bug #19379]. While this does not fix that bug
directly it is still a required change to fix another bug revealed by
the fix in https://github.com/ruby/ruby/pull/7265

This needs to be backported to 3.2.x and 3.1.x.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2023-02-09 11:24:32 -08:00
Peter Zhu 0ddf29f4d1 Remove unused preprocessor block 2023-02-09 11:38:32 -05:00
Maple Ong 381bdee118
YJIT: Support invokesuper in a block (#7264)
Support invokesuper in a block on YJIT

invokesuper previously side exited when it is in a block. To make sure we're compiling the correct method in super, we now use the local environment pointer (LEP) to get the method, which will work in a block.

Co-authored-by: John Hawthorn <john@hawthorn.email>
2023-02-09 10:41:29 -05:00
Takashi Kokubun 0601ba6a1b
YJIT: Add counter for megamorphic send (#7274) 2023-02-09 10:38:31 -05:00
Alan Wu b78f871d83
YJIT: Use the system page size when the code page size is too small (#7267)
Previously on ARM64 Linux systems that use 64 KiB pages
(`CONFIG_ARM64_64K_PAGES=y`), YJIT was panicking on boot due to a failed
assertion.

The assertion was making sure that code GC can free the last code page
that YJIT manages without freeing unrelated memory. YJIT prefers picking
16 KiB as the granularity at which to free code memory, but when the
system can only free at 64 KiB granularity, that is not possible.

The fix is to use the system page size as the code page size when the
system page size is 64 KiB. Continue to use 16 KiB as the code page size
on common systems that use 16/4 KiB pages.

Add asserts to code_gc() and free_page() about code GC's assumptions.

Fixes [Bug #19400]
2023-02-09 10:34:19 -05:00
Stan Lo 970e7cdec3 [ruby/irb] Make tests more compatible with TruffleRuby
(https://github.com/ruby/irb/pull/514)

* Improve encoding error test case

The test input IRB currently uses happen to hit a compatibility bug in
TruffleRuby, which has been documented in
https://github.com/oracle/truffleruby/issues/2848

Although it'll eventually be fixed, we can make the test case support TruffleRuby
now by tweaking it just a little bit.

Co-authored-by: Kevin Menard <kevin@nirvdrum.com>

* Remove redundant TruffleRuby omits/pends

Co-authored-by: Kevin Menard <kevin@nirvdrum.com>

* Use a different way to test warning emission

The test case was added in d08ef68d2d
to verify that IRB emits Ruby warning as expected.

But the subject it uses relies on CRuby's regexp engine, which isn't always
used in other language implementations, like TruffleRuby. That's why we
ended up skipping TruffleRuby in this test case.

Since the test isn't about regexp itself, we can change the testing subject
and just remove the special condition for TruffleRuby.

Co-authored-by: Kevin Menard <kevin@nirvdrum.com>

---------

https://github.com/ruby/irb/commit/6fdf4f3e97

Co-authored-by: Kevin Menard <kevin@nirvdrum.com>
2023-02-09 15:33:37 +00:00
Matt Valentine-House 72aba64fff Merge gc.h and internal/gc.h
[Feature #19425]
2023-02-09 10:32:29 -05:00
Takashi Kokubun e2b6289bab
YJIT: Add counters for ivar exits (#7266) 2023-02-09 10:16:17 -05:00
Nobuyoshi Nakada da4464b824
[Bug #19426] Fix endless `Range#step` with `#succ` method 2023-02-09 20:37:34 +09:00
Daniel Colson 8edd350bda [rubygems/rubygems] Avoid crashing with a corrupted lockfile
I did a bad thing (script that edits the Gemfile.lock directly) and
ended up with a Gemfile.lock that was completely missing some indirect
dependencies. While this is my fault and an error is reasonable, I
noticed that the error got progressively less friendly in recent
versions of bundler.

Something similar came up in https://github.com/rubygems/rubygems/issues/6210,
and this commit would have helped with that case as well
(although we've already handled this a different way with #6219).

Details:
---

Back on Bundler 2.2.23, a corrupt lockfile like this would cause a helpful error:

```
Unable to find a spec satisfying minitest (>= 5.1) in the set. Perhaps the lockfile is corrupted?
```

Bundler 2.3.26 gave a helpful warning:

```
Warning:
Your lockfile was created by an old Bundler that left some things out.
Because of the missing DEPENDENCIES, we can only install gems one at a time,
instead of installing 16 at a time.
You can fix this by adding the missing gems to your Gemfile, running bundle
install, and then removing the gems from your Gemfile.
The missing gems are:
* minitest depended upon by activesupport
```

But then continued on and crashed while trying to report the unmet
dependency:

```
--- ERROR REPORT TEMPLATE -------------------------------------------------------

NoMethodError: undefined method `full_name' for nil:NilClass
lib/bundler/installer/parallel_installer.rb:127:in `block (2 levels) in check_for_unmet_dependencies'

...
```

Bundler 2.4.0 and up crash as above when jobs=1, but crash
even harder when run in parallel:

```
--- ERROR REPORT TEMPLATE -------------------------------------------------------

fatal: No live threads left. Deadlock?
3 threads, 3 sleeps current:0x00007fa6b6704660 main thread:0x00007fa6b6704660
* #<Thread:0x000000010833b130 sleep_forever>
   rb_thread_t:0x00007fa6b6704660 native:0x0000000108985600 int:0

* #<Thread:0x0000000108dea630@Parallel Installer Worker #0 tmp/1/gems/system/gems/bundler-2.5.0.dev/lib/bundler/worker.rb:90 sleep_forever>
   rb_thread_t:0x00007fa6b67f67c0 native:0x0000700009a62000 int:0

* #<Thread:0x0000000108dea4a0@Parallel Installer Worker #1 tmp/1/gems/system/gems/bundler-2.5.0.dev/lib/bundler/worker.rb:90 sleep_forever>
   rb_thread_t:0x00007fa6b67f63c0 native:0x0000700009c65000 int:0

<internal:thread_sync>:18:in `pop'
tmp/1/gems/system/gems/bundler-2.5.0.dev/lib/bundler/worker.rb:42:in `deq'

...
```

Changes
---

This commit fixes the confusing thread deadlock crash by detecting if
dependencies are missing such that we'll never be able to enqueue. When
that happens we treat it as a failure so the install can finish.

That gets us back to the `NoMethodError`, which this commit fixes by
using a different warning in the case where no spec is found.

https://github.com/rubygems/rubygems/commit/d73001a21d
2023-02-09 10:29:50 +00:00
Hiroshi SHIBATA 0a8faab5c2
Avoid to duplicate entries that own redmine and github ids 2023-02-09 19:21:31 +09:00
Nobuyoshi Nakada b49cd84311 Remove `REG_LITERAL` flag
All `Regexp` literals are frozen now.
2023-02-09 19:21:24 +09:00
Hiroshi SHIBATA 5991af204c
Added helper script for generate github releases 2023-02-09 18:52:59 +09:00
Daniel Colson 728d2f808e [rubygems/rubygems] Improve wording of unmet dependencies warning
`trying to manually editing` doesn't seem quite grammatically
correct. We could change it to `trying to manually edit` (is that a
split infinitive?), but I don't think `trying to` adds much here so
I've removed it instead so `editing` is the verb.

For the list of dependencies, the wording before this commit seemed to
reverse the dependency. "B, depended on A" sounds like B depends on A
(or did in the past but doesn't anymore?), but that's not correct. I
think there's a missing word: "B, depended on by A", but I find "B,
dependency of A" a bit nicer.

https://github.com/rubygems/rubygems/commit/49a31257e3
2023-02-08 22:20:24 +00:00
Peter Zhu 861d70e383 Rename iseq_mark_and_update to iseq_mark_and_move
The new name is more consistent.
2023-02-08 12:43:25 -05:00
Nobuyoshi Nakada 6aa196149a
[DOC] Refine/fix doc/contributing/building_ruby.md [ci skip]
* Separate dependencies for RubyGems
* Add reasons of optional libraries
* Add a note for gperf and fix the required version
2023-02-08 20:15:47 +09:00
Jean Boussier 3a0f6ce1d3 Use Thread.pass until thread.stop? to wait for thread to block
[Bug #19415]

It should be more reliable
2023-02-08 11:52:59 +01:00
Nobuyoshi Nakada 63e1769b16
Add TAGS rule [ci skip] 2023-02-08 18:00:05 +09:00
Jean byroot Boussier 8ce2fb9bbb Only emit circular dependency warning for owned thread shields
[Bug #19415]

If multiple threads attemps to load the same file concurrently
it's not a circular dependency issue.

So we check that the existing ThreadShield is owner by the current
fiber before warning about circular dependencies.
2023-02-08 09:50:00 +01:00
Jean Boussier 3ab3455145 Add RUBY_GC_HEAP_INIT_SIZE_%d_SLOTS to pre-init pools granularly
The old RUBY_GC_HEAP_INIT_SLOTS isn't really usable anymore as
it initalize all the pools by the same factor, but it's unlikely
that pools will need similar sizes.

In production our 40B pool is 5 to 6 times bigger than our 80B pool.
2023-02-08 09:26:07 +01:00
Hiroshi SHIBATA 6e7990144f Removed svn feature from make-snapshot 2023-02-08 15:36:32 +09:00
Nobuyoshi Nakada a56d959ed5
Replace `PACKED_STRUCT` and `PACKED_STRUCT_UNALIGNED` 2023-02-08 12:35:27 +09:00
Nobuyoshi Nakada fefe37f98d
Replace `PACKED_STRUCT` in include 2023-02-08 12:35:27 +09:00
Nobuyoshi Nakada 899ea35035
Extract include/ruby/internal/attr/packed_struct.h
Split `PACKED_STRUCT` and `PACKED_STRUCT_UNALIGNED` macros into the
macros bellow:
* `RBIMPL_ATTR_PACKED_STRUCT_BEGIN`
* `RBIMPL_ATTR_PACKED_STRUCT_END`
* `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_BEGIN`
* `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_END`
2023-02-08 12:34:13 +09:00
Jean Boussier 1e71143976 Use more agressive RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR for GC tests 2023-02-07 22:33:12 +01:00
Jean byroot Boussier 4713b084da Revert "Revert "Consider DATA objects without a mark function as protected""
This reverts commit 6eae8e5f51.
2023-02-07 22:33:12 +01:00
Daniel Colson fd71a76f55 [rubygems/rubygems] Add Ruby 3.2 and 3.3 platforms to Gemfile DSL
Along the same lines as https://github.com/rubygems/rubygems/pull/5469,
this adds support for Ruby 3.2 and 3.3 platforms: `:ruby_32`, `mri_32`,
etc.

It also includes a spec that should help catch this earlier in the
future, failing if we don't support platforms for the version of Ruby
that is running the tests.

https://github.com/rubygems/rubygems/commit/7cd19d824d
2023-02-07 21:12:18 +00:00
git 23052e005e * remove trailing spaces. [ci skip] 2023-02-07 21:03:20 +00:00
Peter Zhu 1c0127ed5e Make Time objects WB protected
Co-Authored-By: Jean Boussier <byroot@ruby-lang.org>
2023-02-07 16:03:08 -05:00
Peter Zhu e9090eb64d Remove unused code in time.c
Co-Authored-By: Jean Boussier <byroot@ruby-lang.org>
2023-02-07 16:03:08 -05:00
Benoit Daloze 08c2094715
Fix confusing " 2023-02-07 20:30:47 +01:00
Benoit Daloze 779092508c
Add Building the Tarball section in distribution docs 2023-02-07 20:27:53 +01:00
Benoit Daloze 826067b0f9
Clarify section about getting the Ruby tarball 2023-02-07 20:22:14 +01:00
John Hawthorn 91b18dc88c Use write barriers for Backtrace objects
Backtrace objects hold references to:
* iseqs - via the captured locations
* strary - a lazily allocated array of strings
* locary - a lazily allocated array of backtrace locations

Co-authored-by: Adam Hess <HParker@github.com>
2023-02-07 11:16:50 -08:00
Peter Zhu 0ee4fec988 Fix typo in gc.h [ci skip] 2023-02-07 13:39:34 -05:00
BurdetteLamar 2c7fe9c0a6 [ruby/net-http] Enhanced RDoc for Net::HTTP
https://github.com/ruby/net-http/commit/e65a3d9f11
2023-02-07 16:01:04 +00:00
Burdette Lamar a641f6422c [ruby/net-http] [DOC] Reorganize doc for proxy server
(https://github.com/ruby/net-http/pull/117)

https://github.com/ruby/net-http/commit/f8b6b76cba
2023-02-07 14:53:38 +00:00
Jean Boussier 6eae8e5f51 Revert "Consider DATA objects without a mark function as protected"
This reverts commit 6e4c242130.
2023-02-07 15:22:06 +01:00
Peter Zhu 046807102f Use rb_gc_mark_and_move for method objects 2023-02-07 08:39:48 -05:00
Peter Zhu df2e36aeeb Use rb_gc_mark_and_move for proc and binding
Also makes VM_ENV_ENVVAL movable.
2023-02-07 08:39:48 -05:00
ima1zumi 8fc69a0a7e [ruby/reline] Add comment for unused constants
FILENAME_COMPLETION_PROC and USERNAME_COMPLETION_PROC are not used by Reline.
However, they were added for compatibility with the rb-readline gem.
These constants have been retained and comments added.

https://github.com/ruby/reline/commit/98fdbd3f18
2023-02-07 12:49:51 +00:00