3683 Commits

Author SHA1 Message Date
Hiroshi SHIBATA
97e774b95d [rubygems/rubygems] Bump up to rack-3.1.15 that is removed dependency of CGI::Cookie
https://github.com/rubygems/rubygems/commit/cecc280f61
2025-05-21 11:33:33 +09:00
Hiroshi SHIBATA
cc3d304b47
[rubygems/rubygems] Try cgi-0.5.0.beta2
https://github.com/rubygems/rubygems/commit/5d5e37bf23
2025-05-14 15:13:45 +09:00
Hiroshi SHIBATA
52d72979ae
[rubygems/rubygems] Update vendored version and patch for net-http and net-http-persistent
https://github.com/rubygems/rubygems/commit/b9a4722d5e
2025-05-14 15:13:45 +09:00
Takashi Kokubun
2279da2c91
Bump the required BASERUBY version to 3.1 (#13321) 2025-05-13 13:39:45 -07:00
Hiroshi SHIBATA
f638e14838
Support to sync cgi/escape from ruby/cgi repo 2025-05-12 12:52:33 +09:00
Hiroshi SHIBATA
ab19b1f629 Use CGI 0.5.0.beta1 2025-05-09 14:27:28 +09:00
Hiroshi SHIBATA
5e1c90675e Added cgi for bundler testing. rack depends cgi/cookie.rb 2025-05-09 14:27:28 +09:00
Hiroshi SHIBATA
c667683768
Added instruction for initial setup of depend file 2025-05-09 13:51:44 +09:00
Alan Wu
aafd10616d Add an include guard for insns_info.inc
The JIT bindgens need this.
2025-05-02 23:47:57 +09:00
Hiroshi SHIBATA
69bb2b3bb2
Set is migrated to Core class 2025-05-02 09:49:15 +09:00
Yusuke Endoh
1c89b1ec60 Reset GC.stress to avoid slow coverage processing during process exit 2025-05-01 14:08:33 +09:00
Hiroshi SHIBATA
39ba16e5a1 Re-enabled repl_type_completor test with upstream fix
https://github.com/ruby/repl_type_completor/pull/62
2025-04-30 16:59:25 +09:00
Takashi Kokubun
9cdc46587d Explain a missing USE_ZJIT check on rb_vm_max_insn_name_size 2025-04-29 11:10:49 -07:00
Takashi Kokubun
0f3d6ee578
ZJIT: Disable ZJIT instructions when USE_ZJIT is 0 (#13199)
* ZJIT: Disable ZJIT instructions when USE_ZJIT is 0

* Test the order of ZJIT instructions

* Add more jobs that disable JITs

* Show instruction names in the message
2025-04-29 11:03:13 -07:00
Takashi Kokubun
58e3aa0224
ZJIT: Drop trace_zjit_* instructions (#13189) 2025-04-28 09:25:56 -07:00
Jeremy Evans
e4f85bfc31 Implement Set as a core class
Set has been an autoloaded standard library since Ruby 3.2.
The standard library Set is less efficient than it could be, as it
uses Hash for storage, which stores unnecessary values for each key.

Implementation details:

* Core Set uses a modified version of `st_table`, named `set_table`.
  than `s/st_/set_/`, the main difference is that the stored records
  do not have values, making them 1/3 smaller. `st_table_entry` stores
  `hash`, `key`, and `record` (value), while `set_table_entry` only
  stores `hash` and `key`.  This results in large sets using ~33% less
  memory compared to stdlib Set.  For small sets, core Set uses 12% more
  memory (160 byte object slot and 64 malloc bytes, while stdlib set
  uses 40 for Set and 160 for Hash).  More memory is used because
  the set_table is embedded and 72 bytes in the object slot are
  currently wasted. Hopefully we can make this more efficient and have
  it stored in an 80 byte object slot in the future.

* All methods are implemented as cfuncs, except the pretty_print
  methods, which were moved to `lib/pp.rb` (which is where the
  pretty_print methods for other core classes are defined).  As is
  typical for core classes, internal calls call C functions and
  not Ruby methods.  For example, to check if something is a Set,
  `rb_obj_is_kind_of` is used, instead of calling `is_a?(Set)` on the
  related object.

* Almost all methods use the same algorithm that the pure-Ruby
  implementation used.  The exception is when calling `Set#divide` with a
  block with 2-arity.  The pure-Ruby method used tsort to implement this.
  I developed an algorithm that only allocates a single intermediate
  hash and does not need tsort.

* The `flatten_merge` protected method is no longer necessary, so it
  is not implemented (it could be).

* Similar to Hash/Array, subclasses of Set are no longer reflected in
  `inspect` output.

* RDoc from stdlib Set was moved to core Set, with minor updates.

This includes a comprehensive benchmark suite for all public Set
methods.  As you would expect, the native version is faster in the
vast majority of cases, and multiple times faster in many cases.
There are a few cases where it is significantly slower:

* Set.new with no arguments (~1.6x)
* Set#compare_by_identity for small sets (~1.3x)
* Set#clone for small sets (~1.5x)
* Set#dup for small sets (~1.7x)

These are slower as Set does not currently use the AR table
optimization that Hash does, so a new set_table is initialized for
each call.  I'm not sure it's worth the complexity to have an AR
table-like optimization for small sets (for hashes it makes sense,
as small hashes are used everywhere in Ruby).

The rbs and repl_type_completor bundled gems will need updates to
support core Set.  The pull request marks them as allowed failures.

This passes all set tests with no changes.  The following specs
needed modification:

* Modifying frozen set error message (changed for the better)
* `Set#divide` when passed a 2-arity block no longer yields the same
  object as both the first and second argument (this seems like an issue
  with the previous implementation).
* Set-like objects that override `is_a?` such that `is_a?(Set)` return
  `true` are no longer treated as Set instances.
* `Set.allocate.hash` is no longer the same as `nil.hash`
* `Set#join` no longer calls `Set#to_a` (it calls the underlying C
   function).
* `Set#flatten_merge` protected method is not implemented.

Previously, `set.rb` added a `SortedSet` autoload, which loads
`set/sorted_set.rb`.  This replaces the `Set` autoload in `prelude.rb`
with a `SortedSet` autoload, but I recommend removing it and
`set/sorted_set.rb`.

This moves `test/set/test_set.rb` to `test/ruby/test_set.rb`,
reflecting that switch to a core class.  This does not move the spec
files, as I'm not sure how they should be handled.

Internally, this uses the st_* types and functions as much as
possible, and only adds set_* types and functions as needed.
The underlying set_table implementation is stored in st.c, but
there is no public C-API for it, nor is there one planned, in
order to keep the ability to change the internals going forward.

For internal uses of st_table with Qtrue values, those can
probably be replaced with set_table.  To do that, include
internal/set_table.h.  To handle symbol visibility (rb_ prefix),
internal/set_table.h uses the same macro approach that
include/ruby/st.h uses.

The Set class (rb_cSet) and all methods are defined in set.c.
There isn't currently a C-API for the Set class, though C-API
functions can be added as needed going forward.

Implements [Feature #21216]

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
Co-authored-by: Oliver Nutter <mrnoname1000@riseup.net>
2025-04-26 10:31:11 +09:00
Nobuyoshi Nakada
1628bbb18a
Ignore DEFAULT_SOURCE_DATE_EPOCH [ci skip]
Rubygems sets the date of built gems to `DEFAULT_SOURCE_DATE_EPOCH`
now unless `SOURCE_DATE_EPOCH` environment variable is set.  It is
just for the reproducible build, meaningless in our ChangeLog.
2025-04-22 21:45:42 +09:00
Nobuyoshi Nakada
4e6946bda7
Assign the result of format_changelog to the changelog writer
Also, rename `format_changelog` to `changelog_formatter` since this
method does not format the changelog when called, but rather returns a
Proc that takes IO and writes the formatted changelog.
2025-04-22 21:02:29 +09:00
Hiroshi SHIBATA
8bf14b048f SVN repository is already retired 2025-04-19 06:33:10 +09:00
Takashi Kokubun
8b72e07359 Disable ZJIT profiling at call-threshold (https://github.com/Shopify/zjit/pull/99)
* Disable ZJIT profiling at call-threshold

* Stop referencing ZJIT instructions in codegen
2025-04-18 21:53:01 +09:00
Takashi Kokubun
0a543daf15 Add zjit_* instructions to profile the interpreter (https://github.com/Shopify/zjit/pull/16)
* Add zjit_* instructions to profile the interpreter

* Rename FixnumPlus to FixnumAdd

* Update a comment about Invalidate

* Rename Guard to GuardType

* Rename Invalidate to PatchPoint

* Drop unneeded debug!()

* Plan on profiling the types

* Use the output of GuardType as type refined outputs
2025-04-18 21:52:59 +09:00
Takashi Kokubun
ba341883b9 Fix auto-style target reporting 2025-04-18 09:02:15 +09:00
Takashi Kokubun
3e1dae8d2a Port auto-style to GitHub Actions 2025-04-18 08:52:52 +09:00
Takashi Kokubun
8c6f250dcf Copy over bin/auto-style.rb
from ruby/git.ruby-lang.org as of:
a8635a4cd9
2025-04-18 08:52:52 +09:00
Nobuyoshi Nakada
d842554769
rbinstall.rb: Note about no_write [ci skip]
Since RubyGems 3.0.0 `dir_mode` option is supported, but using `File`
method to apply it, not `FileUtils`.  To reduce overwriting existing
methods (especially built-in class), and to record making directories,
keep using `no_write` method.
2025-04-16 15:45:08 +09:00
David Rodríguez
756479324f Sync Bundler and adapt to new spec setup 2025-04-10 19:21:51 +09:00
Hiroshi SHIBATA
9f61541f76 Re-enabled to test at win32ole 2025-04-09 15:51:08 +09:00
Hiroshi SHIBATA
d485638a08 Allow win32ole test failure
```
D:/a/ruby/ruby/src/gems/src/win32ole/test/win32ole/test_win32ole_event.rb:80:in 'TestWIN32OLE_EVENT_SWbemSink#default_handler': undefined method '+' for nil (NoMethodError)
```

https://github.com/ruby/ruby/actions/runs/14299035797/job/40072083885?pr=13078
2025-04-07 15:10:58 +09:00
Hiroshi SHIBATA
be5dea9720 Rename test command for test-unit
b7d3c32f6e
2025-04-07 15:10:58 +09:00
Nobuyoshi Nakada
eb765913c1
Console Cntl event is sent to root process sharing the console 2025-04-04 19:34:04 +09:00
Nobuyoshi Nakada
cec45aedb5
Cannot send signal to process group on Windows 2025-04-04 16:24:49 +09:00
Nobuyoshi Nakada
d22e766042
Cannot send SIGTERM to another process on Windows 2025-04-04 16:24:48 +09:00
Hiroshi SHIBATA
0dae3edb34
Also skip test_load(JSONSingletonTest) 2025-03-31 14:06:27 +09:00
Soutaro Matsumoto
3fb2006bf1
Skip RDoc tests 2025-03-31 14:06:26 +09:00
Yusuke Endoh
fc26004660 Remove test_retry_workers
The test fails randomly for unknown reason.

https://github.com/ruby/ruby/actions/runs/14121674932/job/39562945096?pr=12993
```
    1) Error:
  TestParallel::TestParallel#test_retry_workers:
  Test::Unit::ProxyError: execution expired (start: 2025-03-28 04:04:10 +0000, end: 2025-03-28 04:05:50 +0000)
      /home/runner/work/ruby/ruby/src/tool/test/testunit/test_parallel.rb:16:in 'TestParallel.timeout'
      /home/runner/work/ruby/ruby/src/tool/test/testunit/test_parallel.rb:225:in 'TestParallel::TestParallel#test_retry_workers'
```

Maybe the workers do not respond "quit" request.

We no longer use the retry mechanism, so just remove the test.
2025-03-28 14:19:33 +09:00
Yusuke Endoh
28c7ae6626 Try avoiding "invalid byte sequence in UTF-8" 2025-03-28 14:19:33 +09:00
Yusuke Endoh
12f8dda9e0 Report the actual time wated for timeout errors in TestParallel 2025-03-28 14:19:33 +09:00
Hiroshi SHIBATA
1e715bd27a Skip failing rbs tests for deprecated JSON methods 2025-03-28 12:44:53 +09:00
Hiroshi SHIBATA
d4a97ea313
Update the all of gemfile deps 2025-03-27 16:56:59 +09:00
Hartley McGuire
752a1d7854 [rubygems/rubygems] Implement pub_grub strategy interface
My application spends more than 30% of time during `bundle update`
comparing versions due to versions being sorted inside
next_package_to_try. This has been addressed in pub_grub by defining a
strategy interface (a `#next_package_and_version` method) which allows
consumers to have finer control over the heuristic to select the next
package to try.

This commit implements the new strategy interface to remove extraneous
version sorting (previously in next_package_to_try) since only the final
count of versions is used.

Combined with a previous change to pub_grub (already applied to
Bundler), this commit results in `bundle update` taking only half the
time it did on 2.6.5.

https://github.com/rubygems/rubygems/commit/62f69e27f0
2025-03-27 13:57:26 +09:00
Hiroshi SHIBATA
c6f89e263e Skip failing rbs tests for removing deprecated methods 2025-03-27 11:37:27 +09:00
Hiroshi SHIBATA
88f0c04174 Use release version of turbo_tests 2025-03-26 19:37:22 +09:00
Hartley McGuire
ee7cfb1d1e [rubygems/rubygems] Update vendored pub_grub
https://github.com/rubygems/rubygems/commit/3aaa75e7b9
2025-03-24 13:25:07 +09:00
Kevin Newton
b003d40194 Fix up merge conflicts for prism sync 2025-03-18 13:36:53 -04:00
Kevin Newton
33aaa069a4 [ruby/prism] Update truffleruby version
https://github.com/ruby/prism/commit/2afe89f8ce
2025-03-18 13:36:53 -04:00
Mari Imaizumi
4f82a6f3e8 Support for Indic_Conjunct_Break in Unicode 15.1 2025-03-18 21:18:12 +09:00
Nobuyoshi Nakada
4c072c8119 Fix assert_warning for Proc
`Proc` does not have `encoding` method.

Also, make `assert_raise_with_message` accept a `Proc` as the expected
pattern, as well.
2025-03-17 23:42:16 +09:00
Hiroshi SHIBATA
f9aadc62ed Use ghcr.io/ruby/fedora:latest instead of docker.io for avoiding rate limit 2025-03-13 13:08:15 +09:00
David Rodríguez
1a985d36a7 [rubygems/rubygems] Adapt specs to extraction of irb from ruby-core
This gets our daily Bundler CI back to green.

https://github.com/rubygems/rubygems/commit/1bb70f75d2
2025-03-10 12:43:36 +09:00
Nobuyoshi Nakada
f7af75d3d9 Show test task names longer 2025-03-06 16:58:13 +09:00