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

72615 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada b249178398 Install gems `lib` directory to build path 2022-07-14 09:00:13 +09:00
Nobuyoshi Nakada a2c66f52f4 Make dependency-free gemspec files
The default gems have not been installed yet in the build directory,
bundled gems depending on them can not work.  As those dependencies
should be usable there even without rubygems, make temporary gemspec
files without the dependencies, and use them in the build directory.
2022-07-14 09:00:13 +09:00
Nobuyoshi Nakada e1a4e44f14 Extract gemspec files to each gem directories
Since extension libraries can not be built in the source directory,
rubygems warns gems have extension libraries as the extensions are not
built.  To order to suppress this warnings, extract such gemspec files
under each gem directories instead of the common `specifications`
directory.
2022-07-14 09:00:13 +09:00
David Rodríguez 8c74eaa08d [rubygems/rubygems] Fix `gem update --system` crash while regenerating binstubs
Since a few commits ago, we no longer call `Gem::Specification.reset`
after each invocation of `Gem::Installer#install`. This means we don't
call it when the default Bundler is installed during `gem update
--system`. This causes no issues until the end of the upgrade process
when:

* The previous default Bundler spec is removed from disk.
* All specification stubs are turned into real specifications by loading
  them from disk. But the one for Bundler no longer exists so
  materializes to `nil` and regenerating binstubs crashes like this:

  ```
  Bundler 2.4.0.dev installed
  RubyGems 3.4.0.dev installed
  Regenerating binstubs
  ERROR:  While executing gem ... (NoMethodError)
      undefined method `platform' for nil:NilClass
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/commands/pristine_command.rb:116:in `block in execute'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:981:in `block in each'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:980:in `each'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:980:in `each'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/commands/pristine_command.rb:116:in `map'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/commands/pristine_command.rb:116:in `each'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/commands/pristine_command.rb:116:in `select'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/commands/pristine_command.rb:116:in `execute'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/command.rb:323:in `invoke_with_build_args'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/command.rb:301:in `invoke'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/commands/setup_command.rb:604:in `regenerate_binstubs'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/commands/setup_command.rb:183:in `execute'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/command.rb:323:in `invoke_with_build_args'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/command_manager.rb:185:in `process_args'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/command_manager.rb:149:in `run'
    /Users/deivid/Code/rubygems/rubygems/lib/rubygems/gem_runner.rb:51:in `run'
  setup.rb:33:in `<main>'
  ```

We fix it by more carefully managing the removal of the previous default
Bundler gem.

https://github.com/rubygems/rubygems/commit/9989f6d5af
2022-07-14 04:47:58 +09:00
Jean Boussier 664c23db79 GVL Instrumentation: remove the EXITED count assertion
It's very flaky for some unknown reason. Something we have
an extra EXITED event. I suspect some other test is causing this.
2022-07-13 19:39:31 +02:00
git 13d2ae6d4a * 2022-07-14 [ci skip] 2022-07-14 00:44:39 +09:00
Burdette Lamar 081bd061a8
[DOC] Correct call-seq directive in string.c (#6131)
Correct call-seq directive in string.c
2022-07-13 10:44:22 -05:00
Nobuyoshi Nakada d5c5fcb80a
Bundled gem extensions are out of scope of update-deps 2022-07-13 22:14:30 +09:00
Jean Boussier 8290d76647 [ruby/timeout] Give a name to the background thread
https://github.com/ruby/timeout/commit/5594ae2f4d
2022-07-13 21:16:15 +09:00
Jean Boussier 268269687c thread/test_instrumentation_api: cleanup all existing threads in setup
We saw the following failure:
```
TestThreadInstrumentation#test_thread_instrumentation [/tmp/ruby/v3/src/trunk-random3/test/-ext-/thread/test_instrumentation_api.rb:25]:
Expected 0..3 to include 4.
```

Which shouldn't happen unless somehow there was a leaked thread.
2022-07-13 14:13:41 +02:00
Yusuke Endoh c4e2973733 Fix a typo (thanks @Maumagnaguagno !) 2022-07-13 16:09:11 +09:00
Yusuke Endoh 1fe6c92603 Specify usable escape sequences in Exception#detailed_message
An error message is primarily rendered in a terminal emulator, but is
also shown in a browser by converting it to a HTML fragment.
However, the conversion would be unreasonably difficult if the message
includes any escape sequence (such as cursor move or screen clear).

This change adds a guideline about escape sequences in
`Exception#detailed_message`:

