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

72335 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada a343952d19
On FreeBSD omit the test to close a pipe while reading [ci skip] 2022-06-21 09:41:29 +09:00
Jeremy Evans 596f4b0d3a Document that Regexp#source does not retain lexer escapes
Related to [Feature #18838]
2022-06-20 15:56:28 -07:00
git 850b54612c * 2022-06-21 [ci skip] 2022-06-21 06:57:36 +09:00
Jun Aruga eed24b5ee0 .github/workflows/compilers.yml: annocheck: Fix gaps and notes test.
This commit fixes on the annocheck gaps and notes tests on Ubuntu focal on CI.
Added the gcc `-Wa,--generate-missing-build-notes=yes` flag.

See the links below.
* -Wa,option: <https://gcc.gnu.org/onlinedocs/gcc-11.3.0/gcc/Assembler-Options.html#Assembler-Options>.
* --generate-missing-build-notes=yes: <https://www.man7.org/linux/man-pages/man1/as.1.html>.
2022-06-21 09:38:52 +12:00
Chris Seaton 31b2cd38c5 Include JIT information in crash reports
Since enabling YJIT or MJIT drastically changes what could go wrong at
runtime, it's good to be front and center about whether they are enabled
when dumping a crash report. Previously, `RUBY_DESCRIPTION` and the
description printed when crashing can be different when a JIT is on.

Introduce a new internal data global, `rb_dynamic_description`, and set
it to be the same as `RUBY_DESCRIPTION` during initialization; use it
when crashing.

 * version.c: Init_ruby_description(): Initialize and use
       `rb_dynamic_description`.
 * error.c: Change crash reports to use `rb_dynamic_description`.
 * ruby.c: Call `Init_ruby_description()` earlier. Slightly more work
       for when we exit right after printing the description but that
       was deemed acceptable.
 * include/ruby/version.h: Talk about how JIT info is not in
      `ruby_description`.
 * test/-ext-/bug_reporter/test_bug_reporter.rb: Remove handling for
       crash description being different from `RUBY_DESCRIPTION`.
 * test/ruby/test_rubyoptions.rb: ditto

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Co-authored-by: Alan Wu <alanwu@ruby-lang.org>
2022-06-20 17:18:29 -04:00
Peter Zhu 5ca2335802 [ruby/irb] [DOC] Fix formatting in docs
https://github.com/ruby/irb/commit/3ddc89e38c
2022-06-20 22:42:30 +09:00
Stan Lo 2d4a41df6b [ruby/irb] Commands should respect `USE_COLORIZE` config (https://github.com/ruby/irb/pull/362)
https://github.com/ruby/irb/commit/534688dfc4
2022-06-20 22:27:30 +09:00
Jean Boussier c46824d094 test_instrumentation_api.rb: Allow one less exit
I suspect that sometimes on CI the last thread is prempted before eaching the exit hook
causing the test to flake. I can't find a good way to force it to run.
2022-06-20 13:03:39 +02:00
Nobuyoshi Nakada 4a6facc2d6 [Feature #18788] [DOC] String options to `Regexp.new`
Co-Authored-By: Janosch Müller <janosch.mueller@betterplace.org>
2022-06-20 19:35:12 +09:00
Nobuyoshi Nakada 883d13dc41 [Feature #18788] Spec for options as `String` to `Regexp.new`
Co-Authored-By: Janosch Müller <janosch.mueller@betterplace.org>
2022-06-20 19:35:12 +09:00
Nobuyoshi Nakada 1e9939dae2 [Feature #18788] Support options as `String` to `Regexp.new`
`Regexp.new` now supports passing the regexp flags not only as an
`Integer`, but also as a `String.  Unknown flags raise errors.
2022-06-20 19:35:12 +09:00
Nobuyoshi Nakada 39dc455b51 Spec update for warnning suspicious flag to `Regexp.new` 2022-06-20 19:35:12 +09:00
Nobuyoshi Nakada ab2a43265c Warn suspicious flag to `Regexp.new`
Now second argument should be `true`, `false`, `nil` or Integer.
This flag is confused with third argument some times.
2022-06-20 19:35:12 +09:00
Nobuyoshi Nakada a58611dfb1 Allow to just warn as bool expected, without an exception 2022-06-20 19:35:12 +09:00
Yusuke Endoh 15db2e9496 Prevent a warning "possibly useless use of a literal in void context" 2022-06-20 19:25:11 +09:00
Jun Aruga f8b6d4f4d1 .github/workflows/compilers.yml: Skip gaps test on annocheck 10.76.
This commit is to skip a failure with annocheck 10.76 on the annocheck test
case on the CI. Previously The test worked with annocheck 10.73.

The issue was reported at <https://bugs.ruby-lang.org/issues/18061#note-24>.
> Hardened: ruby: MAYB: test: gaps because no notes found
> Hardened: ruby: info: For more information visit: https://sourceware.org/annobin/annobin.html/Test-gaps.html

It seems that the annocheck added the gaps test at 10.76. Maybe the upstream commit is below.

The annocheck is a part of the annobin project: https://sourceware.org/annobin/
```
$ git clone git://sourceware.org/git/annobin.git

$ git show 61184ae1180a134bfbbd125e9fe339baedd67c18
commit 61184ae1180a134bfbbd125e9fe339baedd67c18
Author: Nick Clifton <nickc@redhat.com>
Date:   Mon Jun 13 16:56:46 2022 +0100

    Annocheck: Add TEST_GAPS.  Add MAYB for TEST_NOTES if DWARF info could not be found
...
```
2022-06-20 12:08:25 +02:00
Nobuyoshi Nakada 7f8a915715
[DOC] Refine Regexp.new argument descriptions 2022-06-20 18:39:50 +09:00
Nobuyoshi Nakada 914c26eab3
[DOC] Regexp timeout is float or nil 2022-06-20 17:47:44 +09:00
Yusuke Endoh 078db98da4 Prevent a warning "Expected ... to define AutoloadTest but it didn't"
related: [Bugs #18813] and eca31d24d6
2022-06-20 17:39:58 +09:00
citrusmoose 8d689294d0 [rubygems/rubygems] Fix extension paths in generated standalone script
The paths for extensions of gems would contain the hardcoded ruby
version on which the extension was built. This will replace it with
runtime ruby version like the parent version directory. It will make the
standalone script compatible between different ruby version installations.

https://github.com/rubygems/rubygems/commit/a9dae93d5d
2022-06-20 16:04:47 +09:00
Nobuyoshi Nakada ec5c56412f [Feature #18839] Drop support for gcc 3 [ci skip] 2022-06-20 12:11:41 +09:00
git 271bcc0c1c Update bundled gems list at 150bd6e242 [ci skip] 2022-06-20 02:45:22 +00:00
Soutaro Matsumoto 150bd6e242
Bundle RBS 2.5.1 (#6041)
* Bundle RBS 2.5.1
2022-06-20 11:44:47 +09:00
Nobuyoshi Nakada cd3a5cd0e3
[DOC] Fixed omissions in Regexp.new arguments 2022-06-20 09:26:11 +09:00
git 6622a41891 * 2022-06-20 [ci skip] 2022-06-20 02:34:57 +09:00
Josh Nichols aeab405878 [rubygems/rubygems] Improve performance of Bundler::SpecSet#for by using hash lookup of handled deps
I was looking at (yet another) flamegraph in speedscope, and used the
'left hand heavy' and was shocked to realize that 0.5s of the 1.7s
is spent in DepProxy#name. This method _only_ delegates the name to an
underlying spec, so it's not complex at all.

It seems to be of how often this line ends up calling it:

     next if handled.any?{|d| d.name == dep.name && (match_current_platform || d.__platform == dep.__platform) } || dep.name == "bundler"

The `handled` array is built up as dependencies are handled, so this get
slower as more dependencies are installed.

This change changes how `handled` is track. Instead of just an array, I've
tried using a Hash, with the key being a dep's name, and the value being
a list of deps with that name. This means it's constant time to find
the dependencies with the same name.

I saw a drop from 1.7s to 1.0s against master, and from 0.95s to 0.24s
when used with https://github.com/rubygems/rubygems/pull/5533

https://github.com/rubygems/rubygems/commit/844dac30d4
2022-06-20 02:34:41 +09:00
Nobuyoshi Nakada da362fee59
Scale the time to wait native threads to run hook 2022-06-19 23:33:26 +09:00
Nobuyoshi Nakada 4aebbf44e9
Remove unnecessary `*` before the function name 2022-06-19 23:32:47 +09:00
Nobuyoshi Nakada 5f8c73405e [ruby/etc] [DOC] Markup constant path names
https://github.com/ruby/etc/commit/6c9a0b4e5d
2022-06-19 11:06:43 +09:00
Nobuyoshi Nakada 5047283070
Skip CIs if the head commit message contains '[DOC]' 2022-06-19 11:05:31 +09:00
git 95a25e0441 * 2022-06-19 [ci skip] 2022-06-19 10:47:48 +09:00
Nobuyoshi Nakada ea38758322 [ruby/etc] [DOC] Markup string literals
https://github.com/ruby/etc/commit/a8801e07d1
2022-06-19 10:46:50 +09:00
Nobuyoshi Nakada cc67a11768 [ruby/etc] [DOC] Fix reference to different module
https://github.com/ruby/etc/commit/ea51739974
2022-06-19 10:46:48 +09:00
Nobuyoshi Nakada c594370c6e [ruby/etc] [DOC] Update
System-dependent feature macros are automatically detected by
extconf.rb, and are not used by users.

https://github.com/ruby/etc/commit/e7343b4e69
2022-06-19 10:46:47 +09:00
Jean Boussier eca31d24d6 [Bug #18813] Warn when autoload has to lookup in parent namespace
This is a verbose mode only warning.
2022-06-18 14:49:02 +02:00
Nobuyoshi Nakada e711711539
Show gcc version if too old, and move to GCC block [ci skip] 2022-06-18 13:40:46 +09:00
Nobuyoshi Nakada e77d2c296e
Disable maybe-uninitialized warning for gcc 4
It often shows false positive warnings (at least in 4.8).  Newer
versions work well and we can check correct warnings.
2022-06-18 13:15:02 +09:00
Nobuyoshi Nakada cab10a2c50
Extract `protect_page_body` to fix mismatched braces 2022-06-18 10:20:46 +09:00
Alan Wu 4b7c4bb92e tool/extlibs.rb: Use Exception#message for older rubies
This script runs with BASERUBY, which can be as old as 2.2.x.
Exception#full_message is new in 2.5.0.

I saw a NoMethodError on the AppVeyor CI where BASERUBY is 2.4.6:
https://ci.appveyor.com/project/ruby/ruby/builds/43870654/job/kae4uo2xbhuhqmdw#L121
2022-06-17 18:13:19 -04:00
Alan Wu 41a024f2b9 YJIT: Update note about symbol prefixes [ci skip] 2022-06-17 18:12:55 -04:00
John Hawthorn 566c5447ae YJIT: Use binwrite to write exit locations 2022-06-17 12:17:19 -07:00
git b184cdfd74 * 2022-06-18 [ci skip] 2022-06-18 00:10:38 +09:00
KJ Tsanaktsidis 05ffc037ad Disable Mach exception handlers when read barriers in place
The GC compaction mechanism implements a kind of read barrier by marking
some (OS) pages as unreadable, and installing a SIGBUS/SIGSEGV handler
to detect when they're accessed and invalidate an attempt to move the
object.

Unfortunately, when a debugger is attached to the Ruby interpreter on
Mac OS, the debugger will trap the EXC_BAD_ACCES mach exception before
the runtime can transform that into a SIGBUS signal and dispatch it.
Thus, execution gets stuck; any attempt to continue from the debugger
re-executes the line that caused the exception and no forward progress
can be made.

This makes it impossible to debug either the Ruby interpreter or a C
extension whilst compaction is in use.

To fix this, we disable the EXC_BAD_ACCESS handler when installing the
SIGBUS/SIGSEGV handlers, and re-enable them once the compaction is done.
The debugger will still trap on the attempt to read the bad page, but it
will be trapping the SIGBUS signal, rather than the EXC_BAD_ACCESS mach
exception. It's possible to continue from this in the debugger, which
invokes the signal handler and allows forward progress to be made.
2022-06-18 00:10:16 +09:00
Nobuyoshi Nakada 7f05f7378d
Reuse an interned string
Repeating to intern the same string is just redundant, as interned
strings for the same content are always the same object until it gets
collected.
2022-06-17 23:27:16 +09:00
Peter Zhu 2790bddda6 Remove unused function declaration
iseq_alloc is not used in compile.c. It is also a static function
declared in iseq.c so it's not accessible in compile.c.
2022-06-17 09:44:17 -04:00
Burdette Lamar 9327b6f222 [ruby/fileutils] [DOC] Revisions for module-level doc (https://github.com/ruby/fileutils/pull/90)
* Revisions for module-level doc

https://github.com/ruby/fileutils/commit/dcbad90a1f
2022-06-17 22:36:26 +09:00
Matt Valentine-House 721e012d42 [ci skip][lldb] Fix array length representation with USING_RVARGC
This commit makes `rp` report the correct array length in lldb.

When USING_RVARGC is set we use 7 bits of the flags to store the array
len rather than the usual 2, so they need to be part of the mask when
calculating the length in lldb.

When calculating whether rvargc is enabled I've used the same approach
that's used by `GC.using_rvargc?` which is to detect whether there is
more than one size pool in the current objspace.
2022-06-17 09:15:22 -04:00
Jean Boussier c34a5469c8 Debug TestThreadInstrumentation
It previously failed with:

```
    1) Failure:
  TestThreadInstrumentation#test_thread_instrumentation_fork_safe [/home/runner/work/ruby/ruby/src/test/-ext-/thread/test_instrumentation_api.rb:50]:
  <5> expected but was
  <4>.
```

Suggesting one `EXIT` event wasn't fired or processed.

Adding an assetion on `Thead#status` may help figure out what is wrong.
2022-06-17 15:11:10 +02:00
David Rodríguez 78425d7e74 [rubygems/rubygems] Unset ENV set by official Ruby docker images
So that it does not interfere with our specs.

https://github.com/rubygems/rubygems/commit/1029714e21
2022-06-17 17:05:52 +09:00
David Rodríguez 1e8bf48fd5 [rubygems/rubygems] Bring TODO message up to date
https://github.com/rubygems/rubygems/commit/e07dba0923
2022-06-17 17:05:21 +09:00