* Use widely-supported escape sequences: bold, underline, and basic
  eight foreground colors (except white and black).
* Make the message readable if all escape sequences are ignored.
2022-07-13 16:09:11 +09:00
git 1052ad4e48 Update bundled gems list at 156da55c16 [ci skip] 2022-07-13 06:46:52 +00:00
Koichi Sasada 156da55c16 debug.gem 1.6.1 2022-07-13 15:46:19 +09:00
Hiroshi SHIBATA 437a5ae9d6 Merge RubyGems and Bundler master 2022-07-13 14:11:55 +09:00
Burdette Lamar e3a988a29c
[DOC] Revisions for call-seq in doc guidelines (#6121)
Splits certain guidelines for singleton and instance method.
    Calls for instance method to not prefix anything (like RDoc itself for a Ruby-coded instance method); e.g.:
        count -> integer, not array.count,.
        <=> other -> integer or nil, not hash <=> other -> integer or nil.
    Groups previous guidelines into Arguments, Block, Return types, Aliases.
2022-07-12 20:49:24 -05:00
Aaron Patterson de51bbcb54 Use VM Lock when mutating waiting threads list
`rb_thread_wait_for_single_fd` needs to mutate the `waiting_fds` list
that is stored on the VM.  We need to delete the FD from the list before
returning, and deleting from the list requires a VM lock (because the
list is a global).

[Bug #18816] [ruby-core:108771]

Co-Authored-By: Alan Wu <alanwu@ruby-lang.org>
2022-07-12 16:07:41 -07:00
Eileen M. Uchitelle 59c6b7b7ab
Speed up --yjit-trace-exits code (#6106)
In a small script the speed of this feature isn't really noticeable but
on Rails it's very noticeable how slow this can be. This PR aims to
speed up two parts of the functionality.

1) The Rust exit recording code

Instead of adding all samples as we see them to the yjit_raw_samples and
yjit_line_samples, we can increment the counter on the ones we've seen
before. This will be faster on traces where we are hitting the same
stack often. In a crude measurement of booting just the active record
base test (`test/cases/base_test.rb`) we found that this improved the
speed by 1 second.

This also results in a smaller marshal dump file which sped up the test
boot time by 4 seconds with trace exits on.

2) The Ruby parsing code

Previously we were allocating new arrays using `shift` and
`each_with_index`. This change avoids allocating new arrays by using an
index. This change saves us the most amount of time, gaining 11 seconds.

Before this change the test boot time took 62 seconds, after it took 47
seconds. This is still too long but it's a step closer to faster
functionality. Next we're going to tackle allowing you to collect trace
exits for a specific instruction. There is also some potential slowness
in the GC code that I'd like to take a second look at.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2022-07-12 16:40:49 -04:00
Kevin Backhouse 8c1808151f
Fix some UBSAN false positives (#6115)
* Fix some UBSAN false positives.
* ruby tool/update-deps --fix
2022-07-12 11:48:10 -07:00
Burdette Lamar 8309b1366c
[DOC] Enhanced RDoc for Time (#6118)
Treats:
    ::utc
    ::local
    #to_i
    #to_f
    #to_r
    #usec
    #nsec
    #subsec
    #<=>
    #eql?
2022-07-12 13:21:32 -05:00
git 71aec68566 * 2022-07-13 [ci skip] 2022-07-13 00:01:11 +09:00
Nobuyoshi Nakada dcbb94d5b9
Move timestamps directory for bundled gems 2022-07-13 00:00:46 +09:00
Burdette Lamar 3aee94fb91 [ruby/date] [DOC] Enhanced RDoc (https://github.com/ruby/date/pull/63)
Treats:
    #next
    #<<
    #>>
    #next_month
    #prev_month
    #next_year
    #prev_year
    #step
    #upto
    #downto

https://github.com/ruby/date/commit/4246441a35
2022-07-12 22:57:25 +09:00
Matt Valentine-House 067a5f1a00 [Feature #18901] Don't run size pool move tests without VWA 2022-07-12 08:50:33 -04:00
Matt Valentine-House 214ed4cbc6 [Feature #18901] Support size pool movement for Arrays
This commit enables Arrays to move between size pools during compaction.
This can occur if the array is mutated such that it would fit in a
different size pool when embedded.

The move is carried out in two stages:

1. The RVALUE is moved to a destination heap during object movement
   phase of compaction
2. The array data is re-embedded and the original buffer free'd if
   required. This happens during the update references step
2022-07-12 08:50:33 -04:00
Nobuyoshi Nakada 0f8a0c5f37 Refactor tests for ThreadInstrumentation counters
* Extracted some assertions.
* Assert counter values should be positive.
2022-07-12 19:43:11 +09:00
Nobuyoshi Nakada a6e2f3fd8d Use `IO.popen` to fork and exit the child process without cleanup 2022-07-12 19:43:11 +09:00
Nobuyoshi Nakada 8b98b9e274
Check only whether `RUBY_DEVEL` is defined 2022-07-12 17:13:57 +09:00
Takashi Kokubun ba8f3d2c6c
MJIT: Add assertions for mjit_capture_cc_entries
to investigate SEGVs in it
2022-07-12 00:07:38 -07:00
git e99e1f0f3f Update bundled gems list at 2022-07-12 2022-07-12 07:03:23 +00:00
Takashi Kokubun cbcc92f788
MJIT: s/assert/VM_ASSERT/
include/ruby/assert.h sets NDEBUG by default.
As MJIT CI uses -DVM_CHECK_MODE, using only VM_ASSERT might be more
helpful.
2022-07-11 23:49:13 -07:00
dependabot[bot] 6e74c5c268 [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.18 to 0.9.19.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.18...v0.9.19)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

https://github.com/rubygems/rubygems/commit/962c717083
2022-07-12 04:57:50 +09:00
dependabot[bot] ea956e5e68 [rubygems/rubygems] Bump rb-sys in /test/rubygems/test_gem_ext_cargo_builder/custom_name
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.18 to 0.9.19.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.18...v0.9.19)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

https://github.com/rubygems/rubygems/commit/186d2b83f1
2022-07-12 02:52:17 +09:00
Burdette Lamar 66dfcbed37 [ruby/irb] [DOC] Include updated help message (https://github.com/ruby/irb/pull/377)
* Include updated help message

https://github.com/ruby/irb/commit/ff129f3794
2022-07-12 00:05:15 +09:00
git b1218fd331 * 2022-07-12 [ci skip] 2022-07-12 00:02:54 +09:00
Burdette Lamar 702d4d773f [ruby/date] [DOC] Enhanced RDoc (https://github.com/ruby/date/pull/62)
Minor edits to 11 methods' documentation.

https://github.com/ruby/date/commit/00bb7f6648
2022-07-12 00:02:41 +09:00
Yusuke Endoh a871fc4d86 Fix a regression of b2e58b02ae
At that commit, I fixed a wrong conditional expression that was always
true.  However, that seemed to have caused a regression. [Bug #18906]

This change removes the condition to make the code always enabled.
It had been enabled until that commit, albeit unintentionally, and even
if it is enabled it only consumes a tiny bit of memory, so I believe it
is harmless. [Bug #18906]
2022-07-11 23:38:37 +09:00
st0012 2733c04967 [ruby/reline] Add tests for top-level dialog color APIs
https://github.com/ruby/reline/commit/347a468c59
2022-07-11 22:19:44 +09:00
Matt Valentine-House 6423d32e3b Replace use of double_heap in tests with expand_heap 2022-07-11 09:00:03 -04:00
Matt Valentine-House a6dd859aff Add expand_heap option to GC.verify_compaction_references
In order to reliably test compaction we need to be able to move objects
between size pools.

In order for this to happen there must be pages in a size pool into
which we can allocate.

The existing implementation of `double_heap` only doubled the existing
number of pages in the heap, so if a size pool had a low number of pages
(or 0) it's not guaranteed that enough space will be created to move
objects into that size pool.

This commit deprecates the `double_heap` option and replaces it with
`expand_heap` instead.

expand heap will expand each heap by enough pages to hold a number of
slots defined by `GC_HEAP_INIT_SLOTS` or by `heap->total_pags` whichever
is larger.

If both `double_heap` and `expand_heap` are present, a deprecation
warning will be shown for `double_heap` and the `expand_heap` behaviour
will take precedence

Given that this is an API intended for debugging and testing GC
compaction I'm not concerned about the extra memory usage or time taken
to create the pages. However, for completeness:

Running the following `test.rb` and using `time` on my Macbook Pro shows
the following memory usage and time impact:

pp "RSS (kb): #{`ps -o rss #{Process.pid}`.lines.last.to_i}"
GC.verify_compaction_references(double_heap: true, toward: :empty)
pp "RSS (kb): #{`ps -o rss #{Process.pid}`.lines.last.to_i}"

❯ time make run
./miniruby -I./lib -I. -I.ext/common  -r./arm64-darwin21-fake  ./test.rb
"RSS (kb): 24000"
<internal:gc>:251: warning: double_heap is deprecated and will be removed
"RSS (kb): 25232"

________________________________________________________
Executed in  124.37 millis    fish           external
   usr time   82.22 millis    0.09 millis   82.12 millis
   sys time   28.76 millis    2.61 millis   26.15 millis

❯ time make run
./miniruby -I./lib -I. -I.ext/common  -r./arm64-darwin21-fake  ./test.rb
"RSS (kb): 24000"
"RSS (kb): 49040"

________________________________________________________
Executed in  150.13 millis    fish           external
   usr time  103.32 millis    0.10 millis  103.22 millis
   sys time   35.73 millis    2.59 millis   33.14 millis
2022-07-11 09:00:03 -04:00
Takashi Kokubun fae568edbe
Use NO_JIT_DESCRIPTION only when needed
Apparently 203801566a broke YJIT's CI.
2022-07-10 23:58:19 -07:00
Takashi Kokubun 203801566a
Fix #5872 for MJIT GitHub Actions
If you run tests with RUN_OPTS=--mjit, the test fixes in
https://github.com/ruby/ruby/pull/5872 don't work.
2022-07-10 23:10:36 -07:00
Nobuyoshi Nakada da21a2c388 [ruby/rdoc] `RubyVM` is implementation dependent
https://github.com/ruby/rdoc/commit/aaeb5ce1ce
2022-07-11 13:43:15 +09:00
Nobuyoshi Nakada b564ef3698 [ruby/rdoc] Fix the known classes more
https://github.com/ruby/rdoc/commit/9f47234e0e
2022-07-11 13:43:14 +09:00
git c7dd5b65d4 * 2022-07-11 [ci skip] 2022-07-11 13:14:23 +09:00
Nobuyoshi Nakada 86df6f4bb3 [ruby/rdoc] Fix an exception class name
https://github.com/ruby/rdoc/commit/87301da71b
2022-07-11 13:14:06 +09:00
Burdette Lamar 5137af633e [ruby/date] Enhanced RDoc (https://github.com/ruby/date/pull/61)
Omit private aliases from Rdoc.

https://github.com/ruby/date/commit/48f9180663
2022-07-10 23:51:41 +09:00
Nobuyoshi Nakada ec09ba58d1
Extract `atomic_inc_wraparound` function 2022-07-10 17:56:36 +09:00
git 072a8bf760 * 2022-07-10 [ci skip] 2022-07-10 16:38:41 +09:00
Nobuyoshi Nakada b1b8172328
Add `asan_unpoisoning_object` to execute the block with unpoisoning 2022-07-10 13:11:07 +09:00